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...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL: https://bugs.funtoo.org/browse/FL-1219
Whiteboard:
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: ---


Attachments

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:


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.
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):

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(-)}
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):

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(-)