Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 607252

Summary: sys-apps/portage-2.3.3 emerge --fetchonly reports slot conflict inconsistently with dev-ml/camlp4-4.04_p1
Product: Portage Development Reporter: Andreas Prieß <ap>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=161422
https://bugs.gentoo.org/show_bug.cgi?id=922038
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 377365    
Attachments: emerge --info
emerge --update --deep --newuse --fetchonly world
emerge --update --deep --newuse --pretend world

Description Andreas Prieß 2017-01-26 07:58:44 UTC
Created attachment 461470 [details]
emerge --info

Currently
emerge --update --deep --newuse --fetchonly world
behaves different from
emerge --update --deep --newuse --pretend world

emerge with --pretend does not show any conflicts, emerge with --fetchonly shows a different package list to merge with a slot conflict:

>=dev-lang/ocaml-4.04_beta:=[ocamlopt?] required by
    (dev-ml/camlp4-4.04_p1:0/4.04_p1::gentoo, ebuild scheduled for merge)

<dev-lang/ocaml-4.02.3-r1 required by
    (dev-ml/camlp4-4.04_p1:0/4.04_p1::gentoo, ebuild scheduled for merge)

See full emerge output as attachment.
Comment 1 Andreas Prieß 2017-01-26 08:13:54 UTC
Created attachment 461472 [details]
emerge --update --deep --newuse --fetchonly world
Comment 2 Andreas Prieß 2017-01-26 08:17:43 UTC
Created attachment 461474 [details]
emerge --update --deep --newuse --pretend world
Comment 3 Andreas Prieß 2017-01-26 08:25:23 UTC
No conflict shown with
emerge --update --deep --newuse --ask world
so probably the emerge would work. Didn't try yet.
Comment 4 Andreas Prieß 2017-01-26 11:03:43 UTC
And please note that the slot conflict is shown to be provoked by conflicting dependencies of the _same_ package!

dev-ml/camlp4-4.04_p1:0/4.04_p1::gentoo in both cases.
Comment 5 Zac Medico gentoo-dev 2017-01-26 17:24:15 UTC
Conflict backtracking logic is different with --fetchonly, since bug 161422. It's the depgraph _accept_blocker_conflicts method that modifies behavior when some options are enabled.

I think what we should do is make the backtracking logic independent of --fetchonly. We could still allow fetch to proceed despite conflicts, as requested in bug 161422, but it's a questionable case that perhaps is not worth supporting.
Comment 6 Paul Varner (RETIRED) gentoo-dev 2017-02-03 19:37:21 UTC
(In reply to Zac Medico from comment #5)
> Conflict backtracking logic is different with --fetchonly, since bug 161422.
> It's the depgraph _accept_blocker_conflicts method that modifies behavior
> when some options are enabled.
> 
> I think what we should do is make the backtracking logic independent of
> --fetchonly. We could still allow fetch to proceed despite conflicts, as
> requested in bug 161422, but it's a questionable case that perhaps is not
> worth supporting.

Since I filed bug 161422, it was filed mainly because it was a regression from previous versions of portage at the time. That specific use case is more for convenience than anything.

So I'm actually thinking that if emerge --nodeps --fetchonly <multiple conflicting packages> would work that would fit the use case. If you want the dependencies fetched, then you would have to run it with the packages individually.

If that is more trouble than it's worth. I would go ahead and drop support for that bug.
Comment 7 Larry the Git Cow gentoo-dev 2024-01-16 16:03:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=a5078e5774932103d4ad367de4c6bf130a6da34f

commit a5078e5774932103d4ad367de4c6bf130a6da34f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2024-01-15 23:10:03 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2024-01-16 16:01:53 +0000

    emerge: backtrack consistently regardless of --fetchonly
    
    Make the _accept_blocker_conflicts method always return
    True when backtracking is enabled, so that backtracking
    results will be identical regardless of options that
    _accept_blocker_conflicts treats specially. This way,
    conflicts will only be accepted when backtracking is
    disabled or all backtracking tries have been exhausted.
    Make --nodeps imply --backtrack=0, since backtracking
    is only useful with dependencies.
    
    Make _eliminate_rebuilds return early if there are
    slot conflicts, since the merge list is invalid anyway,
    and its possible that state inconsistencies could
    trigger unexpected exceptions as in bug 922038. Make
    the KeyError from bug 922038 a warning, and include
    relevant information to help trace the inconsistency
    back to the _eliminate_rebuilds method or some other
    source like  _solve_non_slot_operator_slot_conflicts.
    
    Bug: https://bugs.gentoo.org/161422
    Bug: https://bugs.gentoo.org/607252
    Bug: https://bugs.gentoo.org/675748
    Bug: https://bugs.gentoo.org/922038
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/depgraph.py | 63 +++++++++++++++++++++++++++++++++++++++++++++----
 man/emerge.1            |  5 ++--
 2 files changed, 61 insertions(+), 7 deletions(-)