Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 644260 - sys-apps/portage will not depclean a package that is satisfied by || ( ) dep alternatives
Summary: sys-apps/portage will not depclean a package that is satisfied by || ( ) dep ...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Portage team
Depends on:
Blocks: 155723
  Show dependency tree
Reported: 2018-01-11 21:57 UTC by Toni Ballesta
Modified: 2022-12-26 11:42 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 Toni Ballesta 2018-01-11 21:57:29 UTC
Emerging ninja, it does not require the Python3 nor claim it, but when Python3 is installed later, ninja blocks it automatically:

# emerge -cav python:3.6

Calculating dependencies... done!
  dev-lang/python-3.6.3-r1 pulled in by:
    app-text/iso-codes-3.75 requires dev-lang/python:3.6
    dev-libs/libevdev-1.5.7 requires dev-lang/python:3.6
    *dev-util/ninja-1.8.2 requires dev-lang/python:3.6*
    x11-libs/libxcb-1.12-r2 requires dev-lang/python:3.6[xml]

Comment 1 Mike Gilbert gentoo-dev 2018-01-11 22:05:26 UTC
Sorry, but I don't understand what you are trying to say. Could you redescribe the problem, and provide steps to reproduce it?
Comment 2 Toni Ballesta 2018-01-11 22:20:45 UTC
Yes, if Python 3.x is not installed, ninja no add by dependences:

# emerge --unmerge python:3.6
  (forced unmerge)
# emerge -1 ninja
  (it builds without python3)
# emerge python:3.6

But the surprise is when I trying the depclean of python 3.6, that ninja requires Python 3.6 when before is not build with it:
# emerge -cav python:3.6
  dev-lang/python-3.6.3-r1 pulled in by:
    dev-util/ninja-1.8.2 requires dev-lang/python:3.6
Comment 3 Mike Gilbert gentoo-dev 2018-01-11 22:39:52 UTC
dev-util/ninja has this in DEPEND:

|| (

So it definitely does require/utilize some python at build time, but any version is acceptable.

I imagine portage sees python:3.6 as the "most preferable" version of python, and therefore refuses to remove it when dep-cleaning.

It is debatable whether this is a "bug" in portage.
Comment 4 Zac Medico gentoo-dev 2018-01-11 22:52:36 UTC
Portage is intended to prefer choices toward the left side *if* they've been pulled into the dependency graph.

Since other packages have pulled dev-lang/python:3.6, it's intended for this choice to propagate tot the ninja dependencies.

See bug 642484 for an example of the opposite case, where emerge --depclean wants to remove openrc even though it is listed toward the left, since nothing pulled openrc into the dependency graph. The same would happen for dev-lang/python:3.6 if nothing pulled it in.
Comment 5 Toni Ballesta 2018-01-12 15:13:37 UTC
The only version of python that I have on the system when I build ninja is 2.7. Preferable is not necessary, and if it's not build with 3.x as dependency, it will not block it later... or portage can be take new function that helps to remove packages ignoring if it's only dependency preferable.
Comment 6 Mike Gilbert gentoo-dev 2018-01-12 15:56:09 UTC
app-text/iso-codes needs python3, so I imagine that is really what pulls in dev-lang/python:3.6.
Comment 7 Zac Medico gentoo-dev 2018-02-19 01:28:15 UTC
If you put the version of python that you don't want in /etc/portage/package.mask, then that should be enough to make emerge --depclean choose another version whenever possible.