Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 253121

Summary: portage-2.2_rc20 doesn't preserve indirect *.so dependencies
Product: Portage Development Reporter: Martin von Gagern <Martin.vGagern>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, pappy_mcfae
Priority: High    
Version: 2.2   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 240323    
Attachments: script to find libraries that are required indirectly

Description Martin von Gagern 2008-12-30 11:20:54 UTC
Steps to reproduce:
1. emerge -1 =dev-db/oracle-instantclient-basic-10.2.0.3-r1
2. USE="apache2 oci8-instant-client" emerge -1 php
3. emerge -1 dev-db/oracle-instantclient-basic
4. ldd /usr/lib/apache2/modules/libphp5.so
5. /etc/init.d/apache restart

Expected result:
* libclntsh.so and libnnz10.so should be preserved
* libphp5.so should link all right, with no missing dependencies
* apache should start with php support

Actual result:
* libclntsh.so preserved as a direct dependency of libphp5.so
* libnnz10.so dropped, as it is a dependency of libclntsh.so
* ldd prints "libnnz10.so => not found"
* apache fails to start due to this missing dependency of the php module

To find this kind of indirect dependency, I found the following command useful:
$ LD_DEBUG=files LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux.so.2 <some *.so>
This actually prints which files are needed by which ones.

The NEEDED files seem to list direct dependencies correctly, but portage doesn't seem to take the transitive cover into account when unmerging, at least not the part corresponding to the package just being unmerged.
Comment 1 Sebastian Luther (few) 2009-05-16 06:30:10 UTC
*** Bug 270022 has been marked as a duplicate of this bug. ***
Comment 2 Bob Raitz 2009-05-16 07:06:41 UTC
(In reply to comment #1)
> *** Bug 270022 has been marked as a duplicate of this bug. ***
> 

Are you sure? I'm running portage-2.2_rc33. If so, I guess this bug has seniority.
Comment 3 Zac Medico gentoo-dev 2011-05-18 16:56:04 UTC
This should have been fixed by the following commit which uses a directed graph to keep track of the indirect *.so dependencies:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a97986713e6a0138551970592fad3a63a6a7d7ae

In 2.2.0_alpha34 there are lots of preserve-libs fixes, including bug 286714. Please re-open if you can still reproduce this with 2.2.0_alpha34.
Comment 4 Zac Medico gentoo-dev 2011-05-19 03:41:10 UTC
Created attachment 273901 [details]
script to find libraries that are required indirectly

This script will find libraries that are useful for testing purposes. For example, on my system, one of the libraries that it identified was libgvnc-1.0.so.0.0.1:

  net-libs/gtk-vnc-0.4.3 /usr/lib/libgvnc-1.0.so.0.0.1

In order to test the unmerge case (bug 286714), I unmerged gtk-vnc, and the library was correctly preserved:

!!! existing preserved libs:
>>> package: net-libs/gtk-vnc-0.4.3
 *  - /usr/lib/libgvnc-1.0.so
 *  - /usr/lib/libgvnc-1.0.so.0
 *  - /usr/lib/libgvnc-1.0.so.0.0.1
 *  - /usr/lib/libgtk-vnc-1.0.so
 *  - /usr/lib/libgtk-vnc-1.0.so.0
 *  - /usr/lib/libgtk-vnc-1.0.so.0.0.1
 *      used by /usr/lib/vinagre-1/plugins/libvnc.so (net-misc/vinagre-2.30.3)

In order to test the installation/upgrade case, I created a copy of of the gtk-vnc-0.4.3 ebuild and modified it so that it would install nothing. When I installed this empty ebuild, libgvnc-1.0.so.0.0.1 was correctly preserved in this case as well.