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.
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.
(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.
I've posted a patch for review: https://archives.gentoo.org/gentoo-portage-dev/message/186cffae184d6033e84b811a77b8e5f5 https://github.com/gentoo/portage/pull/69
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=fb25c5d908c22bdd6868c7db44c56ef5cd459fe4
Fixed in portage-2.3.3.