Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 704866 - sys-apps/portage: temp build dir is removed after pkg_postinst failure
Summary: sys-apps/portage: temp build dir is removed after pkg_postinst failure
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Portage team
Depends on:
Reported: 2020-01-06 13:13 UTC by Erik Dannenberg
Modified: 2020-01-06 20:57 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Erik Dannenberg 2020-01-06 13:13:12 UTC
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 $?
# 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)
Comment 1 Erik Dannenberg 2020-01-06 13:19:08 UTC
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:
 *, 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'
Comment 2 Zac Medico gentoo-dev 2020-01-06 20:07:48 UTC
Yeah, postinst failures do not prevent cleanup, but we could make it do so.