Long story short, if build is interrupted during emerge run which reinstalled Portage, environment has: declare -x PATH="/usr/lib64/distcc/bin:/tmp/portage/._portage_reinstall_.na88mey6/bin/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2:/usr/i686-pc-linux-gnu/gcc-bin/4.9.2" which means it's not going to work via 'ebuild ... install' resume. Would be nice to keep the original Portage directory somewhere later in $PATH too, as a fallback.
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_547086 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/7d89f9421341737c6c231cb789551ad9
This is in the master branch now: https://gitweb.gentoo.org/proj/portage.git/commit/?id=130c01b9e561dd6ff7733a4905b21a0a921e9a22
(In reply to Zac Medico from comment #2) > This is in the master branch now: > > https://gitweb.gentoo.org/proj/portage.git/commit/ > ?id=130c01b9e561dd6ff7733a4905b21a0a921e9a22 This change causes forkbomb during reinstallation of Portage with FEATURES="xattr". /var/tmp/portage/._portage_reinstall_.6d7lm6j5/bin/phase-functions.sh: linia 234: 1263 Killed install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" * ERROR: sys-apps/portage-9999::local failed (unpack phase): * Failed to create dir '/var/tmp/portage/sys-apps/portage-9999/work' * * Call stack: * ebuild.sh, line 757: Called __ebuild_main 'unpack' * phase-functions.sh, line 975: Called __dyn_unpack * phase-functions.sh, line 240: Called die * The specific snippet of code: * install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #3) > (In reply to Zac Medico from comment #2) > > This is in the master branch now: > > > > https://gitweb.gentoo.org/proj/portage.git/commit/ > > ?id=130c01b9e561dd6ff7733a4905b21a0a921e9a22 > > This change causes forkbomb during reinstallation of Portage with > FEATURES="xattr". It will probably do the same thing on FreeBSD due to the sed wrapper. We should revert this patch until we come up with a way to avoid the forkbombs.
One possible solution for the install/sed wrapper forkbombs would be to have the wrappers internally filter paths that begin with $EPREFIX/usr/lib*/portage/ or contain _portage_reinstall_.
There's a patch for the fork bomb in the following branch: https://github.com/zmedico/portage/tree/bug_547086 You can install my branch for testing purposes like this: portage_LIVE_REPO=https://github.com/zmedico/portage.git \ portage_LIVE_BRANCH=bug_547086 \ ACCEPT_KEYWORDS="**" emerge --oneshot =sys-apps/portage-9999
My branch is updated now with fixes to address issues raised in comments on github.
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b891bf13e47694eb1d36a34efb03d21c4b382669
Released in portage-2.2.19