* [gentoo-pms] Runtime-switchable USE flags
@ 2014-06-25 10:15 Ulrich Mueller
2014-06-25 12:15 ` Michał Górny
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Ulrich Mueller @ 2014-06-25 10:15 UTC (permalink / raw
To: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
Hi,
The council has approved runtime-switchable USE flags [1,2] for
EAPI 6. Several questions arise:
- If we introduce the feature with an EAPI, we need not care about
backwards compatibility. It would be possible to mark runtime
switchable flags by some syntax in IUSE, instead of introducing
a new variable like IUSE_RUNTIME.
So far, "%-foo", "@-foo", "*foo", and "foo*" have been suggested as
syntax. I don't like the first two because they don't look so nice
when combined with "+" or "-" IUSE defaults; mgorny doesn't like the
last two because they look like wildcards. Some bikeshedding for the
syntax is needed.
- Do we really need all these restrictions for ebuilds listed in [3]?
Especially, restricting possible USE dependencies will complicate
the spec, and I don't see the benefit of such a restriction.
- Why would we restrict referencing the flags in phase functions?
For example, I would consider something like the following in
pkg_postinst() a valid use case:
use foo || elog "For foo support, install package app-misc/foo"
Instead, I suggest that we simply say "runtime switchable flags must
not have any effect on the files installed by the ebuild".
Ulrich
[1] https://wiki.gentoo.org/wiki/GLEP:62
[2] https://forums.gentoo.org/viewtopic-p-4194219.html#4194219
[3] https://wiki.gentoo.org/wiki/GLEP:62#Specification
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-25 10:15 [gentoo-pms] Runtime-switchable USE flags Ulrich Mueller
@ 2014-06-25 12:15 ` Michał Górny
2014-06-25 13:06 ` Ulrich Mueller
2014-06-25 17:02 ` Ciaran McCreesh
2014-06-26 19:43 ` David Leverton
2 siblings, 1 reply; 11+ messages in thread
From: Michał Górny @ 2014-06-25 12:15 UTC (permalink / raw
To: Ulrich Mueller; +Cc: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 2518 bytes --]
Dnia 2014-06-25, o godz. 12:15:04
Ulrich Mueller <ulm@gentoo.org> napisał(a):
> Hi,
> The council has approved runtime-switchable USE flags [1,2] for
> EAPI 6. Several questions arise:
>
> - If we introduce the feature with an EAPI, we need not care about
> backwards compatibility. It would be possible to mark runtime
> switchable flags by some syntax in IUSE, instead of introducing
> a new variable like IUSE_RUNTIME.
>
> So far, "%-foo", "@-foo", "*foo", and "foo*" have been suggested as
> syntax. I don't like the first two because they don't look so nice
> when combined with "+" or "-" IUSE defaults; mgorny doesn't like the
> last two because they look like wildcards. Some bikeshedding for the
> syntax is needed.
"-foo@" or "-foo%" are also possible but that's a poor man's workaround
for current syntax ugliness. The real alternative is:
<use>
<flag name="foo" default="off" runtime="yes"/>
</use>
:P
> - Do we really need all these restrictions for ebuilds listed in [3]?
> Especially, restricting possible USE dependencies will complicate
> the spec, and I don't see the benefit of such a restriction.
The specific rules in GLEP were intended to allow catching mistakes
easily. It's easy to make repoman complain when it sees runtime flag
in SRC_URI or portage to complain when 'use' is queried using a runtime
flag.
> - Why would we restrict referencing the flags in phase functions?
> For example, I would consider something like the following in
> pkg_postinst() a valid use case:
>
> use foo || elog "For foo support, install package app-misc/foo"
I'm not really convinced by this. Once we add the runtime USE flag to
pull foo, I'd rather say we ought not to tell people to install packages
manually. But telling them that a particular flag controls something
should be fine... though it should be noted that we won't be able to
output another message afterwards.
> Instead, I suggest that we simply say "runtime switchable flags must
> not have any effect on the files installed by the ebuild".
Of course, your arguments are valid, so we can pretty much use
the simpler version in the PMS. Even then, most points listed verbosely
in GLEP would be implied, so we could do the checks.
> [1] https://wiki.gentoo.org/wiki/GLEP:62
> [2] https://forums.gentoo.org/viewtopic-p-4194219.html#4194219
> [3] https://wiki.gentoo.org/wiki/GLEP:62#Specification
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 949 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-25 12:15 ` Michał Górny
@ 2014-06-25 13:06 ` Ulrich Mueller
0 siblings, 0 replies; 11+ messages in thread
From: Ulrich Mueller @ 2014-06-25 13:06 UTC (permalink / raw
To: Michał Górny; +Cc: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
>>>>> On Wed, 25 Jun 2014, Michał Górny wrote:
> "-foo@" or "-foo%" are also possible but that's a poor man's
> workaround for current syntax ugliness.
We cannot use @ because it's a legal character in flag names.
> The real alternative is:
> <use>
> <flag name="foo" default="off" runtime="yes"/>
> </use>
> :P
Wrong mailing list, and more than 10 years late: :)
http://thread.gmane.org/gmane.linux.zynot.general/4
> Of course, your arguments are valid, so we can pretty much use the
> simpler version in the PMS. Even then, most points listed verbosely
> in GLEP would be implied, so we could do the checks.
My feeling is that our present rules for IUSE_EFFECTIVE and
IUSE_REFERENCEABLE are already complicated enough. The package
manager should treat runtime switchable flags as normal USE flags,
except when deciding if a package should be rebuilt.
What we add on top of this as tree policy (repoman etc.) is another
issue.
Ulrich
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-25 10:15 [gentoo-pms] Runtime-switchable USE flags Ulrich Mueller
2014-06-25 12:15 ` Michał Górny
@ 2014-06-25 17:02 ` Ciaran McCreesh
2014-06-26 8:04 ` Ulrich Mueller
2014-06-26 19:43 ` David Leverton
2 siblings, 1 reply; 11+ messages in thread
From: Ciaran McCreesh @ 2014-06-25 17:02 UTC (permalink / raw
To: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
On Wed, 25 Jun 2014 12:15:04 +0200
Ulrich Mueller <ulm@gentoo.org> wrote:
> The council has approved runtime-switchable USE flags [1,2] for
> EAPI 6. Several questions arise:
Where is the reference implementation?
--
Ciaran McCreesh
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-25 17:02 ` Ciaran McCreesh
@ 2014-06-26 8:04 ` Ulrich Mueller
0 siblings, 0 replies; 11+ messages in thread
From: Ulrich Mueller @ 2014-06-26 8:04 UTC (permalink / raw
To: Ciaran McCreesh; +Cc: gentoo-pms, Michał Górny
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
>>>>> On Wed, 25 Jun 2014, Ciaran McCreesh wrote:
> Where is the reference implementation?
Besides the description that is in GLEP 62, I'm not aware of any.
(Michał, please correct me if this is wrong.)
Ulrich
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-25 10:15 [gentoo-pms] Runtime-switchable USE flags Ulrich Mueller
2014-06-25 12:15 ` Michał Górny
2014-06-25 17:02 ` Ciaran McCreesh
@ 2014-06-26 19:43 ` David Leverton
2014-06-27 6:35 ` Ulrich Mueller
2 siblings, 1 reply; 11+ messages in thread
From: David Leverton @ 2014-06-26 19:43 UTC (permalink / raw
To: gentoo-pms
Ulrich Mueller wrote:
> - Do we really need all these restrictions for ebuilds listed in [3]?
> Especially, restricting possible USE dependencies will complicate
> the spec, and I don't see the benefit of such a restriction.
If, for example, we make subversion an IUSE_RUNTIME flag of git, and
some other package depends on dev-vcs/git[-subversion], and the user has
the subversion flag disabled for git but happens to have subversion
installed anyway, should the dependency be considered satisfied (in
which case it's fairly pointless)? Or does it magically get treated
like a blocker on dev-vcs/subversion?
(I realise that git-svn has more deps than just subversion itself, but
it's just an example. :-P)
Similar logic would suggest that "!flag ( ... )" in the package's own
dependencies should also be disallowed.
See also http://marc.info/?l=gentoo-dev&m=134030581716793&w=2 and replies.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-26 19:43 ` David Leverton
@ 2014-06-27 6:35 ` Ulrich Mueller
2014-06-27 7:39 ` David Leverton
0 siblings, 1 reply; 11+ messages in thread
From: Ulrich Mueller @ 2014-06-27 6:35 UTC (permalink / raw
To: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]
>>>>> On Thu, 26 Jun 2014, David Leverton wrote:
> If, for example, we make subversion an IUSE_RUNTIME flag of git, and
> some other package depends on dev-vcs/git[-subversion], and the user
> has the subversion flag disabled for git but happens to have
> subversion installed anyway, should the dependency be considered
> satisfied (in which case it's fairly pointless)? Or does it
> magically get treated like a blocker on dev-vcs/subversion?
It should be treated like a regular USE flag for dependency
resolution. So in your example, the dependency would be satisfied.
More interesting example: Some other package could depend on
dev-vcs/git[-perl]. "perl" is a regular USE flag in git, but is has
"subversion? ( perl )" in REQUIRED_USE. Therefore dev-vcs/git[-perl]
is effectively equivalent to dev-vcs/git[-perl,-subversion]. However,
the restrictions in current GLEP 62 don't cover this case.
> (I realise that git-svn has more deps than just subversion itself,
> but it's just an example. :-P)
> Similar logic would suggest that "!flag ( ... )" in the package's
> own dependencies should also be disallowed.
Your arguments are valid, but they apply to regular USE flags, too.
So I fail to see why we would need special treatment for runtime
switchable flags here.
If necessary, we can always impose additional restrictions by tree
policy (as we do for "noblah" flags, for example), but I'd rather not
restrict what the package manager can do. Especially, if we can simply
go with normal USE flag logic in one case, but need special casing for
runtime flags in the other case.
Ulrich
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-27 6:35 ` Ulrich Mueller
@ 2014-06-27 7:39 ` David Leverton
2014-06-27 9:25 ` Ulrich Mueller
0 siblings, 1 reply; 11+ messages in thread
From: David Leverton @ 2014-06-27 7:39 UTC (permalink / raw
To: gentoo-pms
Ulrich Mueller wrote:
>>>>>> On Thu, 26 Jun 2014, David Leverton wrote:
>
>> If, for example, we make subversion an IUSE_RUNTIME flag of git, and
>> some other package depends on dev-vcs/git[-subversion], and the user
>> has the subversion flag disabled for git but happens to have
>> subversion installed anyway, should the dependency be considered
>> satisfied (in which case it's fairly pointless)? Or does it
>> magically get treated like a blocker on dev-vcs/subversion?
>
> It should be treated like a regular USE flag for dependency
> resolution. So in your example, the dependency would be satisfied.
That makes that sort of dependency fairly useless then - it forces the
user to mess with their configuration, but it doesn't actually influence
what gets installed. If the package is somehow incompatible with
git-svn being available and working (OK, it's a pretty contrived
example...) then the dependency doesn't do anything to help the
situation. If we're OK with that then fine, but it's a potential point
of confusion for ebuild authors.
> More interesting example: Some other package could depend on
> dev-vcs/git[-perl]. "perl" is a regular USE flag in git, but is has
> "subversion? ( perl )" in REQUIRED_USE. Therefore dev-vcs/git[-perl]
> is effectively equivalent to dev-vcs/git[-perl,-subversion]. However,
> the restrictions in current GLEP 62 don't cover this case.
I don't think that's really an issue. If the package is incompatible
with the perl support in git then it should say so, and if git-svn
happens to be a casualty then the PM can enforce that just fine.
> Your arguments are valid, but they apply to regular USE flags, too.
> So I fail to see why we would need special treatment for runtime
> switchable flags here.
In theory at least, if a regular USE flag is disabled it's supposed to
actively remove support for that feature when the package is
built/installed. Currently if you depend on dev-vcs/git[-subversion]
then you know git-svn isn't installed at all, regardless of whether
subversion itself is. With IUSE_RUNTIME, the only difference between a
flag being enabled and disabled is that if it's enabled then you know
the deps for that feature are installed, but if it's disabled then they
might be installed anyway, so depending on that state doesn't guarantee
anything.
> If necessary, we can always impose additional restrictions by tree
> policy (as we do for "noblah" flags, for example), but I'd rather not
> restrict what the package manager can do. Especially, if we can simply
> go with normal USE flag logic in one case, but need special casing for
> runtime flags in the other case.
If we're OK with leaving a potential trap then that's fine, just making
sure people are aware. (Perhaps we could have a repoman check instead?)
>
> Ulrich
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-27 7:39 ` David Leverton
@ 2014-06-27 9:25 ` Ulrich Mueller
2014-06-27 9:32 ` Michał Górny
2014-06-27 13:30 ` Ciaran McCreesh
0 siblings, 2 replies; 11+ messages in thread
From: Ulrich Mueller @ 2014-06-27 9:25 UTC (permalink / raw
To: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]
>>>>> On Fri, 27 Jun 2014, David Leverton wrote:
>> It should be treated like a regular USE flag for dependency
>> resolution. So in your example, the dependency would be satisfied.
> That makes that sort of dependency fairly useless then - it forces
> the user to mess with their configuration, but it doesn't actually
> influence what gets installed. If the package is somehow
> incompatible with git-svn being available and working (OK, it's a
> pretty contrived example...) then the dependency doesn't do anything
> to help the situation. If we're OK with that then fine, but it's a
> potential point of confusion for ebuild authors.
I agree that such dependencies are not very useful, so probably they
won't be used in the tree.
Now, should we add complicated special cases to the spec and to
package managers, in order to forbid something that devs are unlikely
to do? IMHO we shouldn't, but keep things simple instead.
(Besides, it is always possible that we overlook some valid usage
case. If we forbid it in the spec, we're stuck with this. If we make
it tree policy, we can change it easily.)
> [...] (Perhaps we could have a repoman check instead?)
Sure, a repoman check sounds fine. Although I believe that there is
little danger that such deps will be added inadvertently.
Ulrich
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-27 9:25 ` Ulrich Mueller
@ 2014-06-27 9:32 ` Michał Górny
2014-06-27 13:30 ` Ciaran McCreesh
1 sibling, 0 replies; 11+ messages in thread
From: Michał Górny @ 2014-06-27 9:32 UTC (permalink / raw
To: Ulrich Mueller; +Cc: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 555 bytes --]
Dnia 2014-06-27, o godz. 11:25:52
Ulrich Mueller <ulm@gentoo.org> napisał(a):
> > [...] (Perhaps we could have a repoman check instead?)
>
> Sure, a repoman check sounds fine. Although I believe that there is
> little danger that such deps will be added inadvertently.
Well, there's an extra problem that flags can change. In particular,
dev-libs/foo-1 (EAPI 5) can have non-runtime flag of 'bar'
and dev-libs/foo-2 (EAPI 6) can change it to runtime. Therefore, I'd
say we ought to start with a warning.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 949 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-pms] Runtime-switchable USE flags
2014-06-27 9:25 ` Ulrich Mueller
2014-06-27 9:32 ` Michał Górny
@ 2014-06-27 13:30 ` Ciaran McCreesh
1 sibling, 0 replies; 11+ messages in thread
From: Ciaran McCreesh @ 2014-06-27 13:30 UTC (permalink / raw
To: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 408 bytes --]
On Fri, 27 Jun 2014 11:25:52 +0200
Ulrich Mueller <ulm@gentoo.org> wrote:
> Now, should we add complicated special cases to the spec and to
> package managers, in order to forbid something that devs are unlikely
> to do? IMHO we shouldn't, but keep things simple instead.
Experience shows that developers are quite happy doing all kinds of
convoluted nonsensical trickery...
--
Ciaran McCreesh
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-06-27 13:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 10:15 [gentoo-pms] Runtime-switchable USE flags Ulrich Mueller
2014-06-25 12:15 ` Michał Górny
2014-06-25 13:06 ` Ulrich Mueller
2014-06-25 17:02 ` Ciaran McCreesh
2014-06-26 8:04 ` Ulrich Mueller
2014-06-26 19:43 ` David Leverton
2014-06-27 6:35 ` Ulrich Mueller
2014-06-27 7:39 ` David Leverton
2014-06-27 9:25 ` Ulrich Mueller
2014-06-27 9:32 ` Michał Górny
2014-06-27 13:30 ` Ciaran McCreesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox