Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902213 - sys-apps/portage-3.0.44 breaks emerge with die_hooks failures
Summary: sys-apps/portage-3.0.44 breaks emerge with die_hooks failures
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-03-20 04:19 UTC by Matthew Stapleton
Modified: 2023-03-21 21:11 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Stapleton 2023-03-20 04:19:43 UTC
After updating to sys-apps/portage-3.0.44 on two systems , I am getting multiple errors relating to script commands failing such as:
"/usr/bin/env: bash: No such file or directory"
"/usr/bin/env: ‘bash’: Permission denied"
"The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR does not exist: '/var/tmp/portage/net-misc/iputils-20221126'"


Reproducible: Always

Steps to Reproduce:
1. Upgrade to sys-apps/portage-3.0.44
2. Try installing any package
3. It fails
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-20 04:20:03 UTC
Please share the full build.log and emerge --info.
Comment 2 Matthew Stapleton 2023-03-20 04:24:18 UTC
It's as though the PATH environment has been removed as emerge -avK --nodeps portage to rollback to the previous version results in "bash: line 1: bzip2: command not found"

Here is my emerge --info:

Portage 3.0.44 (python 3.10.9-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-11.2.1, glibc-2.34-r13, 5.15.49-gentoo x86_64)
=================================================================
System uname: Linux-5.15.49-gentoo-x86_64-Intel-R-_Core-TM-_i7-8750H_CPU_@_2.20GHz-with-glibc2.34
KiB Mem:    32678928 total,   5643052 free
KiB Swap:   37748732 total,  37747620 free
Timestamp of repository gentoo: Mon, 20 Feb 2023 13:45:01 +0000
Head commit of repository gentoo: 3646bf14c0cf778fc8fdedc264b76733866e85d5
Head commit of repository dlang: dac285655e25575e240713ed11795e9b60591827

sh bash 5.1_p8
ld GNU ld (Gentoo 2.36.1 p5) 2.36.1
ccache version 3.7.11 [disabled]
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p8::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.26.2::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.1.2-r3::gentoo, 3.2.5-r2::gentoo, 3.3.2-r2::gentoo, 3.4.1::gentoo, 3.5.5::gentoo, 3.6.10-r1::gentoo, 3.7.8-r1::gentoo, 3.8.6-r1::gentoo, 3.9.16::gentoo, 3.10.9-r1::gentoo
dev-lang/rust:             1.62.1::gentoo
dev-util/ccache:           3.7.11::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.1-r1::gentoo
sys-apps/openrc:           0.13.11::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13::gentoo, 2.69::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.8.5-r4::gentoo, 1.9.6-r3::gentoo, 1.10.3::gentoo, 1.11.1::gentoo, 1.12.6::gentoo, 1.13.4-r2::gentoo, 1.14.1-r2::gentoo, 1.15.1-r2::gentoo, 1.16.5::gentoo
sys-devel/binutils:        2.25.1-r1::gentoo, 2.28.1::gentoo, 2.30-r2::gentoo, 2.36.1-r2::gentoo
sys-devel/binutils-config: 5-r2::gentoo
sys-devel/clang:           5.0.2::gentoo, 9.0.1::gentoo, 11.0.1::gentoo
sys-devel/gcc:             4.4.5::gentoo, 4.5.3-r1::gentoo, 4.6.3::gentoo, 4.8.3::gentoo, 4.9.3::gentoo, 5.4.0-r3::gentoo, 7.3.0-r3::gentoo, 8.3.0-r1::gentoo, 9.3.0-r1::gentoo, 11.2.1_p20220115::gentoo
sys-devel/gcc-config:      2.3.1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/llvm:            5.0.2::gentoo, 9.0.1::gentoo, 11.0.1::gentoo
sys-devel/make:            4.2.1-r4::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.34-r13::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.risser.com.au/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

crossdev
    location: /usr/local/portage
    masters: gentoo dlang
    priority: 0
    volatile: True

dlang
    location: /var/lib/layman/dlang
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/dlang.git
    masters: gentoo
    priority: 50
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=haswell -fomit-frame-pointer -ftree-vectorize -fpredictive-commoning -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-2.2/conf /usr/share/maven-bin-3.0/conf /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb"
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.1/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/fpm-php7.4/ext-active/ /etc/php/phpdbg-php7.4/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="-O2 -march=haswell -fomit-frame-pointer -ftree-vectorize -fpredictive-commoning -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirror.aarnet.edu.au/pub/gentoo http://ftp.swin.edu.au/gentoo http://mirror.internode.on.net/pub/gentoo http://gentoo.osuosl.org"
LANG="en_AU.utf8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="en en_GB en_US en_AU zh_CN"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 apache2 arts avahi bluetooth branding bzip2 cairo caps cdda cdr cjk cli crypt cups dbus declarative divx4linux dlloader dri dts dv dvd dvdr elogind encode exif faac fam flac fortran gdbm gif gnome gnutls gpm gstreamer gtk gui guile hal howl htmlhandbook iconv icu ieee1394 ipv6 jikes joystick jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kwallet lcms ldap libglvnd libnotify libtirpc logrotate mad matroska mmx mng mp3 mp4 mpeg multilib nas ncurses net nls nptl odbc ogg openexr opengl openmp pam pango pcre pdf physfs plasma png policykit povray ppds pulseaudio qml qt5 readline samba scanner sdl seccomp semantic-desktop slp sound speex spell split-usr sse sse2 sse3 ssl ssse3 startup-notification svg test-rust tetex theora threads tiff truetype udev udisks unicode upower usb vorbis widgets wmf wxwidgets x264 xattr xcb xcomposite xft xinerama xml xml2 xscreensaver xv xvid zeroconf zlib" ABI_X86="64 32" ADA_TARGET="gnat_2021" ALSA_CARDS="intel8x0 intel8x0m via82xx usb-audio hda-intel" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_fcgi proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias cgid authn_core authz_core unixd socache_shmcb access_compat remoteip" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 avx fma3 sse4_1 sse4_2 aes" 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 pc qemu" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-GB en-US en-AU zh-CN" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="i386 x86_64 aarch64 alpha arm m68k mips mips64 mips64el mipsel ppc ppc64 riscv32 riscv64 s390x sparc sparc64 avr" QEMU_USER_TARGETS="i386 x86_64 aarch64 aarch64 aarch64_be alpha arm armeb m68k mips mips64 mips64el mipsel mipsn32 mipsn32el ppc ppc64 ppc64abi32 ppc64le riscv32 riscv64 s390x sparc sparc32plus sparc64" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="fbdev nv v4l vesa nvidia nouveau intel radeon i915 i965 amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


