Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 833003 - eclassdoc: @INTERNAL tag for eclasses that should not be inherited in ebuilds
Summary: eclassdoc: @INTERNAL tag for eclasses that should not be inherited in ebuilds
Status: UNCONFIRMED
Alias: None
Product: Quality Assurance
Classification: Unclassified
Component: Disputes/raising issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Quality Assurance Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-09 17:53 UTC by Anna Vyalkova
Modified: 2022-02-14 17:29 UTC (History)
1 user (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 Anna Vyalkova 2022-02-09 17:53:42 UTC
Tools (repoman, pkgcheck) can report as QA warnings direct usage of eclasses
that should never be used directly in ebuilds.

I know only one eclass that is intended to be used only by other eclasses:
"java-utils-2.eclass", but there are probably more of them.
https://wiki.gentoo.org/wiki/Gentoo_Java_Packing_Policy#Java_specific_Eclasses

This feature seems trivial to implement.

@INTERNAL is likely to be mutually exclusive with @PROVIDES.
Comment 1 Ulrich Müller gentoo-dev 2022-02-10 09:56:06 UTC
Couldn't this be checked by the eclass itself, e.g. by testing the INHERITED variable?
Comment 2 Anna Vyalkova 2022-02-10 23:17:50 UTC
(In reply to Ulrich Müller from comment #1)
> Couldn't this be checked by the eclass itself, e.g. by testing the INHERITED
> variable?

Like this?

if has ${ECLASS} ${INHERITED}; then
	eqawarn "${ECLASS} should not be inherited directly"
fi
Comment 3 Ulrich Müller gentoo-dev 2022-02-11 02:11:20 UTC
(In reply to jan Anja from comment #2)
> (In reply to Ulrich Müller from comment #1)
> > Couldn't this be checked by the eclass itself, e.g. by testing the INHERITED
> > variable?
> 
> Like this?
> 
> if has ${ECLASS} ${INHERITED}; then
> 	eqawarn "${ECLASS} should not be inherited directly"
> fi

Similar to that, but instead of ${ECLASS} it would test for the allowed parent eclass. For example, java-utils-2 would test for "has java-pkg-2 ${INHERITED}" etc.

I think this won't work in global scope though, so maybe it's not such a good idea.
Comment 4 Anna Vyalkova 2022-02-14 17:24:52 UTC
(In reply to Ulrich Müller from comment #3)
> Similar to that, but instead of ${ECLASS} it would test for the allowed
> parent eclass. For example, java-utils-2 would test for "has java-pkg-2
> ${INHERITED}" etc.

It's not scalable - what if java-pkg-something-else.eclass in overlay
inherits java-utils-2?

By the way, I found another eclass that can be marked @INTERNAL: ruby-utils
Comment 5 Anna Vyalkova 2022-02-14 17:29:30 UTC
(In reply to Ulrich Müller from comment #1)
> Couldn't this be checked by the eclass itself, e.g. by testing the INHERITED
> variable?

I think eclassdoc solution is better, as no code would run and users wouldn't see
any QA warnings.