Eliminating automatic provides on private libs

Hans de Goede hdegoede at redhat.com
Fri Apr 27 10:55:14 UTC 2012


Hi,

On 04/27/2012 10:13 AM, Panu Matilainen wrote:
>
> I started once again looking at ways to eliminate the unwanted provides on private libs such as dlopen()'ed modules with minimal fuss and breakage. Been down this route more than once but I suspect the last time was before the major dependency generator changes in rpm-4.9.x, which made tweaking these things a good deal easier, so time for another round:
>
> The short background is that for libraries which dont have a SONAME, rpmbuild fakes one based on the file name. The rationale for this has been that since the linker permits linking to libraries without sonames, rpm must permit this too. The downside is that for the 1% corner cases that need this, we end up polluting the provides namespace with thousands of unnecessary and unwanted names, names that have not been picked up with a global namespace in mind.
>
> To get a rough idea just how much of this unwanted junk exists, using a slightly modified elfdeps generator on my system:
>
> This is how we currently generate the provides:
> [root at localhost rpm]# find /lib64/ /usr/lib64/ -type f |./elfdeps -P --soname-only --fake-soname|wc -l
> 3875
>
> And this is without faked soname provides:
> [root at localhost rpm]# find /lib64/ /usr/lib64/ -type f |./elfdeps -P --soname-only |wc -l
> 2816
>
> So... about a third of the soname provides are faked by using library basename for its provide name, and almost all of them are for no good reason. The three general cases that something actually depends on are
> 1) libreoffice sub-packages depending on its internal libraries from libreoffice-core
> 2) a handful of packages depending on llvm libraries
> 3) bigger pile of packages depending on libperl.so
>
> Of these at least 2) does look like a bug really, and in fact has been fixed upstream: http://llvm.org/bugs/show_bug.cgi?id=12334. Dunno about 3), perl is... what it is. 1) might well classify as an inevitable special case (there will always be those), dunno.
>
> Obviously this is just a fairly small sample of the entire Fedora package set, there are bound to be many more special cases, buggy libraries which do not have SONAME when they should and stuff that falls into gray areas. I can try to provide more comprehensive stats based on current rawhide if needed.
>
> I'm going to add a switch to allow packages to control the behavior anyway. Whether rpm upstream defaults to the traditional behavior for compatibility reasons or not is another question, but Fedora is obviously free to override that. Given the packaging guideline mandate to eliminate private soname provides from packages it seems like a no-brainer to disable faked sonames by default, and require the handful of special cases to work around it (adding enable-switches to specs) instead of adding disable-switches to possibly hundreds of packages to cater for the special cases needs.
>
> Thoughts? This would obviously only change in rawhide.

Great! Can we disable these bogus provides starting tomorrow please?  :)

Regards,

Hans




More information about the devel mailing list