public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] pkg_pretend USE validation and VALID_USE alternative
@ 2010-03-31  9:20 Brian Harring
  2010-03-31  9:48 ` [gentoo-dev] Re: [gentoo-council] " Ulrich Mueller
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Brian Harring @ 2010-03-31  9:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: gentoo-council, pms-bugs

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

Hola all-

For those who aren't familiar, pkg_pretend is in EAPI4- the main usage 
of it is will be use dep checking- this email is specifically 
regarding an alternative to it that *should* be superior for that use 
case, but I'm looking for feedback.

Basically, we use the original VALID_USE proposal from way back in 
'05- if you're familiar w/ MYOPTIONS, they're reasonably similar.

Roughly, VALID_USE is a list of constraints stating what the allowed 
use flag combinations are for this pkg.  If you think of normal 
depdencies (I must have openssl and python merged prior), it's the 
same machinery.

Examples:

# if build is set, python and openssl must be unset
VALID_USE="build? ( !python !openssl )"

# if mysql is set, sqlite must not be, and vice versa.
# note mysql/sqlite do *not* have to be set also.
VALID_USE="mysql? ( !sqlite ) !sqlite? ( mysql )"

# mysql or sqlite must be set; exclusive or.
VALID_USE="mysql? ( !sqlite ) !mysql ( sqlite )"

# alternative syntax, adding an xor group operator
# note xor isn't required- you can do the same thing
# via spelling it out, it's just a convenient thing to have.
VALID_USE="^^ ( mysql sqlite )"

# if gui is enabled, a widget set must be specified- can build
# multiple widget bindings
VALID_USE="X? ( || ( gtk qt motif ) )"


Note that like dependencies, these are assertions.  More importantly, 
they're also data rather then executable code.  Via it being data, up 
front GUI's can tell you exactly what conflicts arise, and what needs 
to be adjusted.

Doing it as executable, can, but it's iterative and reliant on the dev 
writing a clear message every time (rather then the UI tool getting 
it right once).  Clarifying iterative, consider

USE="build X"
w/ valid use states being-
VALID_USE="build? ( !X !python ) X? ( ^^ ( gtk qt ) ) gtk? ( ssl )"

The user first flips off build.  They rerun emerge- next they're told 
"you must choose gtk or qt, not both".  They change to USE="X gtk".  
Next they're told "you need ssl turned on if you want gtk".

At this point, the user goes and gets a beer because aparently Murphy 
hates them and it's going to be a long, long night.


There also is one major issue with relying on pkg_pretend 
(executable) for use state validation vs doing it as VALID_USE 
(data)- the package manager cannot know what states are valid thus 
limiting the things it can do.  Literally the pkg manager is screwed 
when it comes to use cycle breaking.  If the pkg manager doesn't know 
what states are valid, when it encounters a use cycle it doesn't know 
what intermediate builds it can do to break that cycle- literally if 
USE state validation is in pkg_pretend, the *user* will have to walk 
the PM through breaking the cycle instead of the PM figuring out the 
proper steps to break it.

Executive summary: if use validation is implemented via pkg_pretend,
1) it still has the iterative issue
2) it's harder for configuration tools to deal with (iterative issues 
above, plus the fact they get a blob of text they're stuck trying to 
parse)
3) it pretty much eliminates the possibility of doing use cycle 
breaking properly (which is already an issue, only going to get worse- 
hence why this was proposed in '04/'05 when we started playing w/ use 
deps in portage 3 at the time).


Comments desired; assuming no significant blowback, I'll be pushing 
this to the council level since eapi4 is annoying feature locked right 
now.

Thanks-
~harring

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2010-04-02 22:37 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31  9:20 [gentoo-dev] pkg_pretend USE validation and VALID_USE alternative Brian Harring
2010-03-31  9:48 ` [gentoo-dev] Re: [gentoo-council] " Ulrich Mueller
2010-03-31 10:46   ` Brian Harring
2010-03-31 11:04     ` [gentoo-dev] " Ulrich Mueller
2010-03-31 11:11       ` Brian Harring
2010-03-31 15:38       ` "Paweł Hajdan, Jr."
2010-03-31 11:18     ` [gentoo-dev] Re: [gentoo-council] " Piotr Jaroszyński
2010-04-01 20:44     ` Róbert Čerňanský
2010-04-01 21:51       ` Zac Medico
     [not found] ` <201003312316.23806.ali_bush@gentoo.org>
2010-03-31 10:57   ` Brian Harring
2010-03-31 17:49 ` [gentoo-dev] " Alex Alexander
2010-03-31 19:46   ` Brian Harring
2010-03-31 19:56     ` Ciaran McCreesh
2010-04-01  7:31       ` Brian Harring
2010-04-01  7:41         ` Ciaran McCreesh
2010-04-01  7:56           ` Brian Harring
2010-04-01 10:10             ` Gilles Dartiguelongue
2010-04-01 10:18               ` Brian Harring
2010-04-01 10:42                 ` Gilles Dartiguelongue
2010-04-01 10:59                   ` Brian Harring
2010-04-01 11:23                     ` Ciaran McCreesh
2010-04-01 11:38                       ` Brian Harring
2010-04-01 11:50                         ` Ciaran McCreesh
2010-04-01 10:49             ` Ciaran McCreesh
2010-04-01 11:18               ` Brian Harring
2010-04-01 11:44                 ` Ciaran McCreesh
2010-04-01 17:04                 ` David Leverton
2010-04-01 18:39                   ` Dror Levin
2010-04-01 18:55                     ` Ciaran McCreesh
2010-04-02 22:36                     ` David Leverton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox