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

Bug 860363

Summary: [Future EAPI] pkg_failed phase (formalization of death hooks)
Product: Gentoo Hosted Projects Reporter: Andreas K. Hüttel <dilfridge>
Component: PMS/EAPIAssignee: PMS/EAPI <pms>
Status: CONFIRMED ---    
Severity: normal CC: esigra, mgorny, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=465192
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

Description Andreas K. Hüttel archtester gentoo-dev 2022-07-23 21:46:06 UTC
It would be nice to be able to declare a phase function which is run if and only if something fails.

I.e. src_compile fails -> pkg_failed is run before everything aborts.

Purpose would be to
* output messages that point to specific bugs and their solutions
* output messages that point to additional interesting logfiles
* or more
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-07-24 06:09:30 UTC
At a first glance, this seems to make sense.  I mean, certainly more sense than the API provided for death hooks right now.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-24 06:17:33 UTC
Agreed. Plus we already have e.g. pkg_info which feels similar in spirit.

My only hesitation here is: ... surely this has been proposed before? If so, why didn't we do it then?
Comment 3 Ulrich Müller gentoo-dev 2022-07-24 08:05:17 UTC
Precedent seems to suggest pkg_die as the name. There are chromium_pkg_die and java-pkg_die in eclasses, and die_hooks in Portage.


(In reply to Sam James from comment #2)
> Agreed. Plus we already have e.g. pkg_info which feels similar in spirit.

pkg_info is used by exactly one package in the tree (app-emulation/qemu). My main worry is that the new phase function would also have little use.

> My only hesitation here is: ... surely this has been proposed before? If so,
> why didn't we do it then?

I don't remember. Maybe there's little demand for something like this?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-07-24 08:16:28 UTC
I'm not sure whether a good proposal was ever made.  It might just have skipped between "death hooks are too ugly to put in PMS" and "death hooks just work, and this is a corner case anyway".