Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201785 - FEATURES="preserve-libs" should preserve libraries only needed by other libraries which are being preserved
Summary: FEATURES="preserve-libs" should preserve libraries only needed by other libra...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-09 18:20 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2008-05-08 15:31 UTC (History)
0 users

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


Attachments
library_consumers.bz2 (library_consumers.bz2,83.75 KB, application/octet-stream)
2007-12-15 01:44 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-12-09 18:20:54 UTC
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.
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-12-12 11:03:26 UTC
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.
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2007-12-13 03:20:12 UTC
(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?
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-12-15 01:42:52 UTC
(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*
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-12-15 01:44:42 UTC
Created attachment 138529 [details]
library_consumers.bz2
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2008-02-05 13:16:58 UTC
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.
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-02-17 18:10:30 UTC
(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.
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2008-05-05 11:36:43 UTC
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 :/
Comment 8 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-05-08 15:31:18 UTC
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.