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 599240 - sys-apps/portage: preserve-libs registry fails to prune itself when re-merging a package containing previously preserved libraries that had been manually removed
Summary: sys-apps/portage: preserve-libs registry fails to prune itself when re-mergin...
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 604854
  Show dependency tree
 
Reported: 2016-11-08 22:13 UTC by Zac Medico
Modified: 2017-02-10 18:52 UTC (History)
1 user (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 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.