Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 790422 - [Future EAPI] USE-dependent USE-flag masking
Summary: [Future EAPI] USE-dependent USE-flag masking
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
Depends on:
Blocks: future-eapi
  Show dependency tree
Reported: 2021-05-15 20:27 UTC by Matt Turner
Modified: 2021-05-20 07:20 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Matt Turner gentoo-dev 2021-05-15 20:27:45 UTC
It would be very nice to be able to specify that some USE flags are only meaningful in the presence of another USE flag.

For example dev-vcs/git has IUSE=perforce which requires Python. Python support is not needed otherwise. By default some PYTHON_SINGLE_TARGET is enabled, and when the default target changes (e.g. in the profile) emerge --newuse will trigger a rebuild of dev-vcs/git even if USE=-perforce and thus Python isn't used.

Just as a simple strawman, I'd propose some new syntax like

IUSE="... perforce? ( python_single_target_python3_{7..9} ) ..."

And emerge --verbose output would perhaps indicate that the flags are dependent:

[ebuild   R    ] dev-vcs/git-2.26.3::gentoo  USE="blksha1 curl gnome-keyring gpg iconv nls pcre pcre-jit perl subversion threads webdav -cgi -cvs -doc -emacs -highlight -mediawiki -mediawiki-experimental -perforce (-ppcsha1) -test -tk -xinetd" perforce? ( PYTHON_SINGLE_TARGET="-python3_7 -python3_8" )

Probably a better way to display that. Suggestions welcome.
Comment 1 Zac Medico gentoo-dev 2021-05-15 20:33:15 UTC
A REQUIRED_USE extension might fit better, since that already specifies relationships between flags.