Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705700 - sys-apps/portage-2.3.84-r1 unnecessarily pulls in dev-lang/python-3.7.5-r1
Summary: sys-apps/portage-2.3.84-r1 unnecessarily pulls in dev-lang/python-3.7.5-r1
Status: RESOLVED DUPLICATE of bug 702806
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-17 23:19 UTC by charles17
Modified: 2020-02-01 22:22 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge --info,6.43 KB, text/plain)
2020-01-17 23:19 UTC, charles17
Details

Note You need to log in before you can comment on or make changes to this bug.
Description charles17 2020-01-17 23:19:49 UTC
Created attachment 603638 [details]
emerge --info

sys-apps/portage-2.3.84-r1 unnecessarily pulls in dev-lang/python-3.7.5-r1


emerge -uavt --changed-use --deep --with-bdeps=y --complete-graph @world

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[nomerge       ] mail-client/thunderbird-68.4.1::gentoo  USE="gmp-autoupdate startup-notification system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-sqlite system-webp -bindist -clang -custom-cflags -custom-optimization -dbus -debug -eme-free -hardened -jack -lightning -lto (-pgo) -pulseaudio (-selinux) -test -wayland -wifi" CPU_FLAGS_X86="-avx2" L10N="-ar -ast -be -bg -br -ca -cs -cy -da -de -el -en-GB -es-AR -es-ES -et -eu -fi -fr -fy -ga -gd -gl -he -hr -hsb -hu -hy -id -is -it -ja -ko -lt -nb -nl -nn -pl -pt-BR -pt-PT -rm -ro -ru -si -sk -sl -sq -sr -sv -tr -uk -vi -zh-CN -zh-TW" 
[nomerge       ]  media-libs/mesa-19.2.8::gentoo  USE="X classic dri3 egl gallium gbm gles2 llvm -d3d9 -debug -gles1 (-libglvnd) -lm-sensors -opencl -osmesa -pax_kernel (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan -vulkan-overlay -wayland -xa -xvmc" ABI_X86="(64) -32 (-x32)" VIDEO_CARDS="i965 intel nouveau (-freedreno) -i915 -iris (-lima) (-panfrost) -r100 -r200 -r300 -r600 -radeon -radeonsi (-vc4) -virgl (-vivante) -vmware" 
[ebuild  NS    ]   dev-lang/python-3.7.5-r1:3.7/3.7m::gentoo [2.7.17:2.7::gentoo, 3.6.9:3.6/3.6m::gentoo] USE="gdbm ipv6 ncurses readline sqlite ssl xml -bluetooth -build -examples -hardened -libressl -test -tk -wininst (-threads%*)" 16,843 KiB

Total: 1 package (1 in new slot), Size of downloads: 16,843 KiB

Would you like to merge these packages? [Yes/No]
Comment 1 Zac Medico gentoo-dev 2020-01-17 23:26:54 UTC
As long as the package is not removed by emerge --depclean, the behavior is intentional.
Comment 2 charles17 2020-01-17 23:32:36 UTC
$ emerge -pvc python:3.7

Calculating dependencies... done!
>>> Calculating removal order...

>>> These are the packages that would be unmerged:

 dev-lang/python
    selected: 3.7.5-r1
   protected: none
     omitted: 2.7.17 3.6.9

All selected packages: =dev-lang/python-3.7.5-r1

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Packages installed:   891
Packages in world:    98
Packages in system:   43
Required packages:    890
Number to remove:     1
Comment 3 Zac Medico gentoo-dev 2020-01-17 23:34:42 UTC
Does it also want to remove python:3.7 if you run emerge -p --depclean without the python:3.7 argument?
Comment 4 charles17 2020-01-18 07:18:40 UTC
No.
"emerge -p --depclean" does not pretend to delete anything.
Comment 5 Zac Medico gentoo-dev 2020-01-18 07:20:13 UTC
You can check the output of emerge -pv --depclean (with no package arguments) to see why it doesn't want to remove python:3.7.
Comment 6 charles17 2020-01-18 07:29:52 UTC
emerge -pvc 

