Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 273651 - Utilities now die on failure (EAPI 4)
Summary: Utilities now die on failure (EAPI 4)
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 273620
  Show dependency tree
 
Reported: 2009-06-10 20:26 UTC by Sebastian Luther (few)
Modified: 2010-08-16 08:52 UTC (History)
3 users (show)

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


Attachments
proposed patch (0001-Make-utilities-die-on-failure-in-EAPI-4-bug-273651.patch,32.55 KB, patch)
2010-05-26 19:10 UTC, Dror Levin (RETIRED)
Details | Diff
updated patch (0001-Make-utilities-die-on-failure-in-EAPI-4-bug-273651.patch,23.86 KB, patch)
2010-05-26 20:28 UTC, Dror Levin (RETIRED)
Details | Diff
updated patch (0001-Make-utilities-die-on-failure-in-EAPI-4-bug-273651.patch,25.25 KB, patch)
2010-05-27 16:50 UTC, Dror Levin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Luther (few) 2009-06-10 20:26:02 UTC
This bug tracks the implementation of the EAPI 3 feature mentioned in the summary.
Comment 1 Jonathan Callen (RETIRED) gentoo-dev 2009-10-17 21:59:01 UTC
Failure behaviour and related commands

Where a command is listed as having EAPI dependent failure behaviour, a failure shall either result in a non-zero exit status or abort the build process, as determined by table 12.3.

The following commands affect this behaviour:

nonfatal
    Executes the remainder of its arguments as a command, preserving the exit status. If this results in a command being called that would normally abort the build process due to a failure (but not due to an explicit die or assert call), instead a non-zero exit status shall be returned. Only in EAPIs listed in table 12.3 as supporting nonfatal.
Comment 2 Dror Levin (RETIRED) gentoo-dev 2010-05-26 19:10:52 UTC
Created attachment 233037 [details, diff]
proposed patch

Note that keepdir and *opts (defined in ebuild.sh) already die on failure.
Comment 3 Dror Levin (RETIRED) gentoo-dev 2010-05-26 20:28:29 UTC
Created attachment 233049 [details, diff]
updated patch

Following few's suggestions to remove code duplication, this time I added a helpers_die() function in isolated-function.sh which dies if the EAPI is 4 and only outputs to stderr otherwise. All utilities now call that function on error, and so the code is not duplicated.

Notes:
1. Forgot to do emake last time.
2. As currently implemented, einstall dies on failure regardless of EAPI (as do keepdir and all *opts functions), contrary to what is said in PMS.
Comment 4 Dror Levin (RETIRED) gentoo-dev 2010-05-27 16:50:50 UTC
Created attachment 233159 [details, diff]
updated patch

Reverse logic of helpers_die to echo on EAPI=0|1|2|3 and die otherwise (instead of dying on EAPI 4 and echo otherwise), and make *into die as well.
Comment 5 Zac Medico gentoo-dev 2010-08-11 05:57:48 UTC
The patch looks good, but one thing I noticed was this construct in ebuild.sh that seems invalid:

  if ! install ... ; then
    ret=$?
    ...
  fi

This test case shows why it's invalid:

$ if ! false ; then echo $? ; fi
0
Comment 6 Zac Medico gentoo-dev 2010-08-12 09:00:14 UTC
This is in git now:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=65c1a6e0dddf0d99af7adbd41484150d5fc6ef9c

(In reply to comment #5)
> The patch looks good, but one thing I noticed was this construct in ebuild.sh
> that seems invalid:

Fixed here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=22ab3600b09fd1e4741454d221b5006a1a50efb1
Comment 7 Zac Medico gentoo-dev 2010-08-16 08:52:22 UTC
The die helper is now improved with a fancy IPC mechanism:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12cbc8821476dcbac38464a41f7cb336da7ac0c9