Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE)
Date: Tue, 30 May 2017 09:34:55
Message-Id: 20170530113439.06178b52@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE) by "Michał Górny"
1 On Tue, 30 May 2017 10:29:48 +0200
2 Michał Górny <mgorny@g.o> wrote:
3 > That's why I'm sending this to the mailing list as a RFC, not a
4 > proposal to vote on. It solves a defined set of problems, and gives
5 > other chance to improve it and turn it into a complete solution. It's
6 > not like it's going anywhere before it's implemented as a PoC and
7 > tested.
8
9 Nobody's blaming you for that, rather the contrary :)
10
11 > > > Yes, they do. They improve readability, compared to cascades of
12 > > > plain constraints. I'm pretty sure users will be happier to see
13 > > > 'you need to select one of foo, bar, baz' than 'if foo is
14 > > > disabled, then ...'
15 > >
16 > > If the point is to automatically propose a solution, then who cares
17 > > about readability? Users won't even see that message.
18 >
19 > But users should be able to reasonably figure out what happened,
20 > exactly. There's a difference in quality between the two messages:
21 >
22 > a. 'foo is enabled; bar, got disabled',
23 >
24 > b. 'one of foo, bar, baz had to be enabled => you chose foo'.
25 >
26 > Not saying you can't figure it out. Saying in a more complex case,
27 > grouping constraints like this is helpful.
28
29
30 Why not then. You're right it makes more sense.
31
32
33 > > Note that there are plenty of ways to add determinism in your
34 > > proposal, but it *has* to be specified otherwise PM can't rely on
35 > > it. For instance, you can say that in an unsatisfied || block then
36 > > the left-most useflag is automatically enabled. || then becomes some
37 > > syntactic sugar around unary operators: || ( a ... ) becomes
38 > > equivalent to '!...? ( a )'. You can do the same for other
39 > > operators.
40 > >
41 > >
42 > > Sidenote: I just realized '|| ( a b c )' with left-most preference
43 > > might be better since we are not dealing with binary variables but
44 > > ternary ones (user disabled, user enabled, unspecified). 'USE="" ||
45 > > ( a b c )' should evaluate to 'a', 'USE="-a" || ( a b c )' should
46 > > evaluate to 'b'. I don't see how to rewrite that with pure
47 > > implications.
48 >
49 > The ternary concept is not exactly in line with how we handle USE
50 > flags now. It's more like multi-layer binary. My proposal solved the
51 > problem you were trying to solve via establishing priorities -- I
52 > find it simpler to reorder the flags and use binary logic than to
53 > invent a more complex logic to solve the same problem.
54
55 I've re-read your proposal entirely and I don't see where you describe
56 how to establish priorities. You describe how users can specify those,
57 but nowhere do I see any default priority being mandated. If you
58 describe and mandate it, then all is good I think. As I said, there
59 are plenty of ways to solve the problem but it has to be mandated
60 otherwise you're just postponing issues, not solving them.
61
62
63 Alexis.

Replies