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

Bug 285817

Summary: Update problem with USE dependencies and IUSE defaults
Product: Portage Development Reporter: Ulrich Müller <ulm>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: esigra, openhs
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 284934, 300071    
Attachments: app-misc/foo/foo-1.ebuild
app-misc/baz/baz-1.ebuild

Description Ulrich Müller gentoo-dev 2009-09-21 10:46:25 UTC
USE dependencies and IUSE defaults interact in a strange way, as the following session illustrates.

Copy attached foo-1.ebuild and baz-1.ebuild into an overlay (app-misc category) and install them:

# USE="-quux" emerge -1 app-misc/baz
# emerge app-misc/foo
[These should succeed]


Now let's do an unchanged version bump, copy baz-1.ebuild to baz-2.ebuild.
Try to update foo and its dependencies:

# emerge -uDN app-misc/foo
Calculating dependencies... done!
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

[Huh? No update for baz? But foo depends on baz, and I requested "-D".]
[Let's try an explicit update then:]

# emerge -uDN app-misc/foo app-misc/baz
Calculating dependencies... done!
>>> Recording app-misc/baz in "world" favorites file...
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

[Still no update? Try the same command again, but with "-p" ...]

# emerge -uDNp app-misc/foo app-misc/baz
These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! One or more updates have been skipped due to a dependency conflict:

app-misc/baz:0

  ('ebuild', '/', 'app-misc/baz-2', 'merge') conflicts with
    app-misc/baz[-quux] required by ('installed', '/', 'app-misc/foo-1', 'nomerge')


Why is there a conflict? foo requires baz[-quux] and the installed baz-1 also has USE="-quux". Shouldn't it just update baz with the same flags?
Comment 1 Ulrich Müller gentoo-dev 2009-09-21 10:47:13 UTC
Created attachment 204783 [details]
app-misc/foo/foo-1.ebuild
Comment 2 Ulrich Müller gentoo-dev 2009-09-21 10:47:31 UTC
Created attachment 204785 [details]
app-misc/baz/baz-1.ebuild
Comment 3 Ulrich Müller gentoo-dev 2009-09-21 10:48:44 UTC
Forgot to mention, the above is with portage-2.2_rc40.
Comment 4 Zac Medico gentoo-dev 2009-09-21 14:54:21 UTC
This is very similar to bug 284934, but it involves a different backtracking case.
Comment 5 Sebastian Luther (few) 2010-04-20 18:28:50 UTC
> Shouldn't it just update baz with the same flags?

No, your configuration says otherwise. Assume you don't have any package installed after the version bump, then "emerge baz" would install baz-2 with USE="quux". That's basically why specifying USE on the command line is a bad idea. Running 
USE="-quux" emerge -uDN app-misc/foo
would have done what you are after.

Another thing is the confusion created by the backtracking. I have a patch ready that stops emerge from backtracking if --update is given and the use configuration doesn't match [1].

[1] http://github.com/few/fews-portage-branch/tree/dont_miss_updates_because_of_invalid_use_config