Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 382541 - autotools-utils.eclass should always drop .la files in libdirs (if .pc exists)
Summary: autotools-utils.eclass should always drop .la files in libdirs (if .pc exists)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Maciej Mrozowski
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 382537 382715 382739
  Show dependency tree
 
Reported: 2011-09-10 18:33 UTC by Michał Górny
Modified: 2011-09-18 15:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A simple test script to handle described behavior (la-remover-test.bash,396 bytes, text/plain)
2011-09-11 21:47 UTC, Michał Górny
Details
Patch to autotools-utils (autotools-utils.eclass.diff,1.96 KB, patch)
2011-09-12 13:45 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-10 18:33:38 UTC
As the description says, Gentoo does not support installing .la files when pkg-config files are provided by a package. We have to think a little on how to implement this (and possibly automatically check for the case) but already opening a bug to cover the discussion.
Comment 1 Maciej Mrozowski gentoo-dev 2011-09-11 12:12:27 UTC
Well, presence of .pc file may be some assumption. It's not always right though, for instance ImageMagick installs .pc files, yet its plugin loader seems to require .la files.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-11 15:24:20 UTC
(In reply to comment #1)
> though, for instance ImageMagick installs .pc files, yet its plugin loader
> seems to require .la files.

But these .la files aren't installed in libdir, and they correspond to modules, not libraries. We are considering libraries only right now.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2011-09-11 17:34:21 UTC
If you look at bug 366071 you'll find it's not good idea to remove /usr/$(get_libdir)/libfoo.la either when modules need to keep their .la files
That's why ImageMagick empties dependency_libs in src_install() instead, avoiding the libcanberra mistake (bug 366071)

Anyway this bug doesn't really block bug 382537 because it's up to the maintainers to watch out cases like these, and then use the 'all' argument in the remove_libtool_files() in autotools-utils.eclass

And that is why I dislike the eclass in it's current form, half-fixing and adding USE=static-libs the packages is seriously distracting and making it more difficult to find out unmigrated packages... at least this should be really made known to people using the eclass.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-11 18:15:02 UTC
(In reply to comment #3)
> If you look at bug 366071 you'll find it's not good idea to remove
> /usr/$(get_libdir)/libfoo.la either when modules need to keep their .la files
> That's why ImageMagick empties dependency_libs in src_install() instead,
> avoiding the libcanberra mistake (bug 366071)

Ouch, indeed that one is harder.

> Anyway this bug doesn't really block bug 382537 because it's up to the
> maintainers to watch out cases like these, and then use the 'all' argument in
> the remove_libtool_files() in autotools-utils.eclass
> 
> And that is why I dislike the eclass in it's current form, half-fixing and
> adding USE=static-libs the packages is seriously distracting and making it more
> difficult to find out unmigrated packages... at least this should be really
> made known to people using the eclass.

I guess we could do the '.pc watch + cleanup' thing by default and add AUTOTOOLS_PRESERVE_LAFILES or sth like that when necessary. Or just watch for .la files in other directories and fix them as appropriate.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-11 21:47:00 UTC
Created attachment 286179 [details]
A simple test script to handle described behavior

Ok, my first tests show there is a single .pc file on my system which uses '-lfoo-${version}'. We could use pkg-config to expand that but then we will have to DEPEND on it. That could be useful but I'm not sure if it is really expected.

Or we can just assume that one package would be a side loss, and if it started to use autotools-utils at some point, it will have to call .la removal manually.

Attaching my little test tool / proof-of-concept code.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-12 13:45:59 UTC
Created attachment 286223 [details, diff]
Patch to autotools-utils

And here it is. It removes .la files even with USE=static-libs when:
- a .pc file is installed referring to the same library,
- they don't provide any libs nor linker flags.

Although I'm not sure if we're going the right way. Looking at autoconf macros, they don't really handle static compiling with pkg-config right. I don't see '--static' passed anywhere so that means autoconf always get dynamic linking flags only. Are you sure about that .la removal mania?
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-18 15:04:47 UTC
Done now, let's see how it works.