public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] Restricting allowed nesting of REQUIRED_USE
Date: Mon, 12 Jun 2017 21:03:55 +0200	[thread overview]
Message-ID: <1497294235.1575.6.camel@gentoo.org> (raw)
In-Reply-To: <20170611181809.1c0b98f1@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 4093 bytes --]

On nie, 2017-06-11 at 18:18 +0200, Alexis Ballier wrote:
> On Sat, 10 Jun 2017 00:30:07 +0200
> Michał Górny <mgorny@gentoo.org> wrote:
> 
> > Hi, everyone.
> > 
> > As you may or may not know, PMS says rather little about REQUIRED_USE
> > [1,2]. The largest past of the definition is shared with other
> > dependency-like specifications [3].
> > 
> > Similarly to regular dependency specifications, PMS is rather lax in
> > nesting things. While this isn't a major problem for dependencies
> > where the syntax is limited to any-of, all-of and USE-conditional
> > groups (though it already may cause some confusion there), it allows
> > quite a bit of a mayhem with the full set of REQUIRED_USE clauses.
> > 
> > We have five different kinds of clauses there: any-of, at-most-one-of,
> > exactly-one-of, all-of and USE-conditional. Furthermore, unlike
> > in dependency specifications, the last type is circular with flags
> > enforced by REQUIRED_USE constraints.
> > 
> > While nesting all of those clauses is technically valid (and can be
> > logically verified), it has no proven usability. As a result, it is
> > either not used at all or has a few use cases which suffer from poor
> > readability and can be easily replaced with *much simpler*
> > constraints. In fact, allowing them is not solving any issues but
> > only introducing more when developers fail at using them.
> > 
> > I would therefore like to discuss restricting nesting of REQUIRED_USE
> > clauses.
> > 
> > 
> > What's my take in this? As you have probably noticed (and stopped
> > reading) I am working with Alexis on solving REQUIRED_USE constraints
> > automatically. We're working towards a few goals: keeping things
> > simple, giving predictable solutions, and being able to automatically
> > validate whether the constraints are solvable.
> > 
> > While we're near solving almost everything, the complex clauses add
> > unnecessary complexity (both to the spec and to the code) which does
> > not really benefit anyone, and bring solutions that can not be
> > predictable because the clauses are ambiguous by design.
> > 
> > To avoid adding this complexity, it would be reasonable to ban at
> > least some of the non-useful combinations. This means either banning
> > them completely (in a future EAPI + possibly repoman) so that
> > developers do not even try to use them, or disabling autosolving when
> > they are being used).
> 
> I'm not sure it is worth restricting too much in the spec, at least now.
> It certainly has benefits, but the extra complexity they add forces to
> thoroughly think about how to design the proper solver, which I don't
> see as a bad thing.
> 
> The main problem is that the solver, in those complex cases, will
> provide results that, at least to me, do not seem natural.
> 
> It'd probably be a very good thing to restrict the allowed nesting
> since they add (runtime) complexity to the solver & checker, like a
> repoman warning and/or error, depending on some threshold.
> 
> On the other hand, the syntax you propose seems way much saner. I like
> it and consider it is a good way to guide developers into writing
> easily predictable constraints. However, I would not disable auto
> solving when this does not match, I would have a generic algorithm, and
> wait for field testing before deciding if people are happy with the
> results or if they prefer to rewrite their constraints in a saner way
> to have a straightforward interpretation of the solver results.
> 

I get your points. However, I don't think 'field testing' is really
going to change much here. With no restrictions imposed since EAPI 4,
there were no more than 10 cases for those 'complex' constraints. Sadly,
most of them were either simply invalid or could be replaced by
something simpler and shorter.

Sure, I don't mind you trying to implement a full parser and play with
it all. However, I don't think it's worth to make the spec a few pages
longer just for the sake of it.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 988 bytes --]

  reply	other threads:[~2017-06-12 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 22:30 [gentoo-dev] [RFC] Restricting allowed nesting of REQUIRED_USE Michał Górny
2017-06-11 16:18 ` Alexis Ballier
2017-06-12 19:03   ` Michał Górny [this message]
2017-06-12 18:51 ` Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497294235.1575.6.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox