Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703258 - [Future EAPI] die instead of outputting QA warning when encountering unknown commands during phase processing
Summary: [Future EAPI] die instead of outputting QA warning when encountering unknown ...
Status: CONFIRMED
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:
Keywords:
Depends on:
Blocks: future-eapi
  Show dependency tree
 
Reported: 2019-12-18 05:37 UTC by Tim Harder
Modified: 2021-08-31 10:30 UTC (History)
4 users (show)

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 Tim Harder gentoo-dev 2019-12-18 05:37:17 UTC
Currently it appears portage only outputs QA warnings (via the _check_build_log() function) before a pkg is merged for unknown commands encountered while running ebuild phases. This feels optimistic at best that someone will notice and fix such warnings.

One example would be the current version of guile-2.2.6 in the tree that uses the filter-flags function in src_configure() but doesn't inherit the flag-o-matic eclass anymore where the function is defined. It appears the eclass was properly inherited in 2.2.4, but was possibly removed from 2.2.6 after deeming it unnecessary since no failures occurred and/or the build log wasn't examined after a successful build.

There have been and mostly likely still are many other examples of this throughout the tree. I know because pkgcore calls die when it encounters this situation and I think portage should do the same.

In summary, I think portage should define the command_not_found_handle() hook that calls die with a relevant message for all ebuild phases forcing developers to fix this issue in their ebuilds and eclasses.
Comment 1 Tim Harder gentoo-dev 2019-12-18 05:53:36 UTC
For more inspiration, here is how pkgcore handles things: https://github.com/pkgcore/pkgcore/blob/master/ebd/ebuild.bash#L332
Comment 2 Zac Medico gentoo-dev 2019-12-19 04:11:27 UTC
Let's make it fatal for EAPI 8.
Comment 3 Sam James archtester gentoo-dev Security 2021-02-21 07:14:45 UTC
(In reply to Zac Medico from comment #2)
> Let's make it fatal for EAPI 8.

Is this in EAPI 8?

Note that this is more of a pain for src_test where often there are false positives.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-02-21 08:19:22 UTC
No, it has not been proposed for EAPI 8.  However, I think it is still fine to add it at this point.  Not that anyone has time to push more of EAPI 8 forward.

I presume this is just about commands directly called by ebuild and not by external tools/scripts.
Comment 5 Ulrich Müller gentoo-dev 2021-02-21 13:37:17 UTC
Would this only catch commands called directly from a phase function, or also commands executed from within the package's build system?

For the latter, I've seen several false positives, so I'm sceptical if catching this would be feasible.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2021-02-21 19:05:39 UTC
(In reply to Ulrich Müller from comment #5)
> Would this only catch commands called directly from a phase function

Yes. command_not_found_handle() function here is not exported.

> or also commands executed from within the package's build system?

No. Such behavior would require additional 'export -f command_not_found_handle'.