Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 701132

Summary: [Future EAPI] Accumulate PROPERTIES and RESTRICT across eclasses
Product: Gentoo Hosted Projects Reporter: Ulrich Müller <ulm>
Component: PMS/EAPIAssignee: PMS/EAPI <pms>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, mgorny, pacho
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/portage/pull/638
Whiteboard: in-eapi-8
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

Description Ulrich Müller gentoo-dev 2019-11-25 11:13:33 UTC
PMS says:

| 10.2 Eclass-defined Metadata Keys
|
| The IUSE, REQUIRED_USE, DEPEND, BDEPEND, RDEPEND and PDEPEND variables
| are handled specially when set by an eclass. They must be accumulated
| across eclasses, appending the value set by each eclass to the resulting
| value after the previous one is loaded. Then the eclass-defined value is
| appended to that defined by the ebuild. [...]

In https://blogs.gentoo.org/mgorny/2019/11/06/gentoo-eclass-design-pitfalls/, mgorny complains that PROPERTIES and RESTRICT are not in this list. Consider adding them in EAPI 8.

HOMEPAGE, SRC_URI, LICENSE, and KEYWORDS would be additional candidates, but I believe that setting a default value in an eclass and overriding it in the ebuild is a valid usage case for all of them.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-25 11:26:05 UTC
(In reply to Ulrich Müller from comment #0)
> HOMEPAGE, SRC_URI, LICENSE, and KEYWORDS would be additional candidates, but
> I believe that setting a default value in an eclass and overriding it in the
> ebuild is a valid usage case for all of them.

The same could be argued about every metadata variable, in particular about dependencies.  It's not like we aren't adding switches to a lot of eclasses to suppress or modify defaults.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-16 12:59:25 UTC
For the record, I was only being the devil's advocate here.

Let's go with PROPERTIES and RESTRICT then.
Comment 3 Larry the Git Cow gentoo-dev 2021-06-13 19:18:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=52a242e2f7923f3bee9978ffb14741fa25da9c14

commit 52a242e2f7923f3bee9978ffb14741fa25da9c14
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-05-16 18:46:09 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-06-05 08:55:37 +0000

    EAPI 8 accumulates PROPERTIES and RESTRICT across eclasses
    
    Bug: https://bugs.gentoo.org/701132
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 eapi-differences.tex |  4 ++++
 eclasses.tex         | 27 ++++++++++++++++++++++-----
 2 files changed, 26 insertions(+), 5 deletions(-)