Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 702504 - python-r1.eclass python_setup() sets bad {,E}PYTHON variable values
Summary: python-r1.eclass python_setup() sets bad {,E}PYTHON variable values
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-10 21:58 UTC by John Helmert III
Modified: 2019-12-11 14:03 UTC (History)
1 user (show)

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


Attachments
build.log for =sys-apps/pkgcore-0.10.8 (build.log,144.57 KB, text/plain)
2019-12-10 22:01 UTC, John Helmert III
Details
possible fix (python-r1-python_setup-fix.patch,463 bytes, patch)
2019-12-10 22:12 UTC, John Helmert III
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2019-12-10 21:58:16 UTC
I've tested sys-apps/pkgcore and dev-python/pycairo (indirect consumers of python-r1 through distutils-r1), and they give messages like " * python3_8: running distutils-r1_run_phase python_compile_all" and " * python3_8: running distutils-r1_run_phase python_install_all" while there's nothing in the environment that tells them to try to build for python3_8. sys-apps/pkgcore fails to install due to this.

Reproducible: Always

Steps to Reproduce:
1. Use a consumer of python-r1.eclass with a function "python_check_deps()" in the ebuild.
Actual Results:  
Portage tries to run functions for incorrect Python implementations.

Expected Results:  
It shouldn't have done anything related to python3_8.

Portage 2.3.81 (python 3.6.9-final-0, default/linux/amd64/17.1/systemd, gcc-9.2.0, glibc-2.30-r3, 5.4.2-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-5.4.2-gentoo-x86_64-x86_64-AMD_FX-tm-8320_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    12218492 total,   8286616 free
KiB Swap:    6291452 total,   6291452 free
Timestamp of repository gentoo: Tue, 10 Dec 2019 14:00:01 +0000
Head commit of repository gentoo: 2103de74a87c3f07aeeb79c73cf07d630336d511
sh bash 5.0_p11
ld GNU ld (Gentoo 2.33.1 p1) 2.33.1
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 3.7.6 [disabled]
app-shells/bash:          5.0_p11::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17::gentoo, 3.5.9::gentoo, 3.6.9::gentoo, 3.7.5-r1::gentoo, 3.8.0::gentoo
dev-util/ccache:          3.7.6::gentoo
dev-util/cmake:           3.16.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.1-r2::gentoo
sys-devel/binutils:       2.33.1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe -mno-tbm"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/bin/startx /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -mtune=native -O2 -pipe -mno-tbm"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://lug.mtu.edu/gentoo/ https://gentoo.mirrors.easynews.com/linux/gentoo/ https://www.gtlib.gatech.edu/pub/gentoo https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl alsa amd64 berkdb bzip2 cli crypt cxx dbus dri examples fortran gdbm gtk iconv ipv6 libnotify libtirpc multilib ncurses nls notification nptl openmp pam pcre policykit pulseaudio readline seccomp split-usr ssl symlink systemd tcpd udev udisks unicode v4l xattr zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev joystick keyboard libinput mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="*" QEMU_USER_TARGETS="*" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2019-12-10 22:01:04 UTC
Created attachment 599106 [details]
build.log for =sys-apps/pkgcore-0.10.8
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2019-12-10 22:12:37 UTC
Created attachment 599108 [details, diff]
possible fix

The issue is caused by the for() loop here never finding a reason that python3_8 is an incorrect Python implementation here. Checking the Python target use flag would fix the behavior, but that check doesn't happen if python_check_deps() is defined. This patch removes that check.

I don't really know what I'm doing, and this is a minimal fix, so this is likely the wrong thing to do, but it fixes the issue.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-11 14:03:25 UTC
If you have python3.8 installed, and it satisfies the dependency check, there's no reason why the eclass wouldn't use it.  This is entirely by design, and aims to reduce number of unnecessary USE flag updates on dependencies due to incompatible target choices, and to allow using dependencies that do not support python3.8 in specific circumstances.

Using python3.8 is not a bug.  Installing files for python3.8 would be.  If you hit any ebuild failures due to this, please report them as ebuild bugs.