There is no build log as the build environment can't find any tools.
Comment 3 Matthew Stapleton 2023-03-20 04:47:16 UTC
Oh I should also mention I'm not seeing this bug in 3.0.43-r1, so it was something that was changed between 3.0.43-r1 and 3.0.44.
Comment 4 Matthew Stapleton 2023-03-20 06:21:40 UTC
I have now isolated the problem to the following test in portage/package/ebuild/doebuild.py:

if "PATH" in settings.configdict["env.d"]:
  settings.configdict["env"].pop("PATH", None)

If I comment that out, I don't get "not found" errors".  It does look like I have a few files in /etc/env.d/ that redefine PATH, although renaming /etc/env.d/ doesn't seem to help.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-20 06:25:47 UTC
(In reply to Matthew Stapleton from comment #4)
> I have now isolated the problem to the following test in
> portage/package/ebuild/doebuild.py:
> 
> if "PATH" in settings.configdict["env.d"]:
>   settings.configdict["env"].pop("PATH", None)
> 
> If I comment that out, I don't get "not found" errors".  It does look like I
> have a few files in /etc/env.d/ that redefine PATH, although renaming
> /etc/env.d/ doesn't seem to help.

You'll need to run env-update && . /etc/profile after adjusting /etc/env.d.
Comment 6 Matthew Stapleton 2023-03-20 06:47:13 UTC
Ah yes I just realised that.  After doing that to reset the PATH back to default, emerge is working so something seems to be breaking the PATH merging.  Normally my PATH is set to "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/5/bin:/usr/lib/llvm/11/bin:/usr/lib/llvm/9/bin:/opt/nvidia-cg-toolkit/bin:/opt/vmware/server/console/bin:/opt/cuda/bin" .  On the other computer where I initially had the problem, its path is set to "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin"
Comment 7 Matthew Stapleton 2023-03-20 06:52:32 UTC
It looks like this is because I am still using an old version of baselayout as I see on newer Gentoo installations , baselayout defines PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin" , but older versions of baselayout defined PATH="/opt/bin" .  After updating to the newer PATH definition, portage is working again.

I guess this bug can probably be closed as the older baselayout's aren't in the portage tree anymore.

Sorry for the noise.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-20 07:03:59 UTC
It's definitely valid in that Portage (or @system) should be depending on a newer baselayout.
Comment 9 Mike Gilbert gentoo-dev 2023-03-20 16:04:47 UTC
/usr/bin has been defined in PATH since baselayout-2.4, which was released in 2017. I am very curious how you still have a working Gentoo system with baselayout that is over 5 years old.

Regardless, PATH and ROOTPATH were consolidated in baselayout-2.9. We should probably use that as a milestone for the current Portage behavior.
Comment 10 Matthew Stapleton 2023-03-20 23:26:08 UTC
(In reply to Mike Gilbert from comment #9)
> /usr/bin has been defined in PATH since baselayout-2.4, which was released
> in 2017. I am very curious how you still have a working Gentoo system with
> baselayout that is over 5 years old.
> 
> Regardless, PATH and ROOTPATH were consolidated in baselayout-2.9. We should
> probably use that as a milestone for the current Portage behavior.

Being a source based system and with the help of quickpkg and library preserving, it is easier to keep Gentoo working with a mix of old and new packages compared to a lot of binary based Linux distros, although sometimes it can get a bit hard when updating some of the system packages especially when updating remote systems.
Comment 11 Larry the Git Cow gentoo-dev 2023-03-21 21:11:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52d54aa579c60c614e45757db21fcda2721619ca

commit 52d54aa579c60c614e45757db21fcda2721619ca
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2023-03-20 16:09:26 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-03-21 21:10:29 +0000

    sys-apps/portage: RDEPEND on >=sys-apps/baselayout-2.9
    
    This ensures that baselayout defines PATH and that PATH/ROOTPATH
    do not differ.
    
    Closes: https://bugs.gentoo.org/902213
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/portage/{portage-3.0.44.ebuild => portage-3.0.44-r1.ebuild}     | 1 +
 sys-apps/portage/{portage-3.0.45.2.ebuild => portage-3.0.45.2-r1.ebuild} | 1 +
 sys-apps/portage/{portage-3.0.45.3.ebuild => portage-3.0.45.3-r1.ebuild} | 1 +
 sys-apps/portage/portage-9999.ebuild                                     | 1 +
 4 files changed, 4 insertions(+)