Author Topic: lafilefixer-0.5  (Read 820 times)

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3794
lafilefixer-0.5
« on: April 26, 2012, 12:11:21 AM »
When packaging, I generally stay away from major libraries or build environment type packages because I don't want to make errors that interferes with others. ;D

However, when building autotrace I ran into the apparently common error where libtool can't find an .la file. After lots of research, the only thing that fixes the problem is a script from gentoo called lafilefixer. I created an rpm and it worked great for this problem and autotrace builds and runs perfectly. So far, so good!

The low-level details are a little tricky, though. First, if you run it like this:
lafilefixer --just-fix-it /usr/%{_lib}
it 'fixes' all of the .la files on your system. It redirects all links to other .la files to the corresponding .so library. As far as I can tell from research there is no downside to this, but I can't prove it without testing. The only concern for me is that if a problem arises, there is no way to 'unfix' the 'fix'. :-[
Another issue is if we want to use this, do we put it into every package that complains?
I believe that you could use it to just 'fix' a specific missing .la file, but once I ran the script, I have no way of tracing with file was missing anymore. For example, you could put in the specfile just before the %{_make}:
lafilefixer --just-fix-it /usr/%{_lib}/somefile.la
This would 'fix' just one file. Any thoughts?

http://min.us/mujGo5rlL

Galen

Offline rubentje1991

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2110
  • Rubenus Parvus MCMXCI
Re: lafilefixer-0.5
« Reply #1 on: April 26, 2012, 12:20:07 AM »
Is this related?:
http://www.pclinuxos.com/forum/index.php?topic=101309.0


And:
Quote
   
Re: Packagers Tips and Hints
« Reply #4 on: April 11, 2012, 04:38:29 AM »
   
*-*.*.la: No such file or directory

Code:
/bin/grep: /usr/lib64/libpangocairo-1.0.la: No such file or directory   
/bin/sed: can't read /usr/lib64/libpangocairo-1.0.la: No such file or directory   
libtool: link: `/usr/lib64/libpangocairo-1.0.la' is not a valid libtool archive   
make[3]: *** [geanyvc.la] Error 1
                 

From our boss Texstar

Code:
Try first rm -rf /usr/lib64/*.la

-l

http://www.pclinuxos.com/forum/index.php/topic,101266.msg890214.html#msg890214

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3794
Re: lafilefixer-0.5
« Reply #2 on: April 26, 2012, 12:45:33 AM »
Yes, these are exactly the problems that keep cropping up. Removing certain .la files works for some packages, but when you have to run autoconf, libtool, autogen.sh, etc., strange unpredictable things seem to happen. If when searching for the problem in a specific package and it is still unsolved, gentoo users have had a one size fits all fix using the lafilefixer script.

My problem for autotrace is that if I use the script to make my src.rpm build, it won't build for others unless the script is run from the specfile.

Galen

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: lafilefixer-0.5
« Reply #3 on: April 26, 2012, 12:50:09 AM »
Galen,     
As root / before build ---
rm -f /usr/lib64/*.la
for 64bit.

rm -f /usr/lib/*.la
for 32bit.     

I have a text file with this as content - in case I forget.     

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3794
Re: lafilefixer-0.5
« Reply #4 on: April 26, 2012, 12:57:47 AM »
Galen,     
As root / before build ---
rm -f /usr/lib64/*.la
for 64bit.

rm -f /usr/lib/*.la
for 32bit.     

I have a text file with this as content - in case I forget.     

Thanks, Neal. Ok, so if I submit autotrace (builds on 32 and 64) with
rm -f %{_libdir}/*.la
just before 'make' it should build from the same spec file in both environments?

Galen

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: lafilefixer-0.5
« Reply #5 on: April 26, 2012, 11:38:29 PM »
I run the command from a root terminal before starting the package build, but you can add to your spec, if you prefer.     

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3794
Re: lafilefixer-0.5
« Reply #6 on: April 26, 2012, 11:51:54 PM »
I run the command from a root terminal before starting the package build, but you can add to your spec, if you prefer.     

One last question: Does this always work, or are there case where a particular .la file needs to be kept and fixed for any reason?

Galen

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: lafilefixer-0.5
« Reply #7 on: April 27, 2012, 12:15:21 AM »
I've never had it fail me.     

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: lafilefixer-0.5
« Reply #8 on: April 27, 2012, 05:49:39 AM »
you cant add it in your specfile, because you don't have to build packages as root.
Never do this.



This is, what you have to do...
Galen,    
As root / before build ---
rm -f /usr/lib64/*.la
for 64bit.

rm -f /usr/lib/*.la
for 32bit.    

I have a text file with this as content - in case I forget.    


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: lafilefixer-0.5
« Reply #9 on: April 28, 2012, 04:53:51 AM »
Moved this topic to Packagers. It is more appropriate for the discussion.