On Tue, 8 Feb 2011 22:29:11 +0100 Ulrich Mueller <u...@gentoo.org> wrote:
> EAPI 4 introduced the REQUIRED_USE variable, which allows to impose > restrictions on the allowed USE flag combinations for an ebuild. > > On the other hand, according to the devmanual, our policy on > conflicting USE flags is as follows: > > | > <http://devmanual.gentoo.org/general-concepts/use-flags/#conflicting-use-flags> > | Occasionally, ebuilds will have conflicting USE flags for > | functionality. Checking for them and returning an error is not a > | viable solution. Instead, you must pick one of the USE flags in > | conflict to favour and should alert the user that a particular flag > | is being used instead. > > Is this policy still valid, which would imply that REQUIRED_USE > should be used only sparingly? Or should it be used in all cases of > conflicting flags? > > As an example for the two extreme cases, the app-editors/emacs-23.2-r3 > ebuild currently has only the following minimal solution: > > REQUIRED_USE="aqua? ( !X )" > > Whereas with taking account of all conflicts, it would look like this: > > REQUIRED_USE=" > alsa? ( sound ) > X? ( > !aqua > m17n-lib? ( xft ) > ^^ ( > gtk > motif > Xaw3d > ( !gtk !motif !Xaw3d ) > ) > toolkit-scroll-bars? ( || ( gtk motif Xaw3d ) ) > ) > !X? ( > !gconf > !gif > !gtk > !imagemagick > !jpeg > !libxml > !m17n-lib > !motif > !png > !svg > !tiff > !toolkit-scroll-bars > !Xaw3d > !xft > !xpm > )" > > If we really implemented it in this way, then I fear that it would be > difficult for users to find out what flag combinations they can use. > (As was pointed out in bug 347353, it is a satisfiability problem, > which in the general case is NP-complete ...) > > Some possible middle ground would block only combinations that lead > to surprising results for the user. (Using the above example again, > one would allow only one of "gtk", "Xaw3d", and "motif". But with > USE="-X", one would simply ignore flags like "png" or "jpeg", because > it can't be surprising that images can't be displayed without X.) > > So, what policy should we follow here? The guideline I usually follow is that flags depending on another flag being set (eg. png needs X) should be ignored (you can always ewarn). For flags that conflict with other flags (exactly one of many, if-this-not-this) use REQUIRED_USE. Does that make sense? If we went with your second extreme, if I wanted to disable X for emacs, I'd also have to add 10 additional flags to package.use on my system to get it to work. If we were doing that for every package I'd switch distros. -- fonts, gcc-porting, it makes no sense how it makes no sense toolchain, wxwidgets but i'll take it free anytime @ gentoo.org EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
signature.asc
Description: PGP signature