preserved-rebuild set shouldn't contain packages only containing broken libraries preserved for other packages. I had www-client/links[directfb] and dev-libs/DirectFB-1.0.0 and preserved-rebuild set was empty. I upgraded dev-libs/DirectFB-1.0.0 to dev-libs/DirectFB-1.1.0 Actual results: !!! existing preserved libs: >>> package: dev-libs/DirectFB-1.1.0 * - /usr/lib/libdirectfb-1.0.so.0 * - /usr/lib/libdirectfb-1.0.so.0.0.0 Use emerge @preserved-rebuild to rebuild packages using these libraries and then remerge the packages listed above. # portageq list_preserved_libs / dev-libs/DirectFB-1.1.0 /usr/lib/libdirectfb-1.0.so.0 /usr/lib/libdirectfb-1.0.so.0.0.0 # emerge -ptv @preserved-rebuild These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild R ] www-client/links-2.1_pre28-r1 USE="X directfb fbcon gpm javascript jpeg png sdl ssl svga tiff unicode -livecd" 0 kB [ebuild R ] dev-libs/DirectFB-1.1.0 USE="fbcon gif jpeg mmx png sdl sse sysfs truetype zlib -debug -fusion -v4l -v4l2" 0 kB Total: 2 packages (2 reinstalls), Size of downloads: 0 kB # revdep-rebuild -ptv WARNING WARNING *** This is a rewritten version of revdep-rebuild *** WARNING WARNING WARNING Please report any bugs to http://bugs.gentoo.org WARNING WARNING In the bug report please include the following information: WARNING emerge --info WARNING A copy of the output from the revdep-rebuild command WARNING A copy of the .revdep-rebuild* files as an attachment WARNING WARNING If the bug is severe, the previous version of revdep-rebuild is located WARNING at: /usr/lib/gentoolkit/bin/revdep-rebuild WARNING WARNING WARNING *** This is a rewritten version of revdep-rebuild *** WARNING * Configuring search environment for revdep-rebuild * Checking reverse dependencies * Packages containing binaries and libraries broken by a package update * will be emerged. * Collecting system binaries and libraries * Generated new /root/.revdep-rebuild.1_files * Collecting complete LD_LIBRARY_PATH * Generated new /root/.revdep-rebuild.2_ldpath * Checking dynamic linking consistency [ 68% ] * broken /usr/lib/libdirectfb-1.0.so.0.0.0 (requires libdirect-1.0.so.0 libfusion-1.0.so.0) [ 100% ] * Generated new /root/.revdep-rebuild.3_rebuild * Assigning files to packages * /usr/lib/libdirectfb-1.0.so.0.0.0 -> dev-libs/DirectFB * Generated new /root/.revdep-rebuild.4_packages_raw and /root/.revdep-rebuild.4_package_owners * Cleaning list of packages to rebuild * Generated new /root/.revdep-rebuild.4_packages * Assigning packages to ebuilds * Generated new /root/.revdep-rebuild.4_ebuilds * Evaluating package order * Generated new /root/.revdep-rebuild.5_order * All prepared. Starting rebuild emerge --oneshot -ptv =dev-libs/DirectFB-1.1.0 .......... These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild R ] dev-libs/DirectFB-1.1.0 USE="fbcon gif jpeg mmx png sdl sse sysfs truetype zlib -debug -fusion -v4l -v4l2" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB * Build finished correctly. Removing temporary files... * You can re-run revdep-rebuild to verify that all libraries and binaries * are fixed. If some inconsistency remains, it can be orphaned file, deep * dependency, binary package or specially evaluated library. # for x in `portageq list_preserved_libs /` ; do mv ${x} ${x}.preserved 2>/dev/null ; done `/usr/lib/libdirectfb-1.0.so.0' -> `/usr/lib/libdirectfb-1.0.so.0.preserved' `/usr/lib/libdirectfb-1.0.so.0.0.0' -> `/usr/lib/libdirectfb-1.0.so.0.0.0.preserved' # revdep-rebuild -ptv WARNING WARNING *** This is a rewritten version of revdep-rebuild *** WARNING WARNING WARNING Please report any bugs to http://bugs.gentoo.org WARNING WARNING In the bug report please include the following information: WARNING emerge --info WARNING A copy of the output from the revdep-rebuild command WARNING A copy of the .revdep-rebuild* files as an attachment WARNING WARNING If the bug is severe, the previous version of revdep-rebuild is located WARNING at: /usr/lib/gentoolkit/bin/revdep-rebuild WARNING WARNING WARNING *** This is a rewritten version of revdep-rebuild *** WARNING * Configuring search environment for revdep-rebuild * Checking reverse dependencies * Packages containing binaries and libraries broken by a package update * will be emerged. * Collecting system binaries and libraries * Generated new /root/.revdep-rebuild.1_files * Collecting complete LD_LIBRARY_PATH * Generated new /root/.revdep-rebuild.2_ldpath * Checking dynamic linking consistency [ 14% ] * broken /usr/bin/links (requires libdirectfb-1.0.so.0) [ 68% ] * broken /usr/lib/libdirectfb-1.0.so.0.0.0.preserved (requires libdirect-1.0.so.0 libfusion-1.0.so.0) [ 100% ] * Generated new /root/.revdep-rebuild.3_rebuild * Assigning files to packages * /usr/bin/links -> www-client/links * !!! /usr/lib/libdirectfb-1.0.so.0.0.0.preserved not owned by any package is broken !!! * /usr/lib/libdirectfb-1.0.so.0.0.0.preserved -> (none) * Generated new /root/.revdep-rebuild.4_packages_raw and /root/.revdep-rebuild.4_package_owners * Cleaning list of packages to rebuild * Generated new /root/.revdep-rebuild.4_packages * Assigning packages to ebuilds * Generated new /root/.revdep-rebuild.4_ebuilds * Evaluating package order * Generated new /root/.revdep-rebuild.5_order * All prepared. Starting rebuild emerge --oneshot -ptv =www-client/links-2.1_pre28-r1 .......... These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild R ] www-client/links-2.1_pre28-r1 USE="X directfb fbcon gpm javascript jpeg png sdl ssl svga tiff unicode -livecd" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB * Build finished correctly. Removing temporary files... * You can re-run revdep-rebuild to verify that all libraries and binaries * are fixed. If some inconsistency remains, it can be orphaned file, deep * dependency, binary package or specially evaluated library. * Found some broken files that weren't associated with known packages * The broken files are: * /usr/lib/libdirectfb-1.0.so.0.0.0.preserved # As you can see, preserved-rebuild set needlessly contains dev-libs/DirectFB-1.1.0. The example above isn't ideal, but something similar can potentially happen in case of some other packages [1]. I hope that you understand my suggestion, however I don't know if this suggestion can be easily implemented. Expected results: !!! existing preserved libs: >>> package: dev-libs/DirectFB-1.1.0 * - /usr/lib/libdirectfb-1.0.so.0 * - /usr/lib/libdirectfb-1.0.so.0.0.0 Use emerge @preserved-rebuild to rebuild packages using these libraries and then remerge the packages listed above. # emerge -ptv @preserved-rebuild These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild R ] www-client/links-2.1_pre28-r1 USE="X directfb fbcon gpm javascript jpeg png sdl ssl svga tiff unicode -livecd" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB # [1] - This example isn't reproducible in all configurations, but I haven't found always reproducible examples yet.
Currently I think that this problem should be solved in another way. FEATURES="preserve-libs" should preserve libraries only needed by other libraries which are being preserved. Example: Package A contains libA.so. Package =B-1 contains libB.so.1 and libC.so.1. Package =B-2 contains libB.so.2 and libC.so.2. libA.so is linked against only libB.so and not libC.so. libB.so is linked against libC.so. User has A and =B-1. User upgrades =B-1 to =B-2 with FEATURES="preserve-libs", so Portage will preserve libB.so.1 but not libC.so.1. Portage should preserve also libC.so.1. It should be easier to implement than original suggestion and has other benefits.
(In reply to comment #1) > Currently I think that this problem should be solved in another way. > > FEATURES="preserve-libs" should preserve libraries only needed by other > libraries which are being preserved. Yeah, guess I didn't consider indirect linkage. Though I'd still be interested in why DirectFB is contained in preserved-rebuild. Can you reproduce that situation and attach /var/cache/edb/library_consumers?
(In reply to comment #2) > Though I'd still be interested in why DirectFB is contained in > preserved-rebuild. Can you reproduce that situation and > attach /var/cache/edb/library_consumers? Steps to reproduce: USE="-directfb" emerge -uN1 @everything emerge -1 =DirectFB-1.0* USE="directfb" LDFLAGS="-Wl,--as-needed" emerge links emerge -1 =DirectFB-1.1*
Created attachment 138529 [details] library_consumers.bz2
Hmm, I think I completely misunderstood this bug :/ Guess what's needed is to copy the has_external_consumers check to PreservedLibraryConsumersSet now that preserved libs are removed dynamically.
(In reply to comment #5) > what's needed is to copy the has_external_consumers check to > PreservedLibraryConsumersSet now that preserved libs are removed > dynamically. It probably will be helpful but the suggestion from Comment #1 still should be implemented.
Could you check if this is still relevant with 2.2_pre6? Because each time I review this report I come to a different conclusion what it is about :/
The bug described in comment #1 is fixed. The bug described in comment #0 is not fixed, but current behavior is slightly different, so I'm moving it to Bug #220953.