Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 518768 - Default src_test should additionally pass -i (--ignore-errors) to make -n when detecting supported test targets
Summary: Default src_test should additionally pass -i (--ignore-errors) to make -n whe...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-01 22:40 UTC by Maciej Mrozowski
Modified: 2023-01-31 15:59 UTC (History)
3 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 Maciej Mrozowski gentoo-dev 2014-08-01 22:40:49 UTC
Issue that was discovered with bug 499580.

PMS does not provide reference default_src_test implementation, stating just:
"The default implementation used when the ebuild lacks the src_test function must, if tests are enabled, run emake check if and only if such a target is available, or if not run emake test if and only if such a target is available. In both cases, if emake returns non-zero the build must be aborted."

It doesn't say specifically how to check "if such target is available".
Existing eapi0 implementation in Portage for that likely comes from bug 350404.
It invokes:
make -n <target_to_check>

Bug 499580 discovered that sometimes running make in 'dry run' mode is not enough.
And indeed 'make' manual page says:

"  -n, --just-print, --dry-run, --recon
            Print the commands that would be executed, but do not execute them (except in certain circumstances).
"

Please note the "except in certain circumstances".
As adding -i seems to make -n work really in 'dry run', I propose to fix default src_test in portage accordingly.

@ulm
Is it worth worth adding reference default src_test in PMS?
Comment 1 Ulrich Müller gentoo-dev 2014-08-02 05:39:40 UTC
(In reply to Maciej Mrozowski from comment #0)
> @ulm
> Is it worth worth adding reference default src_test in PMS?

CCing PMS team. Any opinion?
Comment 2 Ulrich Müller gentoo-dev 2022-10-20 07:46:57 UTC
(In reply to Maciej Mrozowski from comment #0)
> PMS does not provide reference default_src_test implementation, stating just:
> "The default implementation used when the ebuild lacks the src_test function
> must, if tests are enabled, run emake check if and only if such a target is
> available, or if not run emake test if and only if such a target is
> available. In both cases, if emake returns non-zero the build must be
> aborted."

That seems pretty clear. Check if the target is available, but otherwise don't care what it does. Passing -i looks like the right thing to do.

> @ulm
> Is it worth worth adding reference default src_test in PMS?

Turning the argument around, if we had reference code there then most likely it would say "make -n" which maybe isn't correct. So having it only as a textual description is just fine.