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

Bug 599240

Summary: sys-apps/portage: preserve-libs registry fails to prune itself when re-merging a package containing previously preserved libraries that had been manually removed
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: Normal Keywords: InVCS
Version: 2.2   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 240323, 604854    

Description Zac Medico gentoo-dev 2016-11-08 22:13:21 UTC
I triggered this issue by unmerging app-text/editorconfig-core-c-0.12.1, removing the resulting preserved libraries manually, and then re-merging the package. Afterwards, the libraries showed as preserved even though I had just re-merged the package:

!!! existing preserved libs:
>>> package: app-text/editorconfig-core-c-0.12.1
 *  - /usr/lib64/libeditorconfig.so.0
 *  - /usr/lib64/libeditorconfig.so.0.12.1
 *      used by /usr/lib64/geany/editorconfig-geany.so (dev-util/editorconfig-geany-0.1_p20160725)

The issue is triggered in part because PreservedLibsRegistry.pruneNonExisting is convinced that the newly merged libraries are the preserved libraries, even though the preserved libraries had been manually removed.
Comment 1 Zac Medico gentoo-dev 2016-11-09 07:45:09 UTC
Since the manually removed libraries do not exist on disk prior to merge, they don't show up in the plib_collisions dictionary here:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/dbapi/vartree.py?h=portage-2.3.2#n4408

It seems like the easiest fix would be to intersect files in the PreservedLibsRegistry with the files installed by the current package, and add those files to the plib_collisions dictionary.
Comment 2 Zac Medico gentoo-dev 2016-11-09 08:42:37 UTC
(In reply to Zac Medico from comment #1)
> It seems like the easiest fix would be to intersect files in the
> PreservedLibsRegistry with the files installed by the current package, and
> add those files to the plib_collisions dictionary.

That won't work, because at this point there's no way to distinguish files that have been legitimately installed from those that were already preserved. So, we'll have to write the pruned preserve-libs registry to disk prior to merge.
Comment 5 Zac Medico gentoo-dev 2017-02-10 18:52:31 UTC
Fixed in portage-2.3.3.