1 |
EAPI 4 introduced the REQUIRED_USE variable, which allows to impose |
2 |
restrictions on the allowed USE flag combinations for an ebuild. |
3 |
|
4 |
On the other hand, according to the devmanual, our policy on |
5 |
conflicting USE flags is as follows: |
6 |
|
7 |
| <http://devmanual.gentoo.org/general-concepts/use-flags/#conflicting-use-flags> |
8 |
| Occasionally, ebuilds will have conflicting USE flags for |
9 |
| functionality. Checking for them and returning an error is not a |
10 |
| viable solution. Instead, you must pick one of the USE flags in |
11 |
| conflict to favour and should alert the user that a particular flag |
12 |
| is being used instead. |
13 |
|
14 |
Is this policy still valid, which would imply that REQUIRED_USE |
15 |
should be used only sparingly? Or should it be used in all cases of |
16 |
conflicting flags? |
17 |
|
18 |
As an example for the two extreme cases, the app-editors/emacs-23.2-r3 |
19 |
ebuild currently has only the following minimal solution: |
20 |
|
21 |
REQUIRED_USE="aqua? ( !X )" |
22 |
|
23 |
Whereas with taking account of all conflicts, it would look like this: |
24 |
|
25 |
REQUIRED_USE=" |
26 |
alsa? ( sound ) |
27 |
X? ( |
28 |
!aqua |
29 |
m17n-lib? ( xft ) |
30 |
^^ ( |
31 |
gtk |
32 |
motif |
33 |
Xaw3d |
34 |
( !gtk !motif !Xaw3d ) |
35 |
) |
36 |
toolkit-scroll-bars? ( || ( gtk motif Xaw3d ) ) |
37 |
) |
38 |
!X? ( |
39 |
!gconf |
40 |
!gif |
41 |
!gtk |
42 |
!imagemagick |
43 |
!jpeg |
44 |
!libxml |
45 |
!m17n-lib |
46 |
!motif |
47 |
!png |
48 |
!svg |
49 |
!tiff |
50 |
!toolkit-scroll-bars |
51 |
!Xaw3d |
52 |
!xft |
53 |
!xpm |
54 |
)" |
55 |
|
56 |
If we really implemented it in this way, then I fear that it would be |
57 |
difficult for users to find out what flag combinations they can use. |
58 |
(As was pointed out in bug 347353, it is a satisfiability problem, |
59 |
which in the general case is NP-complete ...) |
60 |
|
61 |
Some possible middle ground would block only combinations that lead |
62 |
to surprising results for the user. (Using the above example again, |
63 |
one would allow only one of "gtk", "Xaw3d", and "motif". But with |
64 |
USE="-X", one would simply ignore flags like "png" or "jpeg", because |
65 |
it can't be surprising that images can't be displayed without X.) |
66 |
|
67 |
So, what policy should we follow here? |
68 |
|
69 |
Ulrich |