Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639346 - sys-apps/portage: account for overlap between DEPEND and RDEPEND when evaluating || deps
Summary: sys-apps/portage: account for overlap between DEPEND and RDEPEND when evaluat...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
Keywords: PATCH
Depends on:
Blocks: 155723 637452
  Show dependency tree
Reported: 2017-11-30 21:46 UTC by Zac Medico
Modified: 2019-09-12 20:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-11-30 21:46:10 UTC
For example, deps like these might pull in an unnecessary jre:


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.
Comment 2 Larry the Git Cow gentoo-dev 2017-12-07 19:09:10 UTC
The bug has been referenced in the following commit(s):

commit 09185309aad49b83f29ef94b11318998e520e138
Author:     Zac Medico <>
AuthorDate: 2017-12-03 22:36:45 +0000
Commit:     Zac Medico <>
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.
    Acked-by: Brian Dolbec <>

 pym/_emerge/                            | 12 ++-
 .../resolver/      | 87 ++++++++++++++++++++++
 .../tests/resolver/        |  5 +-
 3 files changed, 98 insertions(+), 6 deletions(-)}
Comment 3 Larry the Git Cow gentoo-dev 2019-09-12 19:43:30 UTC
The bug has been referenced in the following commit(s):

commit 524aa791f28ffcc1df921d8a8a9c111b7e359099
Author:     Zac Medico <>
AuthorDate: 2019-09-12 19:40:44 +0000
Commit:     Zac Medico <>
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
    Signed-off-by: Zac Medico <>

 lib/portage/tests/resolver/ | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)