...
  dev-lang/python-3.7.5-r1 pulled in by:
    app-misc/ca-certificates-20190110.3.43 requires dev-lang/python:3.7
    dev-libs/glib-2.60.7 requires dev-lang/python:3.7
    dev-libs/icu-65.1 requires dev-lang/python:3.7
    mail-client/thunderbird-68.4.1 requires dev-lang/python:3.7[ncurses,sqlite,ssl,threads(+)]
    media-libs/mesa-19.2.8 requires dev-lang/python:3.7
    net-libs/nodejs-12.14.0 requires dev-lang/python:3.7[threads(+)]
    x11-libs/libxcb-1.13.1 requires dev-lang/python:3.7[xml]
...

So it seems a different version or portage now also changes the python dependencies
Comment 7 Zac Medico gentoo-dev 2020-01-18 07:39:37 UTC
Yes, and hopefully it will solve bug 693790 by preventing the latest version of vala from being removed by emerge --depclean.

All of your packages that dev-lang/python-3.7.5-r1 was pulled in by inherit the python-any-r1 eclass, which simply pulls in the latest version of python for your ACCEPT_KEYWORDS.
Comment 8 Zac Medico gentoo-dev 2020-01-18 07:49:49 UTC
As suggested in bug 702806 comment 8, something like this will give you the versions that you want:

$ cat /etc/portage/package.accept_keywords
dev-lang/python:3.7 -*
Comment 9 charles17 2020-01-18 08:29:06 UTC
(In reply to Zac Medico from comment #7)
> Yes, and hopefully it will solve bug 693790 by preventing the latest version
> of vala from being removed by emerge --depclean.
> 
> All of your packages that dev-lang/python-3.7.5-r1 was pulled in by inherit
> the python-any-r1 eclass, which simply pulls in the latest version of python
> for your ACCEPT_KEYWORDS.

Thanks for clarifying.  That's what I was looking for.
Comment 10 inactive 2020-01-28 14:16:57 UTC
Unsure if I'm in the same boat, for me, depclean wants to remove python 3.7.6 and the next emerge/update wants to bring it back in, then depclean again wants to remove it, seems like that vala bug but it happens all the time with this python 3.7.6


# emerge --verbose --tree --update --deep --with-bdeps=y --changed-use --newuse --ask --complete-graph  @world 

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[nomerge       ] lxqt-base/lxqt-meta-0.14.1-r1::gentoo  USE="about filemanager policykit trash -admin -lightdm -lximage -minimal -nls -powermanagement -processviewer -screenshot -sddm -ssh-askpass -sudo -terminal" 
[nomerge       ]  lxqt-base/lxqt-config-0.14.1-r1::gentoo  USE="monitor touchpad" 
[nomerge       ]   kde-plasma/libkscreen-5.17.5:5/7::gentoo  USE="-debug -doc -test" 
[nomerge       ]    kde-frameworks/kwayland-5.66.0:5/5.66::gentoo  USE="-debug -doc -test" 
[nomerge       ]     dev-qt/qtwayland-5.14.0:5/5.14::gentoo  USE="libinput xcomposite -debug -test" 
[nomerge       ]      dev-qt/qtdeclarative-5.14.0:5/5.14::gentoo  USE="widgets -debug -gles2 -jit -localstorage -test" 
[ebuild  NS    ]       dev-lang/python-3.7.6:3.7/3.7m::gentoo [2.7.17-r1:2.7::gentoo, 3.6.10:3.6/3.6m::gentoo, 3.8.1:3.8::gentoo] USE="gdbm ncurses readline ssl xml -bluetooth -build -examples -hardened -ipv6 -libressl -sqlite -test -tk -wininst" 0 KiB

Total: 1 package (1 in new slot), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) dev-lang/python-3.7.6::gentoo
>>> Installing (1 of 1) dev-lang/python-3.7.6::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 0.72, 0.34, 0.31
>>> Auto-cleaning packages...

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

