Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: useflag policies
Date: Wed, 12 Aug 2015 16:59:06
Message-Id: 20150812185853.5b629496@gentoo.org
In Reply to: Re: [gentoo-dev] Re: useflag policies by Ian Stakenvicius
1 On Wed, 12 Aug 2015 12:27:15 -0400
2 Ian Stakenvicius <axs@g.o> wrote:
3
4 > -----BEGIN PGP SIGNED MESSAGE-----
5 > Hash: SHA256
6 >
7 > On 12/08/15 11:55 AM, Alexis Ballier wrote:
8 > > On Wed, 12 Aug 2015 11:30:39 -0400 Ian Stakenvicius
9 > > <axs@g.o> wrote:
10 > >
11 > >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
12 > >>
13 > >> On 12/08/15 11:08 AM, Ulrich Mueller wrote:
14 > >>>>>>>> On Wed, 12 Aug 2015, Alexis Ballier wrote:
15 > >>>
16 > >>>> i.e. something that really tells the PM how to automate
17 > >>>> the choice: - 'qt5 -> !qt4' is rather straightforward to
18 > >>>> solve and tells the PM how (note that it is not equivalent
19 > >>>> to 'qt4 -> !qt5') - '^^ ( qt5 qt4 )' requires the PM to
20 > >>>> make a choice in order to automate it
21 > >>>
22 > >>> I was thinking about some syntax like this:
23 > >>>
24 > >>> REQUIRED_USE="|| ( +foo bar ) ^^ ( +qt5 -qt4 )"
25 > >>>
26 > >>> The package manager would first evaluate each group in
27 > >>> REQUIRED_USE with the original set of USE flags. If that
28 > >>> doesn't evaluate to true, retry with flags changed as
29 > >>> indicated by the + and - signs.
30 > >>>
31 > >>> Ulrich
32 > >>>
33 > >>
34 > >> Having the ability for REQUIRED_USE to provide a default
35 > >> resolution path should definitely help with things; I assume
36 > >> this is meant to do its work via --autounmask-write or similar,
37 > >> ie to help users adjust their config files? Or was the thought
38 > >> to allow PMs to override USE immediately?
39 > >
40 > >
41 > > I think it is better seen as a list of implications, esp. for
42 > > this kind of questions :) With that in mind, there is no
43 > > autounmask-write: effective USE for a given package is input USE
44 > > with these implications applied.
45 >
46 > ..if I'm understanding what you're saying here, you see this as
47 > something the PM will use to adjust the input use list so that the
48 > emerge itself will go ahead with the newly adjusted flags; am I
49 > understanding that correctly?
50 >
51 > In other words, there won't be any user control/alert/override for
52 > what the default actions will be, if the user's profile isn't set up
53 > in a way that satisfies REQUIRED_USE, correct? so if I have
54 > 'app-cat/pkg qt4' in my package.use, but USE="qt5" in my profile,
55 > then because both flags end up being enabled the REQUIRED_USE="^^ (
56 > +qt5 qt4 )" in app-cat/pkg will just force-off my package.use entry
57 > and everything will proceed as if it wasn't there?
58 >
59 >
60 > >
61 > >> Questions:
62 > >>
63 > >> 1 - how does +foo in REQUIRED_USE relate to use-defaults set in
64 > >> IUSE?
65 > >
66 > > This questions remains. I see use-defaults in IUSE as part of
67 > > "input USE" above.
68 >
69 > Yes, just as it is now, the use-defaults in IUSE are part of the
70 > "input use". What I'm wondering is, would the +foo in
71 > REQUIRED_USE="|| ( +foo bar )" be something that should be used in
72 > combination with IUSE="+foo" (perhaps even require it) or would its
73 > functionality and specification be entirely independent of it?
74 > Right now for ||(), setting IUSE="+foo" gets around that issue in
75 > almost all cases, the only case it doesn't is when the user has
76 > explicitly set USE="-foo" (or USE="-*").
77 >
78 >
79 > >
80 > >
81 > > [...]
82 > >> 3 - will having REQUIRED_USE be able to force flags on (and
83 > >> others off) likely result in abuse of profiles and other use
84 > >> defaults? I forsee this being a way, for instance, for a dev
85 > >> to get around users setting USE="-*" in make.conf to ensure a
86 > >> default use flag setting is honoured.
87 > >
88 > > How?
89 >
90 > This assumes that the PM will just set the flags that resolve the
91 > REQUIRED_USE directly (ie modify the "input use" based on the
92 > defaults provided) and go ahead, which seems to be what you're
93 > implying will be the implementation, earlier on. See my response re
94 > #1 above as well, since if I understand this correctly the
95 > REQUIRED_USE="|| ( +foo bar )" will set +foo even if USE="-*" in the
96 > profile right?
97
98
99 Answering all the above questions I think: input use and "effective"
100 use are unrelated. The point here is to give PM a way to solve
101 REQUIRED_USE which we currently lack. How PM does it: by
102 autounmask-write, a warning, an error (as currently), or silently is up
103 to each user's preference. I agree though that forcibly solving the
104 conflicts silently might not be a terrible idea and it'd be much better
105 to have an option to control that behavior.
106
107
108 Alexis.