Created attachment 387102 [details] emerge -uDpv --changed-use --debug world I have the following in /etc/portage/package.keywords: dev-python/pypy ** virtual/pypy ** Rather than upgrade to virtual/pypy-2.4.0 and dev-python/pypy-2.4.0, portage wants to replace dev-python/pypy-2.3.1 with dev-python/pypy-bin-2.3.1. A debug log is attached.
Also noteworthy is this workaround, which successfully upgrades to pypy-2.4.0 and rebuilds the necessary packages: emerge -1 /usr/lib64/pypy virtual/pypy
Adding --backtrack=1000 produces a different debug log, but the same end result.
I suspect that adding dev-python/pypy world serve as a good workaround for this issue. I'll see if I can make a test case to reproduce it.
The problem is likely to be rooted in the missed virtual/pypy-2.4.0 upgrade. I can reproduce that using a simple test case involving dev-python/pygments and virtual/pypy. Due to the virtual/pypy:0/2.3= dep of the install pygments instance, virtual/pypy-2.3.1 is added to the graph, and this later causes _dep_check_composite_db to select virtual/pypy-2.3.1 to satisfy the virtual/pypy:= dependency of the unbuilt dev-python/pygments replacement parent. So, it seems that _dep_check_composite_db needs to be fixed to detect the virtual/pypy-2.4.0 upgrade and choose that instead.
Created attachment 387484 [details, diff] depgraph: fix bug #526160 This fixes _dep_check_composite_db to mask packages that aren't the highest visible match, but only if an update is desirable. This causes desirable updates to get pulled in for cases like bug #526160. The included unit test simulates the virtual/pypy update that triggered the bug.
Created attachment 387498 [details, diff] depgraph: fix bug #526160 This updated patch fixes the new logic so that it only applies to virtual packages, since that's the only case where it is currently needed.
This is in git now: https://github.com/gentoo/portage/commit/d3be49fe6827aa1974856dffe6d5a1aca80a7bed
Created attachment 387684 [details] Test against f883c84b I just tested with git master, and it still seems to prefer pypy-bin-2.3.1 over pypy-2.4.0. Debug log attached.
The debug log shows that slot_operator_update_probe is failing to pull in virtual/pypy-2.4.0, and it also shows "Virtual Parent" debug info in conjunction with the failure, indicating that the code from bug 141118 is being triggered. On the other hand, the debug log from my unit test does not show the "Virtual Parent" debug info. I'll have to investigate the reason for this difference, since that may lead to some more clues.
Created attachment 387710 [details, diff] _dep_check_composite_db: fix bug #526160 This patch applies on top of the previous one. Alternatively, use this branch: https://github.com/zmedico/portage/commits/bug_526160
(In reply to Zac Medico from comment #10) Nice work, that seems to have resolved it.
Great, thanks for testing.
This is in git now: https://github.com/gentoo/portage/commit/b7fdd57d50d0956420d73b958eb826ba6eab513a
*** Bug 510370 has been marked as a duplicate of this bug. ***
This is in the portage-2.2.15 release.