Every time I reinstall portage, the shebang line in emerge and portageq is something like: `#!/Users/dom/Gentoo/usr/bin/python -b` which doesn't always work, because `python` is also a shebang script, and shebang nesting is not supported by darwin kernel (and other kernels). Although lots of shells calls the interpreter before the kernel by reading the first line. So why not the following? `#!/Users/dom/Gentoo/usr/bin/env /Users/dom/Gentoo/usr/bin/python -b` I change it manually every time, but I'm worried if portage is broken during an upgrade there may be some unexpected conseqences.
Your suggestion will not work on Linux, because it doesn't split shebang arguments, it will fail with file not found for "/Users/dom/Gentoo/usr/bin/python -b".
(In reply to Qiming Wang from comment #0) > Every time I reinstall portage, the shebang line in emerge and portageq is > something like: > `#!/Users/dom/Gentoo/usr/bin/python -b` > which doesn't always work, because `python` is also a shebang script, and > shebang nesting is not supported by darwin kernel (and other kernels). Why python is a shebang script? On my system, python: symbolic link to python-wrapper python-wrapper: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked Or is it specific to MacOSX?
I have the same, not a wrapper on wrapper. I recall this used to be the case in a previous incarnation of python-exec, is your system uptodate?
I just recently bootstrapped. I installed: $equery l -f 'python' [IP-] [ ] app-admin/python-updater-0.14:0 [IP-] [ ] app-eselect/eselect-python-20151117-r2:0 [IP-] [ ] dev-lang/python-2.7.11:2.7 [IP-] [ ] dev-lang/python-3.4.3-r5:3.4/3.4m [IP-] [ ] dev-lang/python-3.5.1:3.5/3.5m [IP-] [ ] dev-lang/python-exec-2.1:2 ... $equery b ~/Gentoo/usr/bin/python app-eselect/eselect-python-20151117-r2 (/Users/dom/Gentoo/usr/bin/python) $file ~/Gentoo/usr/bin/python /Users/dom/Gentoo/usr/bin/python: a /Users/dom/Gentoo/usr/lib/python-exec/python-exec2-c script, UTF-8 Unicode text executable $equery d eselect-python * These packages depend on eselect-python: dev-lang/python-2.7.11 (>=app-eselect/eselect-python-20151117-r1) dev-lang/python-3.4.3-r5 (>=app-eselect/eselect-python-20151117-r1) dev-lang/python-3.5.1 (>=app-eselect/eselect-python-20151117-r1) May I shouldn't install eselect-python? But it was pulled automatically.
What tree are you on? I see versions that I believe aren't in the Prefix tree.
That's weird. I do `emerge --sync` quite frequently. $ emerge --info Portage 2.2.20-prefix (python 2.7.11-final-0, prefix/darwin/macos/10.11/x64, gcc-4.2.1, unavailable, 15.2.0 x86_64) ================================================================= System uname: Darwin-15.2.0-x86_64-i386-64bit Timestamp of repository gentoo_prefix: Tue, 05 Jan 2016 02:39:21 +0000 sh bash 4.3_p39 app-shells/bash: 4.3_p39::gentoo_prefix dev-lang/perl: 5.22.1::gentoo_prefix dev-lang/python: 2.7.11::gentoo_prefix, 3.4.3-r5::gentoo_prefix, 3.5.1::gentoo_prefix dev-util/cmake: 3.4.1::gentoo_prefix dev-util/pkgconfig: 0.29::gentoo_prefix sys-devel/autoconf: 2.69::gentoo_prefix sys-devel/automake: 1.14.1::gentoo_prefix, 1.15::gentoo_prefix sys-devel/binutils: 2.21.1-r1::gentoo_prefix sys-devel/gcc-config: 1.8-r1::gentoo_prefix sys-devel/libtool: 2.4.6-r1::gentoo_prefix sys-devel/make: 4.1-r1::gentoo_prefix Repositories: gentoo_prefix location: /Users/dom/Gentoo/usr/portage sync-type: rsync sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix priority: -1000 aliases: gentoo gentoo-zh location: /Users/dom/Gentoo/var/lib/layman/gentoo-zh masters: gentoo_prefix priority: 0 ACCEPT_KEYWORDS="~x64-macos" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-apple-darwin15" CC="clang" CFLAGS="-march=nocona -O2 -pipe" CHOST="x86_64-apple-darwin15" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo" CXX="clang++" CXXFLAGS="-march=nocona -O2 -pipe" DISTDIR="/Users/dom/Gentoo/usr/portage/distfiles" FCFLAGS="" FEATURES="assume-digests binpkg-logs case-insensitive-fs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged userfetch userpriv usersandbox usersync" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-dead_strip_dylibs" MAKEOPTS="-j3" PKGDIR="/Users/dom/Gentoo/usr/portage/packages" PORTAGE_CONFIGROOT="/Users/dom/Gentoo/" 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" PORTAGE_TMPDIR="/Users/dom/Gentoo/var/tmp" USE="coreaudio cracklib cxx ipv6 mmx mmxext modules ncurses objc objc++ prefix prefix-guest readline sse sse2 ssl unicode x64-macos zlib" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python3_4 python2_7" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" 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: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
ok, I can confirm this now, it sucks indeed
This is an eselect-python problem as I understand it, for they no longer use the executable wrapper.
this is fun, because python hard depends on this eselect-python version (I don't know if it really needs it) so we'll lose python due to this as well.
Masked the versions in Prefix
Well, it's using the python wrapper since we just happened to have it around. If that's causing problems, I see no problems changing that. I see two simple solutions: 1. either we modify python-exec-c to support being symlinked directly, 2. or we create non-python wrapper that execs python-exec-c (like python python-exec does via shebang now). I don't mind either way. Unless I'm mistaken, option 1. would imply comparing argv[0] to *python-exec, and either using argv[0] or argv[1] as the script name appropriately. The script should be able to handle the change gracefully -- it should be only necessary to remove a single ++argv shift.
I got the impression that the new eselect-python tries to switch versions of python like java-config does, e.g. by setting config values such that invocation doesn't use symlinks but listens to the config instead (and probably can be overridden by envvars). Is that correct? I can help with the c-wrapper in any case.
It always worked like this. The only difference is that I've removed the second python-wrapper, and used the same wrapper as we use for packages.
Is there a reason why the latest Python ebuilds depend on this version of eselect-python? I'd like to unmask those python versions on Prefix by adjusting the version requirement on eselect-python in the ebuilds (prefix tree only).
Yes, I changed the dep for a reason. I just can't recall what it was at this moment.
See bug 567866. Calling /usr/bin/python-config from older versions of eselect-python will fail since we dropped /usr/bin/python-config-2.7 from newer dev-lang/python ebuilds.
Just to be clear, I can fix it in 15-30 minutes, I think. I just want to know which solution you prefer. Both pretty much have the same downsides, except that one makes python-exec-c a little more complex and the other adds yet another wrapper (and exec*() call) to avoid the extra complexity in main wrapper.
(In reply to Michał Górny from comment #17) > Just to be clear, I can fix it in 15-30 minutes, I think. I just want to > know which solution you prefer. Both pretty much have the same downsides, > except that one makes python-exec-c a little more complex and the other adds > yet another wrapper (and exec*() call) to avoid the extra complexity in main > wrapper. I would prefer the python-exec-c way of doing things. exec() is extremely expensive on some platforms hence would add considerable latency. Thanks for looking into this!
Please test the 'python-exec-prefix' branch, it's got update for eselect-python and python-exec. Please also make sure to run python-exec's test suite.
I can't find python-exec-prefix branch on https://bitbucket.org/mgorny/python-exec/. Is there a github/infra repo or somewhere else with the repo?
I mean repo/gentoo.git. It has bumped python-exec and eselect-python ebuilds.
(In reply to Michał Górny from comment #21) > I mean repo/gentoo.git. It has bumped python-exec and eselect-python ebuilds. This seems to work.
Committed p.masked.
this seems to work very well for me
works good, unmasked in prefix, so resolving.
Thanks. If you could also confirm there's nothing wrong with 2.4.1, I'd love to unmask that one for the whole Gentoo. It pretty much exhausted my TODO.
reopening for test request
testing was good