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 ...
Presumably it should be defined both as a function and (as a fallback) as external command?
From an implementation perspective, this might cause problems...
(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
(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.
(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.
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(+)}
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(-)}