1 |
On Tue, 8 Feb 2011 22:29:11 +0100 |
2 |
Ulrich Mueller <ulm@g.o> wrote: |
3 |
|
4 |
> EAPI 4 introduced the REQUIRED_USE variable, which allows to impose |
5 |
> restrictions on the allowed USE flag combinations for an ebuild. |
6 |
> |
7 |
> On the other hand, according to the devmanual, our policy on |
8 |
> conflicting USE flags is as follows: |
9 |
> |
10 |
> | <http://devmanual.gentoo.org/general-concepts/use-flags/#conflicting-use-flags> |
11 |
> | Occasionally, ebuilds will have conflicting USE flags for |
12 |
> | functionality. Checking for them and returning an error is not a |
13 |
> | viable solution. Instead, you must pick one of the USE flags in |
14 |
> | conflict to favour and should alert the user that a particular flag |
15 |
> | is being used instead. |
16 |
> |
17 |
> Is this policy still valid, which would imply that REQUIRED_USE |
18 |
> should be used only sparingly? Or should it be used in all cases of |
19 |
> conflicting flags? |
20 |
> |
21 |
> As an example for the two extreme cases, the app-editors/emacs-23.2-r3 |
22 |
> ebuild currently has only the following minimal solution: |
23 |
> |
24 |
> REQUIRED_USE="aqua? ( !X )" |
25 |
> |
26 |
> Whereas with taking account of all conflicts, it would look like this: |
27 |
> |
28 |
> REQUIRED_USE=" |
29 |
> alsa? ( sound ) |
30 |
> X? ( |
31 |
> !aqua |
32 |
> m17n-lib? ( xft ) |
33 |
> ^^ ( |
34 |
> gtk |
35 |
> motif |
36 |
> Xaw3d |
37 |
> ( !gtk !motif !Xaw3d ) |
38 |
> ) |
39 |
> toolkit-scroll-bars? ( || ( gtk motif Xaw3d ) ) |
40 |
> ) |
41 |
> !X? ( |
42 |
> !gconf |
43 |
> !gif |
44 |
> !gtk |
45 |
> !imagemagick |
46 |
> !jpeg |
47 |
> !libxml |
48 |
> !m17n-lib |
49 |
> !motif |
50 |
> !png |
51 |
> !svg |
52 |
> !tiff |
53 |
> !toolkit-scroll-bars |
54 |
> !Xaw3d |
55 |
> !xft |
56 |
> !xpm |
57 |
> )" |
58 |
> |
59 |
> If we really implemented it in this way, then I fear that it would be |
60 |
> difficult for users to find out what flag combinations they can use. |
61 |
> (As was pointed out in bug 347353, it is a satisfiability problem, |
62 |
> which in the general case is NP-complete ...) |
63 |
> |
64 |
> Some possible middle ground would block only combinations that lead |
65 |
> to surprising results for the user. (Using the above example again, |
66 |
> one would allow only one of "gtk", "Xaw3d", and "motif". But with |
67 |
> USE="-X", one would simply ignore flags like "png" or "jpeg", because |
68 |
> it can't be surprising that images can't be displayed without X.) |
69 |
> |
70 |
> So, what policy should we follow here? |
71 |
|
72 |
The guideline I usually follow is that flags depending on another flag being |
73 |
set (eg. png needs X) should be ignored (you can always ewarn). For flags |
74 |
that conflict with other flags (exactly one of many, if-this-not-this) use |
75 |
REQUIRED_USE. Does that make sense? |
76 |
|
77 |
If we went with your second extreme, if I wanted to disable X for emacs, I'd |
78 |
also have to add 10 additional flags to package.use on my system to get it to |
79 |
work. If we were doing that for every package I'd switch distros. |
80 |
|
81 |
|
82 |
-- |
83 |
fonts, gcc-porting, it makes no sense how it makes no sense |
84 |
toolchain, wxwidgets but i'll take it free anytime |
85 |
@ gentoo.org EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 |