# emerge --depclean -a
...
Calculating dependencies... done!
>>> Calculating removal order...

>>> These are the packages that would be unmerged:

 dev-lang/python
    selected: 3.7.6 
   protected: none 
     omitted: 2.7.17-r1 3.6.10 3.8.1 

All selected packages: =dev-lang/python-3.7.6

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Would you like to unmerge these packages? [Yes/No] y
>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging (1 of 1) dev-lang/python-3.7.6...
...
# emerge --verbose --tree --update --deep --with-bdeps=y --changed-use --newuse --ask --complete-graph  @world  --pretend

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[nomerge       ] lxqt-base/lxqt-meta-0.14.1-r1::gentoo  USE="about filemanager policykit trash -admin -lightdm -lximage -minimal -nls -powermanagement -processviewer -screenshot -sddm -ssh-askpass -sudo -terminal" 
[nomerge       ]  lxqt-base/lxqt-config-0.14.1-r1::gentoo  USE="monitor touchpad" 
[nomerge       ]   kde-plasma/libkscreen-5.17.5:5/7::gentoo  USE="-debug -doc -test" 
[nomerge       ]    kde-frameworks/kwayland-5.66.0:5/5.66::gentoo  USE="-debug -doc -test" 
[nomerge       ]     dev-qt/qtwayland-5.14.0:5/5.14::gentoo  USE="libinput xcomposite -debug -test" 
[nomerge       ]      dev-qt/qtdeclarative-5.14.0:5/5.14::gentoo  USE="widgets -debug -gles2 -jit -localstorage -test" 
[ebuild  NS    ]       dev-lang/python-3.7.6:3.7/3.7m::gentoo [2.7.17-r1:2.7::gentoo, 3.6.10:3.6/3.6m::gentoo, 3.8.1:3.8::gentoo] USE="gdbm ncurses readline ssl xml -bluetooth -build -examples -hardened -ipv6 -libressl -sqlite -test -tk -wininst" 0 KiB

