Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 637284 - sys-apps/portage-2.3.13: unused preserved libs not removed when emerge uninstalls a package due to blockers
Summary: sys-apps/portage-2.3.13: unused preserved libs not removed when emerge uninst...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: preserve-libs 637452
  Show dependency tree
 
Reported: 2017-11-12 22:20 UTC by Zac Medico
Modified: 2018-02-01 23:59 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-11-12 22:20:44 UTC
I noticed these unused preserved libs after libreoffice-5.2.7.2 was automatically uninstalled following installation of libreoffice-bin-5.4.2.2:

>>> Emerging binary (1 of 8) sys-libs/glibc-2.25-r8::gentoo                                                                        
>>> Installing (1 of 8) sys-libs/glibc-2.25-r8::gentoo
>>> Emerging binary (2 of 8) app-text/libstaroffice-0.0.5::gentoo
>>> Installing (2 of 8) app-text/libstaroffice-0.0.5::gentoo
>>> Emerging binary (3 of 8) media-libs/libzmf-0.0.2::gentoo
>>> Emerging binary (4 of 8) app-office/libreoffice-l10n-5.4.2.2::gentoo
>>> Emerging binary (5 of 8) dev-libs/xmlsec-1.2.24-r1::gentoo
>>> Emerging binary (6 of 8) dev-libs/libixion-0.12.2::gentoo
>>> Installing (3 of 8) media-libs/libzmf-0.0.2::gentoo
>>> Installing (4 of 8) app-office/libreoffice-l10n-5.4.2.2::gentoo
>>> Installing (5 of 8) dev-libs/xmlsec-1.2.24-r1::gentoo
>>> Installing (6 of 8) dev-libs/libixion-0.12.2::gentoo
>>> Emerging binary (7 of 8) dev-libs/liborcus-0.12.1::gentoo
>>> Installing (7 of 8) dev-libs/liborcus-0.12.1::gentoo
>>> Emerging binary (8 of 8) app-office/libreoffice-bin-5.4.2.2::gentoo
>>> Installing (8 of 8) app-office/libreoffice-bin-5.4.2.2::gentoo
>>> Recording app-office/libreoffice-bin in "world" favorites file...
>>> Uninstalling app-office/libreoffice-5.2.7.2::gentoo
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Regenerating GNU info directory index...
 * Processed 195 info files.

!!! existing preserved libs:
>>> package: dev-libs/liborcus-0.12.1
 *  - /usr/lib64/liborcus-parser-0.11.so.0
 *  - /usr/lib64/liborcus-parser-0.11.so.0.0.0
 *  - /usr/lib64/liborcus-0.11.so.0
 *  - /usr/lib64/liborcus-0.11.so.0.0.0
Use emerge @preserved-rebuild to rebuild packages using these libraries

When I re-install the liborcus-0.12.1 binary package, the unused preserved libs are automatically removed.
Comment 1 Zac Medico gentoo-dev 2017-11-12 22:50:46 UTC
It looks like the problem is that dblink.unmerge() calls self._prune_plib_registry() with no arguments, which then calls self._find_unused_preserved_libs(unmerge_no_replacement=False), but we really want unmerge_no_replacement=True behavior here.
Comment 2 Zac Medico gentoo-dev 2017-11-13 01:28:26 UTC
The lib_graph inside _find_unused_preserved_libs shows that it's using NEEDED.ELF.2 data from the libreoffice-5.2.7.2, even though the files now belong to libreoffice-bin-5.4.2.2 (which depend on liborcus-*0.12.so.0):

['/usr/lib64/libreoffice/program/libsclo.so'] depends on
  ['/usr/lib64/liborcus-parser-0.11.so.0', '/usr/lib64/liborcus-parser-0.11.so.0.0.0'] (0)
['/usr/lib64/liborcus-parser-0.11.so.0', '/usr/lib64/liborcus-parser-0.11.so.0.0.0'] (no children)
['/usr/lib64/liborcus-0.11.so.0', '/usr/lib64/liborcus-0.11.so.0.0.0'] depends on
  ['/usr/lib64/liborcus-parser-0.11.so.0', '/usr/lib64/liborcus-parser-0.11.so.0.0.0'] (0)
['/usr/lib64/libreoffice/program/libscfiltlo.so'] depends on
  ['/usr/lib64/liborcus-parser-0.11.so.0', '/usr/lib64/liborcus-parser-0.11.so.0.0.0'] (0)
  ['/usr/lib64/liborcus-0.11.so.0', '/usr/lib64/liborcus-0.11.so.0.0.0'] (0)

The files from libreoffice-bin-5.4.2.2 actually depend on liborcus-0.12.so.0
Comment 4 Larry the Git Cow gentoo-dev 2017-11-14 03:15:04 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=0936d873aedccfb46ca4353c0b52f460287d6682

commit 0936d873aedccfb46ca4353c0b52f460287d6682
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-11-13 02:11:07 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-11-14 03:14:19 +0000

    vardbapi.removeFromContents: update NEEDED (bug 637284)
    
    When removing files from CONTENTS, also remove the corresponding
    lines from NEEDED, so that they do not corrupt LinkageMap data
    for preserve-libs.
    
    Bug: https://bugs.gentoo.org/637284
    Reviewed-by: Manuel Rüger <mrueg@gentoo.org>

 pym/portage/dbapi/vartree.py | 42 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)}