While installing Gentoo I use these commands to cleanly rebuild system packages using latest gcc: emerge -b glibc binutils gcc portage && emerge -bke system When second command tried to `emerge -k glibc` I got this error: * ERROR: sys-libs/glibc-2.19-r1::gentoo failed (setup phase): * nonfatal() not supported in this EAPI * * Call stack: * ebuild.sh, line 93: Called pkg_setup * environment, line 2871: Called eblit-run 'pkg_setup' * environment, line 988: Called eblit-glibc-pkg_setup * environment, line 844: Called glibc_run_test '#include <pwd.h> * int main(){return getpwuid(0)==0;} * ' * environment, line 2086: Called glibc_compile_test '' '#include <pwd.h> * int main(){return getpwuid(0)==0;} * ' * environment, line 1999: Called nonfatal 'emake' '-s' 'glibc-test' * isolated-functions.sh, line 92: Called die * The specific snippet of code: * die "$FUNCNAME() not supported in this EAPI"
I've just tried to run: emerge -1b glibc emerge -1k glibc on already installed Gentoo and got same error. # cat '/var/tmp/portage/sys-libs/glibc-2.19-r1/temp/build.log' >>> Extracting info * Package: sys-libs/glibc-2.19-r1 * Repository: gentoo * USE: kernel_linux multilib userland_GNU abi_x86_64 amd64 elibc_glibc hardened * FEATURES: preserve-libs sandbox userpriv usersandbox Portage 2.2.11-r1 (python 3.3.5-final-0, hardened/linux/amd64, gcc-4.7.3, glibc-2.19-r1, 3.15.8-hardened_nouveau x86_64) ================================================================= System uname: Linux-3.15.8-hardened_nouveau-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.2 KiB Mem: 8134012 total, 940572 free KiB Swap: 8388604 total, 8385232 free Timestamp of tree: Fri, 19 Sep 2014 17:45:02 +0000 ld GNU ld (GNU Binutils) 2.23.2 app-shells/bash: 4.2_p45 dev-java/java-config: 2.2.0 dev-lang/python: 2.7.7, 3.3.5-r1 dev-util/cmake: 2.8.12.2-r1 dev-util/pkgconfig: 0.28-r1 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.6, 1.13.4 sys-devel/binutils: 2.23.2 sys-devel/gcc: 4.7.3-r1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2-r1 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.13 (virtual/os-headers) sys-libs/glibc: 2.19-r1 Repositories: gentoo perl-experimental-snapshots gamerlay powerman local ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /opt/upsmon-usb/EXT/DownOS /opt/upsmon-usb/EXT/JSystem /service /usr/inferno/keydb /usr/inferno/lib /usr/inferno/services /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/log /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage-distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y --autounmask-write" FCFLAGS="-march=native -O2 -pipe" FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -O2 -pipe" GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/ http://trumpetti.atm.tut.fi/gentoo/ http://gentoo.inode.at/" LANG="ru_RU.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" PKGDIR="/usr/portage-packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog --delete-excluded" 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="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/perl-experimental-snapshots /var/lib/layman/gamerlay /var/lib/layman/powerman /usr/local/portage" SYNC="rsync://rsync.ua.gentoo.org/gentoo-portage" USE="X a52 aac alac alsa amd64 avx bash-completion berkdb bzip2 caps cdda cddb cli cracklib crypt cxx dbus dri drm dts dvb dvd egl flac fontconfig gallium gdbm gif gnutls gpg hardened iconv icu id3tag idn ipv6 jpeg jpeg2k justify libnotify mac mad matroska mbox mmx mng modules mp3 mpeg multilib musepack mysql ncurses network-cron nls nptl nsplugin ogg opengl openmp openvg pam pax_kernel pcre perl png qt3support readline session spell sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 svg tcpd theora tiff truetype udev unicode urandom vdpau vim-syntax vorbis wavpack x264 xattr xosd xtpax xv xvid xvmc zlib" ABI_X86="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="log_config vhost_alias autoindex alias rewrite dir deflate filter mime negotiation auth_basic authn_file authz_host authz_user authz_groupfile cgi actions headers env setenvif" 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" ELIBC="glibc" 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" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en ru ru_RU" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi fancyindex" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia 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: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
This is caused by the latest change of files/eblits/pkg_setup.eblit : Use `nonfatal` with emake when we check the return value ourselves #522962 by Manuel Lauss. Reverting it fixes the emerge of the binary package.
nonfatal() function gets filtered from the saved environment (see /usr/lib/portage/bin/save-ebuild-env.sh). That's why the following code from the common.eblit doesn't work for binary packages: if [[ ${EAPI:-0} == [0123] ]] ; then nonfatal() { "$@" ; } fi The following wrapper should work here ("glibc_" prefix is choosen just for example): if [[ ${EAPI:-0} == [0123] ]] ; then glibc_nonfatal() { "$@" ; } else glibc_nonfatal() { nonfatal "$@" ; } fi And then all nonfatal() calls in eblits should be replaced with glibc_nonfatal(). Of course, binary packages must be rebuilt after that change.
*** Bug 524514 has been marked as a duplicate of this bug. ***
Created attachment 386120 [details, diff] patch glibc-2.19-r1.ebuild I updated the ebuild in an overlay to use EAPI 4. That failed initially, so I added the extra src_prepare() and src_configure() lines from the -2.20 ebuild, and I was able to successfully build the pkg and install with emerge -k. So the attached patch worked for me.
I can also confirm that this patch has worked for me too. Ran into the same issue when I tried to install a binary package compiled on a different machine. Now after patching the ebuild, recompiling and packaging glibc, I was able to install the glibc package with no problems.
Comment on attachment 386120 [details, diff] patch glibc-2.19-r1.ebuild we aren't backporting the EAPI to the stable version
guess this only impacts installing of binary packages. this is due to the filtering of nonfatal as noted by Alexander Tsoy, and we don't reload the eblit files (since they aren't guaranteed to exist). i've deployed _nonfatal indirection for the pkg_setup phase. once glibc-2.20 goes stable (which uses EAPI=4), i'll see about retroactively porting to EAPI=4 for all the older versions. http://sources.gentoo.org/sys-libs/glibc/files/eblits/common.eblit?r1=1.43&r2=1.44 http://sources.gentoo.org/sys-libs/glibc/files/eblits/pkg_setup.eblit?r1=1.13&r2=1.14
(In reply to SpanKY from comment #8) > guess this only impacts installing of binary packages. this is due to the > filtering of nonfatal as noted by Alexander Tsoy, and we don't reload the > eblit files (since they aren't guaranteed to exist). We can't reload them even if they do exist, since FILESDIR = ebuild_path/files and for binary packages ebuild_path = PORTAGE_BUILDDIR/build-info :) > > http://sources.gentoo.org/sys-libs/glibc/files/eblits/common.eblit?r1=1. > 43&r2=1.44 Binary package still fails to install. Fix: diff -u common.eblit.orig common.eblit --- common.eblit.orig 2014-10-17 21:31:17.000000000 +0400 +++ common.eblit 2014-10-18 12:23:13.789702264 +0400 @@ -10,12 +10,12 @@ : ${ED:=${D}} : ${EROOT:=${ROOT}} fi +# This indirection is for binpkgs. #523332 +_nonfatal() { nonfatal "$@" ; } if [[ ${EAPI:-0} == [0123] ]] ; then nonfatal() { "$@" ; } _nonfatal() { "$@" ; } fi -# This indirection is for binpkgs. #523332 -_nonfatal() { nonfatal "$@" ; } # We need to be able to set alternative headers for # compiling for non-native platform
Commit message: Tweak nonfatal wrapping http://sources.gentoo.org/sys-libs/glibc/files/eblits/common.eblit?r1=1.44&r2=1.45
*** Bug 524038 has been marked as a duplicate of this bug. ***
Mike, bug 524038 is not a dublicate of this one. It's actually a logging issue.
Too bad that if the system installing the binpkg has a different PORTAGE_TMPDIR= this trick does not work at all, because EROOT and ED are not recomputed for EAPI=0 ebuilds.
5 months and it still doesen't work. Not even with PORTAGE_TMPDIR=/var/tmp emerge -1u glibc
(In reply to Fabio Erculiani from comment #13) > Too bad that if the system installing the binpkg has a different > PORTAGE_TMPDIR= this trick does not work at all, because EROOT and ED are > not recomputed for EAPI=0 ebuilds. Confirming this. But shouldn't this go to a separate bug report? vm3020 ~ # PORTAGE_TMPDIR="/home/tmp" emerge -1avk glibc These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] sys-libs/glibc-2.19-r1:2.2 USE="hardened (multilib) -debug -gd -nscd -profile (-selinux) -suid -systemtap -vanilla" 0 KiB Total: 1 package (1 reinstall, 1 binary), Size of downloads: 0 KiB Would you like to merge these packages? [Yes/No] y >>> Emerging binary (1 of 1) sys-libs/glibc-2.19-r1::gentoo * glibc-2.19-r1.tbz2 MD5 SHA1 size ;-) ... [ ok ] >>> Extracting info >>> Extracting sys-libs/glibc-2.19-r1 >>> Installing (1 of 1) sys-libs/glibc-2.19-r1::gentoo * checking 1745 files for package collisions 1000 files checked ... >>> Merging sys-libs/glibc-2.19-r1 to / sed: can't read /var/tmp/portage/sys-libs/glibc-2.19-r1/image//etc/host.conf: No such file or directory * Defaulting /etc/host.conf:multi to on /home/tmp/portage/sys-libs/glibc-2.19-r1/temp/environment: line 2124: pushd: /var/tmp/portage/sys-libs/glibc-2.19-r1/image//lib64: No such file or directory /home/tmp/portage/sys-libs/glibc-2.19-r1/temp/environment: line 2139: ./ld-*.so: No such file or directory * ERROR: sys-libs/glibc-2.19-r1::gentoo failed (preinst phase): * simple run test (/usr/bin/cal) failed * * Call stack: * ebuild.sh, line 93: Called pkg_preinst * environment, line 2889: Called eblit-run 'pkg_preinst' * environment, line 1003: Called eblit-glibc-pkg_preinst * environment, line 838: Called glibc_sanity_check * environment, line 2139: Called die * The specific snippet of code: * ./ld-*.so --library-path . ${x} > /dev/null || die "simple run test (${x}) failed"; * * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.19-r1::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.19-r1::gentoo'`. * The complete build log is located at '/var/log/portage/build/sys-libs/glibc-2.19-r1:20150131-183607.log'. * For convenience, a symlink to the build log is located at '/home/tmp/portage/sys-libs/glibc-2.19-r1/temp/build.log'. * The ebuild environment file is located at '/home/tmp/portage/sys-libs/glibc-2.19-r1/temp/environment'. * Working directory: '/' * S: '/home/tmp/portage/sys-libs/glibc-2.19-r1/work/glibc-2.19' !!! FAILED preinst: 1
(In reply to Fabio Erculiani from comment #13) this bug has nothing to do with EROOT/ED. it is only about nonfatal.