portage icon indicating copy to clipboard operation
portage copied to clipboard

ebuild: do not drop FEATURES=test when USE=-test

Open floppym opened this issue 1 year ago • 2 comments

By convention the "test" USE flag is used to control dependencies required for execution of the src_test function.

The "test" USE flag has no special meaning in PMS.

The Gentoo Policy Guide [1] advises that ebuilds must make use of RESTRICT to disable tests based on USE flags.

Current versions of Portage will not run tests when RESTRICT=test is set, regardless of the FEATURES setting.

This code in Portage predates the Gentoo policy. It is unneeded since the policy was created and ebuilds have been updated with the necessary RESTRICT values.

[1] https://projects.gentoo.org/qa/policy-guide/other-metadata.html#pg0703

floppym avatar Oct 04 '23 14:10 floppym

The interaction between EBUILD_FORCE_TEST and use.mask has implication for the export USE="${USE} test" code here that we should probably also review: https://github.com/gentoo/portage/blob/master/bin/ebuild.sh#L763

zmedico avatar Oct 04 '23 15:10 zmedico

Hmm. I would would say that EBUILD_FORCE_TEST should only cause the test phase to be executed, possibly even overriding RESTRICT.

I don't see any reason to modify USE based on EBUILD_FORCE_TEST, especially since it is only meant for developers.

floppym avatar Oct 04 '23 16:10 floppym