Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632000 - [Future EAPI] Restrict REQUIRED_USE (and *DEPEND) to meaningful constructs
Summary: [Future EAPI] Restrict REQUIRED_USE (and *DEPEND) to meaningful constructs
Status: RESOLVED OBSOLETE
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: 2017-09-25 15:05 UTC by Michał Górny
Modified: 2019-03-08 06:15 UTC (History)
2 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-09-25 15:05:09 UTC
This is kinda complementary to GLEP73, except that GLEP73 only stated that specific constructs are not supported for automatic enforcement. However, given the discussions around the topic, we may consider banning more of the 'weird' constructs in REQUIRED_USE.

Possible ban targets:

1. Empty groups -- some of them are confusing (exactly one of zero items is true), most of the time they indicate that something stopped working (i.e. a function produces zero items) and I don't think we have a really valid use case for them.

2. Other groups nested inside ||/^^/?? groups -- unreadable and ambiguous.

3. All-of groups -- which made sense only in ||/^^/?? but see above.


I think most of this stuff was indirectly inherited from || in dependencies without considering how it should apply to REQUIRED_USE in general, and to the additional group types involved in it.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-09-26 04:09:53 UTC
As pointed out by ulm, we should probably also look into || groups in *DEPEND. AFAIU the current confusing behavior of || () being satisfied boils down to the possibility of '|| ( a? ( ... ) b? ( ... ) )' collapsing to empty group with USE='-a -b'.

Given that, I see two possible change routes:

1. We ban empty || and USE flag conditionals inside || entirely. This will be consistent and may improve readability and correctness of some ebuilds that achieve suspicious results using foo? in ||.

2. We ban explicit empty || and make indirect || evaluate to false (effectively banning it as well). If we go this route, we will require a QA check that will detect || containing only USE conditionals, and requiring appropriate REQUIRED_USE.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-10-03 05:19:30 UTC
Following further discussion on the topic, I think we'll actually leave PMS as-is and establish the bans on policy level. However, let's keep this open to see how well can GLEP73 be described without the explicit restrictions.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-10-04 20:28:10 UTC
Looks like I was word enforcing REQUIRED_USE quite reasonably without this, so we probably won't need it after all.
Comment 4 Ulrich Müller gentoo-dev 2019-03-04 07:15:07 UTC
(In reply to Michał Górny from comment #3)
> Looks like I was word enforcing REQUIRED_USE quite reasonably without this,
> so we probably won't need it after all.

Can this bug be closed then?