Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 509024

Summary: death hooks do not run when registered in same func when implicit die runs
Product: Portage Development Reporter: SpanKY <vapier>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: mrueg
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description SpanKY gentoo-dev 2014-04-28 22:10:40 UTC
if you register a die hook in a phase which later triggers an implicit die (e.g. by `emake` failing), then that die hook does not get run properly.  it has to be set at least one phase earlier.

e.g. if you have:
test_hook() { eerror "fooo"; }

and you register it in src_compile:
src_compile() {
  EBUILD_DEATH_HOOKS+=" test_hook"
  emake aslkdjfalksjdf
}

then that hook will not fire.  however, if you move the registration to src_configure, it'll fire fine.  guessing it's because the later die hook phase is run with the env as it existed before src_compile was executed instead of the env at the time of death.