Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 666190 - python-utils-r1.eclass python_export PYTHON_SITEDIR contains double-slash with python2.7
Summary: python-utils-r1.eclass python_export PYTHON_SITEDIR contains double-slash wit...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-13 19:54 UTC by Dominik Schmidt
Modified: 2018-09-22 10:46 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge.info,8.38 KB, text/plain)
2018-09-13 19:54 UTC, Dominik Schmidt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Schmidt 2018-09-13 19:54:51 UTC
Created attachment 546880 [details]
emerge --info

When trying to get the sitedir with `python_get_sitedir`, the python2.7 variant yields "//usr/lib64/python2.7/site-packages" instead of "/usr/lib64/python2.7/site-packages"

The underlying code fragment that is executed is this:


  /usr/bin/python2.7 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())'


(Taken and expanded from https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/python-utils-r1.eclass#n398)

If I execute this in a terminal, it yields the correct result (without double-slash). Yet, if I execute the following


  //usr/bin/python2.7 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())'


It yields the erroneous output with the double-slash.
If I execute the same line with any other python interpreter, I _always_ get the correct result.

As a quick-fix I added a line that strips out any double-slashes after https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/python-utils-r1.eclass#n398


  PYTHON_SITEDIR="${PYTHON_SITEDIR/\/\//</}"


I am running a ~amd64 system, so I have

* sys-apps/portage-2.3.49
* dev-lang/python-2.7.15
Comment 1 Dominik Schmidt 2018-09-13 19:57:58 UTC
Portage 2.3.49 (python 3.6.6-final-0, default/linux/amd64/17.0/hardened, gcc-8.2.0, glibc-2.27-r6, 4.18.5-gentoo x86_64)
=================================================================
System uname: Linux-4.18.5-gentoo-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:     8196476 total,   1292952 free
KiB Swap:   10485756 total,  10485756 free
Head commit of repository ldc: b4d9627cbbcadb19a1926227a1ae455bf0010f71

Head commit of repository qt: d58aed70a809eef627f0ca954e8aa3517a7bba43

Head commit of repository science: e09e5ec884dd0210694529c19b81fab9c48a76bc

Timestamp of repository gentoo: Thu, 13 Sep 2018 16:30:01 +0000
Head commit of repository gentoo: ded87ac360dd80ae69eb86dfb02183c4ceaf4652
sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p1) 2.31.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.4.8-r1::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo, 3.7.0::gentoo
dev-util/cmake:           3.12.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1::gentoo
sys-devel/gcc:            8.2.0-r2::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

ldc
    location: /usr/local/portage/ldc
    sync-type: git
    sync-uri: https://github.com/ldc-developers/gentoo-overlay.git
    masters: gentoo

qt
    location: /usr/local/portage/qt
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/qt.git
    masters: gentoo

science
    location: /usr/local/portage/sci
    sync-type: git
    sync-uri: https://github.com/gentoo/sci.git
    masters: gentoo

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 25
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

local
    location: /usr/local/portage/local
    masters: gentoo
    priority: 100

crossdev
    location: /usr/local/portage/cross
    masters: gentoo
    priority: 110

Installed sets: @freecad
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7-avx -O3   -fuse-linker-plugin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=corei7-avx -O3   -fuse-linker-plugin"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://mirror.netcologne.de/gentoo/ rsync://mirror.netcologne.de/gentoo/ http://mirror.netcologne.de/gentoo/ ftp://ftp.halifax.rwth-aachen.de/gentoo/ rsync://ftp.halifax.rwth-aachen.de/gentoo/ http://ftp.halifax.rwth-aachen.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://mirror.switch.ch/ftp/mirror/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="de de_CH en en_GB en_US"
MAKEOPTS="-j8 -l7"
PKGDIR="/usr/local/pkgs"
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 a52 aac aalib acl acpi alsa amd64 ao apng audiofile autotrace avx bash-completion bazaar berkdb blender bluetooth branding bzip2 cairo cdda cdio cdr cgi chroma cli consolekit context convert crypt cryptsetup css cups curl cvs cxx cycles d dbus dri drm dts dvd dvdr dvi egl emboss encode ettercap evdev examples exif faac faad fam fastcgi ffmpeg fftw flac fontconfig fortran freetype fuse g3dvl gallium gbmaudiofile gcrypt gd gdbm gegl gif gimp git github glamor gles gles2 gnome gnome-keyring gnuplot gnutls gopher gpm gpu graphviz gtk gtk2 gtk3 gudev gui gzip hardened harfbuzz hddtemp hdri highlight ical iconv icu imagemagick imlib inotify introspection ipv6 jack jbig jemalloc jpeg jpeg2k kdrive lame latex lcms ldap ldc2-0_15 libcaca libmpv libnotify libsoxr libtirpc lighttpd lm_sensors loop-aes lua luxrender lv2 lzma lzo mad markdown mathml mercurial metasploit midi mjpeg mms mmx mng mod modplug modules mp3 mp4 mp4peer_perms mpeg mpg123 multilib ncurses netpbm network nls nptl ntfs ntfs-3g ntfsprogs ogg open_perms openal opencv openexr opengl openmp openssl opus otr pam pango pcre pcre16 pdf perl pie pipe png policykit postproc postscript ppds pulseaudio qt3support qt5 quicktime raw readline samba script sdl seccomp server smbclient smbsharemodes smime sna sndfile sound speex spell spice sqlite sse sse2 sse3 sse4 sse4_1 sse4_2 ssh ssl ssp ssse3 startup-notification subversion svg syslog tcpd tftp theora threads tiff timidity tordns truetype tty-helpers twolame ubac udev udisks unconfined unicode upower usb uxa v4l v4l2 vaapi vdpau video vorbis vpx vte wayland webp weston win32codecs wxwidgets x264 x265 xa xattr xcb xcomposite xephyr xkb xml xmpp xscreensaver xtpax xv xvid xwayland zeroconf zip zlib zsh-completion" ABI_X86="32 64" 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 plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev libinput keyboard" KERNEL="linux" L10N="de de_CH en en-GB en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" QEMU_SOFTMMU_TARGETS="i386 arm aarch64 ppc ppc64 x86_64 mips x86" QEMU_USER_TARGETS="arm i386 aarch64 x86_64 ppc ppc64 mips x86" RUBY_TARGETS="ruby25 ruby23" USERLAND="GNU" VIDEO_CARDS="intel nouveau" 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, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Mike Gilbert gentoo-dev 2018-09-20 18:19:36 UTC
That output would seem to indicate that the eclass is calling //usr/bin/python2.7.

The only way I can see that happening is if EPREFIX is set to "/" (it should be empty), or you are overriding the PYTHON variable somewhere.
Comment 3 Dominik Schmidt 2018-09-22 10:46:06 UTC
Ah. EPREFIX was not set anywhere, but it reminded me of a patch I wrote against distutils from a few years back, that allows cross-compilation of python packages to different architectures. With that patch reversed the problem vanishes.

Interestingly, cmake never had hiccups before due to an extra slash, only recently did this start to break the builds...