Total: 1 package (1 in new slot), Size of downloads: 0 KiB
Comment 11 Mike Gilbert gentoo-dev 2020-01-28 14:55:59 UTC
(In reply to Zac Medico from comment #7)
> All of your packages that dev-lang/python-3.7.5-r1 was pulled in by inherit
> the python-any-r1 eclass, which simply pulls in the latest version of python
> for your ACCEPT_KEYWORDS.

The intent of the || dep in python-any-r1 is to depend on any acceptable version of python; it doesn't necessarily need to be the latest available.

Some years back in the python.eclass days, we switched from bare "dev-lang/python" dependencies to || deps on the individual slots, partly to prevent portage from pulling in new python versions unnecessarily.
Comment 12 Zac Medico gentoo-dev 2020-01-28 17:55:38 UTC
(In reply to Mike Gilbert from comment #11)
> (In reply to Zac Medico from comment #7)
> > All of your packages that dev-lang/python-3.7.5-r1 was pulled in by inherit
> > the python-any-r1 eclass, which simply pulls in the latest version of python
> > for your ACCEPT_KEYWORDS.
> 
> The intent of the || dep in python-any-r1 is to depend on any acceptable
> version of python; it doesn't necessarily need to be the latest available.
> 
> Some years back in the python.eclass days, we switched from bare
> "dev-lang/python" dependencies to || deps on the individual slots, partly to
> prevent portage from pulling in new python versions unnecessarily.

As a general rule, we need to select the highest visible version to satisfy any dependency, otherwise we risk missing desirable updates.
Comment 13 Zac Medico gentoo-dev 2020-01-28 17:58:42 UTC
(In reply to gentoo_eshoes from comment #10)
> Unsure if I'm in the same boat, for me, depclean wants to remove python
> 3.7.6 and the next emerge/update wants to bring it back in, then depclean
> again wants to remove it, seems like that vala bug but it happens all the
> time with this python 3.7.6

Please test with latest portage (currently 2.3.86) and open a new bug if the problem persists.
Comment 14 Kobboi 2020-01-28 18:25:17 UTC
It does :) I get continuous loops of the following (update, then depclean). Not sure why this needs to be a new bug :(

[I] sys-apps/portage
     Available versions:  2.3.69 2.3.79 2.3.84-r1 (~)2.3.85-r1 (~)2.3.86{tbz2} **9999*l {build doc epydoc gentoo-dev +ipc +native-extensions +rsync-verify selinux xattr KERNEL="linux" PYTHON_TARGETS="pypy3 python2_7 python3_6 python3_7 python3_8"}
     Installed versions:  2.3.86{tbz2}(16:06:09 28/01/20)(ipc native-extensions rsync-verify xattr -build -doc -epydoc -gentoo-dev -selinux KERNEL="linux" PYTHON_TARGETS="python2_7 python3_6 -pypy3 -python3_7 -python3_8")


>>> Verifying ebuild manifests
>>> Emerging (1 of 2) sys-libs/db-5.3.28-r4::gentoo
>>> Installing (1 of 2) sys-libs/db-5.3.28-r4::gentoo
>>> Emerging (2 of 2) dev-lang/python-3.8.1::gentoo
>>> Installing (2 of 2) dev-lang/python-3.8.1::gentoo
 * Messages for package dev-lang/python-3.8.1:
 * You have just upgraded from an older version of Python.
 * 
 * Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules.


dev-lang/python: 3.8.1 none 2.7.17-r1 3.6.10 3.7.6 
sys-libs/db: 5.3.28-r4 none 4.8.30-r3 6.0.35-r2 

All selected packages: =sys-libs/db-5.3.28-r4 =dev-lang/python-3.8.1
>>> Unmerging (1 of 2) dev-lang/python-3.8.1...
>>> Unmerging (2 of 2) sys-libs/db-5.3.28-r4...
Packages installed:   2741
Packages in world:    511
Packages in system:   43
Required packages:    2741
Number removed:       2
Comment 15 Zac Medico gentoo-dev 2020-01-29 01:18:57 UTC
(In reply to Kobboi from comment #14)
> It does :) I get continuous loops of the following (update, then depclean).
> Not sure why this needs to be a new bug :(

The issue reported in comment #0 did not involve a depclean misbehavior (see comment #4), which makes your issue different.

> [I] sys-apps/portage
>      Available versions:  2.3.69 2.3.79 2.3.84-r1 (~)2.3.85-r1
> (~)2.3.86{tbz2} **9999*l {build doc epydoc gentoo-dev +ipc
> +native-extensions +rsync-verify selinux xattr KERNEL="linux"
> PYTHON_TARGETS="pypy3 python2_7 python3_6 python3_7 python3_8"}
>      Installed versions:  2.3.86{tbz2}(16:06:09 28/01/20)(ipc
> native-extensions rsync-verify xattr -build -doc -epydoc -gentoo-dev
> -selinux KERNEL="linux" PYTHON_TARGETS="python2_7 python3_6 -pypy3
> -python3_7 -python3_8")
> 
> 
> >>> Verifying ebuild manifests
> >>> Emerging (1 of 2) sys-libs/db-5.3.28-r4::gentoo
> >>> Installing (1 of 2) sys-libs/db-5.3.28-r4::gentoo
> >>> Emerging (2 of 2) dev-lang/python-3.8.1::gentoo
> >>> Installing (2 of 2) dev-lang/python-3.8.1::gentoo
>  * Messages for package dev-lang/python-3.8.1:
>  * You have just upgraded from an older version of Python.
>  * 
>  * Please adjust PYTHON_TARGETS (if so desired), and run emerge with the
> --newuse or --changed-use option to rebuild packages installing python
> modules.
> 
> 
> dev-lang/python: 3.8.1 none 2.7.17-r1 3.6.10 3.7.6 
> sys-libs/db: 5.3.28-r4 none 4.8.30-r3 6.0.35-r2 
> 
> All selected packages: =sys-libs/db-5.3.28-r4 =dev-lang/python-3.8.1
> >>> Unmerging (1 of 2) dev-lang/python-3.8.1...
> >>> Unmerging (2 of 2) sys-libs/db-5.3.28-r4...
> Packages installed:   2741
> Packages in world:    511
> Packages in system:   43
> Required packages:    2741
> Number removed:       2

Please create a debug log of that depclean action, like this:

emerge -p --depclean --debug > debug.log 2>&1
Comment 16 inactive 2020-01-29 15:27:56 UTC
(In reply to Zac Medico from comment #13)
Made https://bugs.gentoo.org/707108
Comment 17 inactive 2020-01-29 16:07:31 UTC
It's the PYTHON_COMPAT line(s) in any ebuild, that make emerge pull in python 3.7.6

in libepoxy-1.5.4.ebuild:
PYTHON_COMPAT=( python{2_7,3_6,3_7} )
if I change 3_7 to 3_8, next emerge will want python 3_7 because of libsndfile(no longer because of libepoxy),

in
/var/db/repos/gentoo/media-libs/libsndfile/libsndfile-1.0.29_pre2_p20191024.ebuild
line:
PYTHON_COMPAT=( python{2_7,3_6,3_7} pypy3 )  

if I change 3_7 into 3_8 and remanifest, the emerge will go to another ebuild as the dep requiring python 3_7, such as: sys-devel/llvm-9.0.1
Comment 18 inactive 2020-01-29 16:07:58 UTC
oh crap, posted in the wrong bug :(
Comment 19 Larry the Git Cow gentoo-dev 2020-02-01 21:09:29 UTC
The bug has been referenced in the following commit(s):

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

commit d77d933b4a9cb2b830e661806a2a8689ffbac0ef
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-02-01 04:53:45 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-02-01 20:54:11 +0000

    depclean: do not eliminate upgrades (bug 707108)
    
    For depclean actions, prefer choices where all packages have been
    pulled into the graph, except for choices that eliminate upgrades.
    This solves the test case for bug 707108, where depclean eliminated
    a new slot of python that had been pulled in by a world update.
    This should also prevent non-deterministic elimination of the
    latest vala slot that was reported in bug 693790.
    
    NOTE: There's a common perception (expressed in bug 705700) that
    emerge is pulling in an "unecessary" python slot in cases when that
    python slot is not enabled in PYTHON_TARGETS. However, the so-called
    "unnecessary" slot is practically indistinguishable from a desirable
    upgrade such as the missed llvm slot upgrade that was reported in
    bug 706278. Therefore, be advised that emerge must pull in the
    highest visible slot (regardless of PYTHON_TARGETS) in order to
    ensure that a desirable upgrade is not missed.
    
    Fixes: f7d83d75c6b0 ("dep_zapdeps: adjust || preference for slot upgrades (bug 706278)")
    Bug: https://bugs.gentoo.org/707108
    Bug: https://bugs.gentoo.org/706278
    Bug: https://bugs.gentoo.org/705700
    Bug: https://bugs.gentoo.org/693790
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/dep/dep_check.py                  | 23 +++++++++++++----------
 lib/portage/tests/resolver/test_or_choices.py |  4 ++--
 2 files changed, 15 insertions(+), 12 deletions(-)
Comment 20 Zac Medico gentoo-dev 2020-02-01 22:22:29 UTC

*** This bug has been marked as a duplicate of bug 702806 ***