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

Bug 790422

Summary: [Future EAPI] USE-dependent USE-flag masking
Product: Gentoo Hosted Projects Reporter: Matt Turner <mattst88>
Component: PMS/EAPIAssignee: PMS/EAPI <pms>
Status: CONFIRMED ---    
Severity: normal CC: esigra, gentoo, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

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.