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.