Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE)
Date: Fri, 02 Jun 2017 06:37:49
Message-Id: 1496385450.1439.1.camel@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE) by "Michał Górny"
1 On czw, 2017-06-01 at 23:31 +0200, Michał Górny wrote:
2 > On czw, 2017-06-01 at 10:55 +0200, Alexis Ballier wrote:
3 > > On Wed, 31 May 2017 21:02:24 +0200
4 > > Michał Górny <mgorny@g.o> wrote:
5 > >
6 > > > On śro, 2017-05-31 at 19:39 +0200, Alexis Ballier wrote:
7 > > > > > > Again, you *need* to process the constraints in order. '!a?
8 > > > > > > ( b ) !b? ( a )' is not deterministic when none of a and b are
9 > > > > > > enabled otherwise.
10 > > > > >
11 > > > > > You can't rely on any particular order of constraints, especially
12 > > > > > when eclass stacking comes into play. You could try defining some
13 > > > > > constraint- sorting algorithm but it's going to be complex and
14 > > > > > it's usefulness will be limited anyway due to various kinds of
15 > > > > > grouping.
16 > > > >
17 > > > >
18 > > > > Better have some order: If half of the above constraint comes from
19 > > > > ebuild and the other half comes from eclass, then PM might toggle
20 > > > > 'a' or 'b' depending on the phase of the moon which is specifically
21 > > > > what we're trying to avoid.
22 > > >
23 > > > No, it can't. That's the whole point. The algorithm must be defined so
24 > > > that it is always predictable independently of order (maybe except
25 > > > the ordering inside ^^, ||, ??) and independently of how it's nested
26 > > > (i.e. 'a? ( b? ( c ) )' must give the same result as 'b? ( a? ( c )
27 > > > )').
28 > >
29 > > This is a lot of handwaving without real description of how it would
30 > > work. This starts to look a lot like confluence in rewriting systems
31 > > and you want developers to write only confluent rules and repoman to
32 > > decide that. Good luck with that.
33 >
34 > I'm sorry, what I said was quite stupid. I did some thinking and testing
35 > today, and the algorithm can be actually quite trivial. The real issue
36 > is getting a correct input, that is REQUIRED_USE constraints that have
37 > only one solution.
38 >
39 > That is the whole problem I was signaling, and which I seem to have lost
40 > sight of: solving is trivial, ensuring that the constraint can have only
41 > one solution isn't. Hopefully, most of the simple constraints in use
42 > will 'just work'.
43 >
44 > The biggest issue for me right now is to find a way to determine whether
45 > a particular REQUIRED_USE constraint can have only one solution,
46 > independently of the order of non-n-ary constraints. However, some of it
47 > can be easily eyeball-checked using a graph.
48 >
49
50 Well, I've looked at it more and you were right. While keeping them
51 order-independent is a noble goal, it's not really feasible, especially
52 if we assume that n-ary constraints can be reordered. So I think we can
53 assume left-to-right ordering now (with multiple passes, if necessary).
54
55 --
56 Best regards,
57 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies