Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 622894 - [Future EAPI] Many fatal commands are required to be external executables, nonfatal is not
Summary: [Future EAPI] Many fatal commands are required to be external executables, no...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard: in-eapi-7
Keywords:
Depends on:
Blocks: future-eapi
  Show dependency tree
 
Reported: 2017-06-28 06:03 UTC by Michał Górny
Modified: 2018-04-30 22:46 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-06-28 06:03:14 UTC
Some of the helpers, e.g. emake, are required to be provided as external commands to facilitate calling outside ebuild. However, at the same time nonfatal does not come with such a guarantee.

You end up having to do non-intuitive:

  nonfatal some-other-command emake ...

instead of:

  some-other-command nonfatal emake ...
Comment 1 Ulrich Müller gentoo-dev 2017-06-28 08:38:00 UTC
Presumably it should be defined both as a function and (as a fallback) as external command?
Comment 2 Ciaran McCreesh 2017-06-28 10:32:33 UTC
From an implementation perspective, this might cause problems...
Comment 3 Ulrich Müller gentoo-dev 2017-06-28 11:43:21 UTC
(In reply to Ciaran McCreesh from comment #2)
> From an implementation perspective, this might cause problems...

Does it? Not sure what other PMs do, but Portage simply assigns PORTAGE_NONFATAL and then executes the command. That could be done (using exec) in an external command as well.
https://gitweb.gentoo.org/proj/portage.git/tree/bin/isolated-functions.sh?id=1e43cb98a2d03d34cb79b3ebac94fc980ef47d8d#n97
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-09-08 17:53:04 UTC
(In reply to Ciaran McCreesh from comment #2)
> From an implementation perspective, this might cause problems...

Certainly less problems than presuming that the state will be reliably transferred through the arbitrary external command.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-09-08 19:14:22 UTC
(In reply to Ulrich Müller from comment #1)
> Presumably it should be defined both as a function and (as a fallback) as
> external command?

Yes, that sounds good. This should prevent it from accidentally dropping to subcommand.
Comment 6 Larry the Git Cow gentoo-dev 2018-03-11 11:44:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=61667248130fcf279047472875d03fa65520d084

commit 61667248130fcf279047472875d03fa65520d084
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2017-09-21 17:19:12 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-03-11 11:43:41 +0000

    nonfatal: Implement fallback executable for EAPI 7
    
    EAPI 7 specifies that nonfatal has to be implemented both as a bash
    function and a fallback executable, so that it can be used e.g. via
    find/xargs.
    
    Bug: https://bugs.gentoo.org/622894

 bin/ebuild-helpers/nonfatal | 14 ++++++++++++++
 1 file changed, 14 insertions(+)}
Comment 7 Larry the Git Cow gentoo-dev 2018-04-30 22:14:59 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=9598e4b3372645db1eacce0247c32302687b70a4

commit 9598e4b3372645db1eacce0247c32302687b70a4
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2017-09-29 14:24:10 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2018-03-31 15:30:43 +0000

    EAPI 7 provides command fallback for nonfatal.
    
    Bug: https://bugs.gentoo.org/622894

 eapi-differences.tex |  3 ++-
 pkg-mgr-commands.tex | 16 +++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)}