Not sure when this change was introduced but it seems the /var/tmp/portage/<package> dir is now always cleaned up, even on error. ROOT=/foo emerge dev-libs/glib # ctrl-c at any point and tmp dir with all logs is there as expected ROOT=/foo emerge dev-libs/glib echo $? 1 # build fails at glib due to missing gnome2_giomodule_cache_update binary in the real ROOT but all tmp dirs/logs are removed anyways even though the exit signal is clearly not 0 emerge --version Portage 2.3.79 (python 3.6.9-final-0, default/linux/amd64/17.1/no-multilib/hardened, gcc-9.2.0, unavailable, 4.19.72-gentoo x86_64)
The actual build error, maybe it only happens with postinst errors? * FAILED postinst: 1 * ERROR: dev-libs/glib-2.60.7::gentoo failed (postinst phase): * Update GIO modules cache failed (for amd64) * * Call stack: * ebuild.sh, line 125: Called pkg_postinst * environment, line 3188: Called multilib_foreach_abi 'multilib_pkg_postinst' * environment, line 2817: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib_pkg_postinst' * environment, line 2482: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib_pkg_postinst' * environment, line 2480: Called _multilib_multibuild_wrapper 'multilib_pkg_postinst' * environment, line 593: Called multilib_pkg_postinst * environment, line 3185: Called die * The specific snippet of code: * gnome2_giomodule_cache_update || die "Update GIO modules cache failed (for ${ABI})" * * If you need support, post the output of `emerge --info '=dev-libs/glib-2.60.7::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-libs/glib-2.60.7::gentoo'`. * The complete build log is located at '/var/tmp/portage/dev-libs/glib-2.60.7/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-libs/glib-2.60.7/temp/environment'. * Working directory: '/var/tmp/portage/dev-libs/glib-2.60.7/homedir' * S: '/var/tmp/portage/dev-libs/glib-2.60.7/work/glib-2.60.7'
Yeah, postinst failures do not prevent cleanup, but we could make it do so.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=b2c91af6fb2dfdd227caf9a2eff588f02d2bf9fc commit b2c91af6fb2dfdd227caf9a2eff588f02d2bf9fc Author: Oskari Pirhonen <xxc3ncoredxx@gmail.com> AuthorDate: 2023-09-05 01:21:22 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-09-15 04:28:23 +0000 vartree: keep build dir if postinst fails Bug: https://bugs.gentoo.org/704866 Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> lib/portage/dbapi/vartree.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f9211a35abef13079f93a96f57f3a96083c69a7 commit 9f9211a35abef13079f93a96f57f3a96083c69a7 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-10-03 15:38:28 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-10-03 15:38:41 +0000 sys-apps/portage: add 3.0.52 Closes: https://bugs.gentoo.org/704866 Closes: https://bugs.gentoo.org/877793 Closes: https://bugs.gentoo.org/889300 Closes: https://bugs.gentoo.org/900224 Closes: https://bugs.gentoo.org/912676 Closes: https://bugs.gentoo.org/912808 Closes: https://bugs.gentoo.org/913070 Closes: https://bugs.gentoo.org/913103 Closes: https://bugs.gentoo.org/914159 Closes: https://bugs.gentoo.org/915054 Closes: https://bugs.gentoo.org/915119 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.52.ebuild | 235 +++++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+)