For example, deps like these might pull in an unnecessary jre: DEPEND=">=virtual/jdk-1.3" RDEPEND=">=virtual/jre-1.3" A quick-and-dirty fix for the above case would be to reverse the order of DEPEND and RDEPEND handling in the depgraph _add_pkg_deps method. In there it currently adds DEPEND to _dep_disjunctive_stack first, which means _pop_disjunction will pop it last. But we need to pop DEPEND first, so that the jdk is evaluated first. Once the jdk decision is made, it will influence the jre decision automatically.
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/7909292207a5592e7ac7d271957d65f7 https://github.com/gentoo/portage/pull/230
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=09185309aad49b83f29ef94b11318998e520e138 commit 09185309aad49b83f29ef94b11318998e520e138 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2017-12-03 22:36:45 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2017-12-07 19:08:21 +0000 depgraph: eval disjunctive build deps earlier (bug 639346) Since built-time deps tend to be a superset of run-time deps, evaluate disjunctive build-time deps before run-time deps, so that choices for build-time deps influence choices for run-time deps. Also, fix OnlydepsMinimalTestCase to specify ambiguous_merge_order, since the merge order is affected by the order of evaluation. Bug: https://bugs.gentoo.org/639346 Acked-by: Brian Dolbec <dolsen@gentoo.org> pym/_emerge/depgraph.py | 12 ++- .../resolver/test_disjunctive_depend_order.py | 87 ++++++++++++++++++++++ .../tests/resolver/test_onlydeps_minimal.py | 5 +- 3 files changed, 98 insertions(+), 6 deletions(-)}
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=524aa791f28ffcc1df921d8a8a9c111b7e359099 commit 524aa791f28ffcc1df921d8a8a9c111b7e359099 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-09-12 19:40:44 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-09-12 19:42:37 +0000 VirtualCircularChoicesTestCase: remove todo flag (bug 384107) This test passes since the fix for bug 639346 in commit 09185309aad49b83f29ef94b11318998e520e138. Bug: https://bugs.gentoo.org/384107 Bug: https://bugs.gentoo.org/639346 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/tests/resolver/test_circular_choices.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)