Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michał Górny
On Tue, 8 Nov 2016 19:30:28 -0500
Michael Orlitzky  wrote:

> On 11/08/2016 10:47 AM, Michał Górny wrote:
> > 
> > Strictly speaking, we don't have to since the lexing should be
> > predictable enough. Of course, mistakes like missing version following
> > the operator would result in curious errors.
> > 
> > The major problem with spaces I see is that it means we end up having
> > an additional [use] block floating following them.
> >   
> 
> I was also thinking that the logical operators could be infix, and then
> you need the commas to avoid precedence issues with the implicit-and,
> which is written " ". The [use] blocks could be moved next to the
> package name I guess. If we were to rewrite the dependency syntax from
> scratch, what would it look like? My first attempt would look something
> like,
> 
>   DEPEND="dev-lang/perl,
>   net-misc/wget || net-misc/curl,

I don't think this is really more readable than || ( ... ). And in most
cases, it would be longer to write too.

>   apache2? ( www-servers/apache[apache2_modules_cgi] >= 2.4 ),

In what order is that interpreted? Remember that you aren't allowed to
reference USE flags not in IUSE without (+) and (-). So if things are
parsed left-to-right, you may end up applying an invalid USE
restriction before the version restriction.

>   ssl? (
>   !libressl? ( dev-libs/openssl:=0 ),
>   libressl? ( dev-libs/libressl:= )
> )"
> 
> The reason I'm entertaining this is because the more operators we add,
> the more awkward the prefix notation gets. If we had spaces around the
> operators, they wouldn't need to consist of invalid package characters,
> and we could do something like,
> 
>   DEPEND="app-foo/bar in [1,2]"
> 
> to request a version in the closed interval [1,2]. For (half) exclusive
> ranges, we could have (1,2), (1,2], and [1,2) -- there's no need to
> reinvent that particular wheel. We know that "in" surrounded by spaces
> is an operator, and we know the types of its two arguments. With prefix
> notation, you'd have
> 
>   DEPEND="inapp-foo/bar[1,2]" #fail

It's not prefix notation. Prefix would be:

  in[1,2]app-foo/bar

> There's always ∈, but you still have to figure out what's in the brackets.
> 
> It's fun to brainstorm, but there are probably numerous problems with
> every syntax I've imagined, and the only way to have a meaningful
> discussion about one of them would be to create a reference
> implementation and migrate some ebuilds. Retraining hundreds of
> developers and users is a high bar to set without being damn sure that
> we've got it right.

-- 
Best regards,
Michał Górny



pgpZPd81PsW2P.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michał Górny
On Wed, 9 Nov 2016 14:32:33 +0800
konsolebox  wrote:

> On Tue, Nov 8, 2016 at 6:39 PM, Michał Górny  wrote:
> >>dev-foo/bar{:1.3 :1.4 :1.5}  ## Solves "A. Range dependencies vs
> >>slotting"  
> >
> > I'm not sure about this. Slots are kinda special, especially with regard to 
> > slot operators. Problems I see:
> >
> > 1. := binds to slot of newest version matching the spec. How does this work 
> > with your spec?
> >
> > 2. Should we allow using := on some of the listed slots? What would happen?
> >
> > 3. It's asymmetric since we can't use an AND variant.  
> 
> I had to ask help from #gentoo-dev-help in order to properly
> understand slot operators since I haven't become too familiar with
> them so sorry for the late reply.  (Thanks to desultory and _AxS_).
> 
> Here I find it that we could just follow the simple AND/OR rule
> against every condition from left to right, and the interpreter would
> just do fine.  A user may create insensible rules just like how one
> could create meaningless codes in C, but that won't stop the compiler
> from compiling the code, just like how this would not prevent the
> package manager from interpreting it.  We're also free to detect
> ambiguous rules if we want to, and warn the user, or just disallow it
> completely.  But it's still optional and wouldn't yield a difference
> to a stable operation.
> 
> Examples:
> 
> dev-foo/bar:={:1.3= :1.4= :1.5=} OR dev-foo/bar(:= {:1.3= :1.4=
> :1.5=}) renders := being an "any" operator meaningless since the
> condition requires {:1.3= :1.4= :1.5=} to also be true.  It looks
> insensible, but it's still algorithmically correct, and can be
> interpreted by the package manager.

Wrong. It means 'any OR 1.3 OR 1.4 ...'. Making 'any' no longer mean
'any' in this context is confusing.

What about {:1.3/2 :1.3/3 :1.3=}?

> dev-foo/bar(:* :=) renders :* meaningless since := restricts any
> installed runtime dependency's slot and subslot to be currently
> available.  It's still algorithmically correct.

'any AND newest'? Why would you ever do that? The only purpose for :*
is to disable warnings on missing slot specifications when package has
multiple slots.

> dev-foo/bar{:* :=} renders := meaningless since :* would already be
> true, if it becomes false, := would still be false anyway. But it's
> still algorithmically correct.  In many ways, the rule doesn't make
> sense at all since virtually is just boils down to be just about
> dev-foo/bar, but it's not an issue that would stop the implementation
> of the interpreter.  And, it's also not something that would
> jeopardize how the package manager operates.

It's worse than meaningless. It requires the PM to record installed
slot for no reason whatsoever, since you allow it to switch to another
slot anyway.

> dev-foo/bar:={:1.3 :1.4 :1.5} OR dev-foo/bar(:= {:1.3 :1.4 :1.5})
> implies that the currently installed package's slot and subslot should
> be available and that the version of the slot should be 1.3, 1.4, or
> 1.5.  The interpreter could read that condition checking from left to
> right easily.  Is the currently installed package's slot and subslot
> currently available?  If no, this condition renders false and the
> currently installed package is invalid.  If yes, we follow the next
> condition. Is the slot version any of 1.3, 1.4, or 1.5?  If yes, then
> that condition yields true.

I see a lot of added complexity here, for no benefit whatsoever.

> > 4. Do we allow different ranges per slots?  
> 
> Seems possible like {:>=1.3 :<=1.5}.  Comparing subslots is also just
> about grouping where in x/y, x is the major and y is the minor.  Major
> versions are compared first, and minor versions are only compared if
> major versions are equal.

Slots are not numbers nor versions. You can't compare them.

> I hope I understand you correctly.
> 
> If you're talking about combining ranges of versions with slots, then
> yes it's possible.  You just check every condition independently.
> It's pretty simple.

That's what I was asking for.

> > How do we combine various order of data?  
> 
> I need specific example/detail on that, or perhaps I already have that
> answered above.

dev-foo/bar(:1.6 {>=3.4 :5[foo]} ([bar] <3.7))

> >>Along with it, we should also drop the strict order of the slot,
> >>version, and repo expressions (just change it to "recommended").  It
> >>makes things more flexible and makes it easier for the parser to be
> >>implemented.  
> >
> > Problems:
> >
> > 1. This could result in fairly ambiguous variants with some syntaxes 
> > purposes.  
> 
> I think that would only apply to older versions of Portage that would
> not recognize loose arrangement of conditions.  Can you give a
> specific variant where would this become an issue?

dev-foo/bar:1===3

> > 2. This makes 'simple validation' harder. Strict order makes it possible to 
> > write a simple regular expression that validates that are elements are in 
> > place and 

Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread konsolebox
On Wed, Nov 9, 2016 at 8:30 AM, Michael Orlitzky  wrote:
> On 11/08/2016 10:47 AM, Michał Górny wrote:
>>
>> Strictly speaking, we don't have to since the lexing should be
>> predictable enough. Of course, mistakes like missing version following
>> the operator would result in curious errors.
>>
>> The major problem with spaces I see is that it means we end up having
>> an additional [use] block floating following them.
>>
>
> I was also thinking that the logical operators could be infix, and then
> you need the commas to avoid precedence issues with the implicit-and,
> which is written " ".

Commas and spaces can be made optional if we allow the following
tokens to be the delimiter itself.  Grouping and use of white space
can be optionally used in cases where operators would collide, most
especially after :=.

A valid package name entry also signals end of the rules for the previous entry.

Also, precedence issues and confusions can be avoid by relying on more
explicit grouping like () and {}, instead of &&, ||, & and |.

> The [use] blocks could be moved next to the
> package name I guess.

It can actually be allowed to be placed anywhere if we don't use []
for condition grouping, and just use it for the use block.

-- 
konsolebox



Re: [gentoo-dev] tmpfiles: call for testers

2016-11-08 Thread Zac Medico
On 11/08/2016 10:44 PM, Daniel Campbell wrote:
> On 11/08/2016 05:02 PM, Rich Freeman wrote:
>> On Tue, Nov 8, 2016 at 7:54 PM, Patrick McLean  wrote:
>>> On Tue, 8 Nov 2016 17:41:02 -0600
>>> William Hubbs  wrote:

 The plan, once the first release is out, is to rewrite this utility
 in a better language. I'm considering C, but if I am comfortable by
 that time in Go or Rust, I may use one of them.

>>>
>>> For a low-level utility that is likely going to be in the default
>>> @system set, please use C. Adding dependencies on the go or rust
>>> compilers for this is not very nice.
>>>
>>
>> Assuming I'm looking at the right sources, the actual systemd
>> implementation is only 2342 lines of C.  Glancing at the includes, I'm
>> not convinced it even requires systemd to run.
>>
>> You might want to take a look at either just creating a split ebuild,
>> or tweaking it to work standalone if necessary.
>>
> Is that including any headers and/or libraries shared by the systemd
> umbrella?
> 

It has a huge list of includes for internal libraries, from acl-util.h
to util.h:

https://github.com/systemd/systemd/blob/master/src/tmpfiles/tmpfiles.c
-- 
Thanks,
Zac



Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread konsolebox
On Tue, Nov 8, 2016 at 11:47 PM, Michał Górny  wrote:
> On Tue, 8 Nov 2016 10:39:09 -0500
> Michael Orlitzky  wrote:
>
>> On 11/08/2016 09:49 AM, Ulrich Mueller wrote:
>> >
>> > This wouldn't completely solve it, because we also have a := slot
>> > operator.
>>
>> Oh, duh...
>>
>>
>> > Brackets would help, or some new separator. Pick your poison:
>>
>> I would really like to have spaces around the infix operators, but then
>> we need to separate the dependencies with a delimiter (like a comma).
>
> Strictly speaking, we don't have to since the lexing should be
> predictable enough. Of course, mistakes like missing version following
> the operator would result in curious errors.
>
> The major problem with spaces I see is that it means we end up having
> an additional [use] block floating following them.

Actually after reading replies from others, I got the idea spaces can
just be made optional, if we use () and {} over & and | (and also have
&& the default function).  Any operator can be a delimiter for itself
or the previous rule:

'dev-foo/bar>=1.3<1.5' is just synonymous to 'dev-foo/bar >= 1.3 <
1.5' or 'dev-foo/bar(>=1.3 <1.5)'.  The beauty there is that it's now
starting to synchronize with the grouping syntax of DEPEND and
RDEPEND.  We would only need to add a space or use grouping if it's
necessary like after using the := operator.

[use] blocks can also be placed anywhere if we only use [] for it, and
use () and {} for grouping versions/slot/repo rules.  And if it would
help, the interpreter can now choose to just interpret/store [use]
block as another condition element with a different class (e.g. use
class) for the sake of simplicity, and restrict it to be only used
once and outside any form of grouping.

There's simplicity in there because you know [] defines flags, while
other operators define version rules.

Btw, & and | can be misused together: dev-foo/bar(condtion & condtion
| condition) and it becomes unclear what comes first before another.
The current DEPEND and RDEPEND syntax avoids it by having && and ||
placed outside of the block.  And if you look at it, () is just
synonymous to '&& ( ... )', and {} is just synonymous to '|| ( ... )'.

-- 
konsolebox



Re: [gentoo-dev] tmpfiles: call for testers

2016-11-08 Thread Daniel Campbell
On 11/08/2016 05:02 PM, Rich Freeman wrote:
> On Tue, Nov 8, 2016 at 7:54 PM, Patrick McLean  wrote:
>> On Tue, 8 Nov 2016 17:41:02 -0600
>> William Hubbs  wrote:
>>>
>>> The plan, once the first release is out, is to rewrite this utility
>>> in a better language. I'm considering C, but if I am comfortable by
>>> that time in Go or Rust, I may use one of them.
>>>
>>
>> For a low-level utility that is likely going to be in the default
>> @system set, please use C. Adding dependencies on the go or rust
>> compilers for this is not very nice.
>>
> 
> Assuming I'm looking at the right sources, the actual systemd
> implementation is only 2342 lines of C.  Glancing at the includes, I'm
> not convinced it even requires systemd to run.
> 
> You might want to take a look at either just creating a split ebuild,
> or tweaking it to work standalone if necessary.
> 
Is that including any headers and/or libraries shared by the systemd
umbrella?

-- 
Daniel Campbell - Gentoo Developer
OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net
fpr: AE03 9064 AE00 053C 270C  1DE4 6F7A 9091 1EA0 55D6



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread konsolebox
On Tue, Nov 8, 2016 at 6:39 PM, Michał Górny  wrote:
> Dnia 8 listopada 2016 09:17:11 CET, konsolebox  
> napisał(a):
>>On Tue, Nov 8, 2016 at 3:09 PM, konsolebox 
>>wrote:
>>> On Sun, Nov 6, 2016 at 6:52 PM, Michał Górny 
>>wrote:
 Hi, everyone.

 Following my previous RFC wrt version operator problems, I'd like to
 start the second part of the discussion: how to improve version
 operators in a Future EAPI?

 I've collected various ideas on operator changes on a wiki page [1].
 I've tried to stay open-minded and cover every possibility, even
>>though
 I doubt some of them would be even considered.

 I should warn you that some of the solutions are interlinked to each
 other, and you probably need to look through the whole page first
 before starting to construct an opinion. For example, specific
 solutions to most of the problems depend on whether we enable
>>version
 ranges and in which form.

 I think we should start by loosely discussing the various ideas
 on the wiki page. Feel free to also point out any missing ideas
 or remarks that would be useful there.

 So, what are your comments?

 [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes

 --
 Best regards,
 Michał Górny
 
>>>
>>> I also like the idea of moving the operator as it's more consistent
>>> and opens new doors to other solutions.
>>>
>>> As for the use of operator & and |, they're quite good, but I'd
>>prefer
>>> the use of Gmail's style where expressions placed in () are processed
>>> with AND, and expressions placed inside {} are processed with OR:
>>>
>>> dev-foo/bar[>=1.3&<1.5]dev-foo/bar(>=1.3 <1.5)
>>> dev-foo/bar[>=1.3&<1.5&!=1.4.1]dev-foo/bar(>=1.3 <1.5
>>!=1.4.1)
>>> dev-foo/bar[<1.1|>=1.5]dev-foo/bar{<1.1 >=1.5}
>>> dev-foo/bar[=1.1*|=1.3*|>=1.5]dev-foo/bar{=1.1* =1.3* >=1.5}
>>>
>>> I find it more readable.  The former looks too compressed.
>>
>>I should also add that we can allow slots and repositories in the
>>expressions:
>>
>>dev-foo/bar{:1.3 :1.4 :1.5}  ## Solves "A. Range dependencies vs
>>slotting"
>
> I'm not sure about this. Slots are kinda special, especially with regard to 
> slot operators. Problems I see:
>
> 1. := binds to slot of newest version matching the spec. How does this work 
> with your spec?
>
> 2. Should we allow using := on some of the listed slots? What would happen?
>
> 3. It's asymmetric since we can't use an AND variant.

I had to ask help from #gentoo-dev-help in order to properly
understand slot operators since I haven't become too familiar with
them so sorry for the late reply.  (Thanks to desultory and _AxS_).

Here I find it that we could just follow the simple AND/OR rule
against every condition from left to right, and the interpreter would
just do fine.  A user may create insensible rules just like how one
could create meaningless codes in C, but that won't stop the compiler
from compiling the code, just like how this would not prevent the
package manager from interpreting it.  We're also free to detect
ambiguous rules if we want to, and warn the user, or just disallow it
completely.  But it's still optional and wouldn't yield a difference
to a stable operation.

Examples:

dev-foo/bar:={:1.3= :1.4= :1.5=} OR dev-foo/bar(:= {:1.3= :1.4=
:1.5=}) renders := being an "any" operator meaningless since the
condition requires {:1.3= :1.4= :1.5=} to also be true.  It looks
insensible, but it's still algorithmically correct, and can be
interpreted by the package manager.

dev-foo/bar(:* :=) renders :* meaningless since := restricts any
installed runtime dependency's slot and subslot to be currently
available.  It's still algorithmically correct.

dev-foo/bar{:* :=} renders := meaningless since :* would already be
true, if it becomes false, := would still be false anyway. But it's
still algorithmically correct.  In many ways, the rule doesn't make
sense at all since virtually is just boils down to be just about
dev-foo/bar, but it's not an issue that would stop the implementation
of the interpreter.  And, it's also not something that would
jeopardize how the package manager operates.

dev-foo/bar:={:1.3 :1.4 :1.5} OR dev-foo/bar(:= {:1.3 :1.4 :1.5})
implies that the currently installed package's slot and subslot should
be available and that the version of the slot should be 1.3, 1.4, or
1.5.  The interpreter could read that condition checking from left to
right easily.  Is the currently installed package's slot and subslot
currently available?  If no, this condition renders false and the
currently installed package is invalid.  If yes, we follow the next
condition. Is the slot version any of 1.3, 1.4, or 1.5?  If yes, then
that condition yields true.

If this condition fails with the currently installed package, we then
check it 

Re: [gentoo-dev] tmpfiles: call for testers

2016-11-08 Thread Rich Freeman
On Tue, Nov 8, 2016 at 7:54 PM, Patrick McLean  wrote:
> On Tue, 8 Nov 2016 17:41:02 -0600
> William Hubbs  wrote:
>>
>> The plan, once the first release is out, is to rewrite this utility
>> in a better language. I'm considering C, but if I am comfortable by
>> that time in Go or Rust, I may use one of them.
>>
>
> For a low-level utility that is likely going to be in the default
> @system set, please use C. Adding dependencies on the go or rust
> compilers for this is not very nice.
>

Assuming I'm looking at the right sources, the actual systemd
implementation is only 2342 lines of C.  Glancing at the includes, I'm
not convinced it even requires systemd to run.

You might want to take a look at either just creating a split ebuild,
or tweaking it to work standalone if necessary.

-- 
Rich



Re: [gentoo-dev] tmpfiles: call for testers

2016-11-08 Thread Patrick McLean
On Tue, 8 Nov 2016 17:41:02 -0600
William Hubbs  wrote:
> 
> The plan, once the first release is out, is to rewrite this utility
> in a better language. I'm considering C, but if I am comfortable by
> that time in Go or Rust, I may use one of them.
> 

For a low-level utility that is likely going to be in the default
@system set, please use C. Adding dependencies on the go or rust
compilers for this is not very nice.

> 
> [1] https://bugs.gentoo.org/show_bug.cgi?id=599044




Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michael Orlitzky
On 11/08/2016 10:47 AM, Michał Górny wrote:
> 
> Strictly speaking, we don't have to since the lexing should be
> predictable enough. Of course, mistakes like missing version following
> the operator would result in curious errors.
> 
> The major problem with spaces I see is that it means we end up having
> an additional [use] block floating following them.
> 

I was also thinking that the logical operators could be infix, and then
you need the commas to avoid precedence issues with the implicit-and,
which is written " ". The [use] blocks could be moved next to the
package name I guess. If we were to rewrite the dependency syntax from
scratch, what would it look like? My first attempt would look something
like,

  DEPEND="dev-lang/perl,
  net-misc/wget || net-misc/curl,
  apache2? ( www-servers/apache[apache2_modules_cgi] >= 2.4 ),
  ssl? (
!libressl? ( dev-libs/openssl:=0 ),
libressl? ( dev-libs/libressl:= )
  )"

The reason I'm entertaining this is because the more operators we add,
the more awkward the prefix notation gets. If we had spaces around the
operators, they wouldn't need to consist of invalid package characters,
and we could do something like,

  DEPEND="app-foo/bar in [1,2]"

to request a version in the closed interval [1,2]. For (half) exclusive
ranges, we could have (1,2), (1,2], and [1,2) -- there's no need to
reinvent that particular wheel. We know that "in" surrounded by spaces
is an operator, and we know the types of its two arguments. With prefix
notation, you'd have

  DEPEND="inapp-foo/bar[1,2]" #fail

There's always ∈, but you still have to figure out what's in the brackets.

It's fun to brainstorm, but there are probably numerous problems with
every syntax I've imagined, and the only way to have a meaningful
discussion about one of them would be to create a reference
implementation and migrate some ebuilds. Retraining hundreds of
developers and users is a high bar to set without being damn sure that
we've got it right.




[gentoo-dev] tmpfiles: call for testers

2016-11-08 Thread William Hubbs
All,

as part of bug 599044 [1], I have  created a tmpfiles project which is a
standalone utility to handle systemd style tmpfiles.d files.

There is currently a live ebuild in the tree, but I haven't done any
releases yet.

Take a look at it, and anything about it is open for discussion at this
point.

The name is a bit vague, but honestly I couldn't figure out a better
name. I don't really want openrc in the name, because this is meant to
be more generic than  that; it is not meant to require OpenRC to run.
OpenRC will use it, but not the other way around.

If you see any bugs, now is also the time to let me know before any
releases are out.

The plan, once the first release is out, is to rewrite this utility in a
better language. I'm considering C, but if I am comfortable by that time
in Go or Rust, I may use one of them.

Thanks,

William

[1] https://bugs.gentoo.org/show_bug.cgi?id=599044


signature.asc
Description: Digital signature


Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michał Górny
On Tue, 8 Nov 2016 10:39:09 -0500
Michael Orlitzky  wrote:

> On 11/08/2016 09:49 AM, Ulrich Mueller wrote:
> > 
> > This wouldn't completely solve it, because we also have a := slot
> > operator.  
> 
> Oh, duh...
> 
> 
> > Brackets would help, or some new separator. Pick your poison:  
> 
> I would really like to have spaces around the infix operators, but then
> we need to separate the dependencies with a delimiter (like a comma).

Strictly speaking, we don't have to since the lexing should be
predictable enough. Of course, mistakes like missing version following
the operator would result in curious errors.

The major problem with spaces I see is that it means we end up having
an additional [use] block floating following them.

-- 
Best regards,
Michał Górny



pgpfbmuemQbPd.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michael Orlitzky
On 11/08/2016 09:49 AM, Ulrich Mueller wrote:
> 
> This wouldn't completely solve it, because we also have a := slot
> operator.

Oh, duh...


> Brackets would help, or some new separator. Pick your poison:

I would really like to have spaces around the infix operators, but then
we need to separate the dependencies with a delimiter (like a comma).




Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Ulrich Mueller
> On Tue, 8 Nov 2016, Michael Orlitzky wrote:

> [...] In that proposal, the one problem mentioned is that the syntax
> would collide with the subslot dependency syntax. For example, right
> now, if I want to depend on SLOT=4 of app-foo/bar and I need my
> package to rebuild when app-foo/bar changes subslots, then I would
> use

>   app-foo/bar:4=

> With the infix change, this becomes a problem if I add an "=="
> version operator on the end:

>   app-foo/bar:4===4.1

> If we're changing everything already, though, can't we adjust the
> syntax for the subslot operators? I didn't know that ":4=" was the
> syntax that we used to depend on both a slot and a subslot. My first
> impression is that it would make more sense to use ":=4", since that
> can be read as "slot equals 4", just like ":*" means "slot
> whatever". It's not a perfect translation, but it sounds better than
> ":4=", and ":=4" looks like a stronger version of ":4", which is
> accurate.

This wouldn't completely solve it, because we also have a := slot
operator. So =app-foo/bar-4.1:= would become app-foo/bar:==4.1
(or app-foo/bar:===4.1 if we also change = to ==) in the new syntax.

Brackets would help, or some new separator. Pick your poison:

   app-foo/bar:=(=4.1)
   app-foo/bar:=[=4.1]
   app-foo/bar:={=4.1}
   app-foo/bar:=::=4.1
   app-foo/bar:=;=4.1
   app-foo/bar:=@=4.1
   app-foo/bar:=#=4.1
   app-foo/bar:=☺=4.1

Ulrich


pgpG_oHQPSa5k.pgp
Description: PGP signature


[gentoo-dev] Re: RFC: Future EAPI version operator changes

2016-11-08 Thread Ulrich Mueller
> On Sun, 6 Nov 2016, Michał Górny wrote:

> Following my previous RFC wrt version operator problems, I'd like to
> start the second part of the discussion: how to improve version
> operators in a Future EAPI?

> I've collected various ideas on operator changes on a wiki page [1].
> I've tried to stay open-minded and cover every possibility, even
> though I doubt some of them would be even considered.

> I should warn you that some of the solutions are interlinked to each
> other, and you probably need to look through the whole page first
> before starting to construct an opinion. For example, specific
> solutions to most of the problems depend on whether we enable
> version ranges and in which form.

> I think we should start by loosely discussing the various ideas
> on the wiki page. Feel free to also point out any missing ideas
> or remarks that would be useful there.

> So, what are your comments?

> [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes

Thank you for collecting these ideas. As I see it, they can be divided
into two main categories: a) additional functionality and b) syntax
changes. IMHO we shouldn't go for any major syntax change in b),
unless this would be required by an important feature in a).

About the items on the wiki page:

> 1 Reordering to PACKAGE OP VERSION

This is a purely syntactical change. We should not do this without
good reason, i.e. additional functionality that cannot be expressed
with existing syntax.

> 2 Version ranges

I think this is a feature which is needed. However, I am not so sure
if a radical change of syntax would be necessary for it.

The most pressing problem seems to be that the current syntax cannot
specify a version range that must be within the same slot.
Introduction of a slot binding all-of group would solve this.

Looks like all the rest listed under the "version ranges" heading can
already be expressed with existing syntax, although in a verbose way.
So the question is if version ranges occur often enough to justify
introduction of a new and less verbose syntax?

> 3 Version suffixes and upper/lower bound problem

IMHO not worth the effort. Dependencies of "<" type don't occur very
often. Also I would expect that in most cases it will be known what
the next version is. And if not, the relation can still be expressed
with existing syntax (e.g. by appending an _alpha suffix).

> 4 Revision-related operators

Indeed we have some inconsistency there: We have ~ which is like =
but ignoring the revision, but we don't have corresponding operators
for the other four relations. The two ones corresponding to >= and <
would be redundant, though (because the normal >= and < operators
can be used with r0). This leaves us with > (ignoring revision)
and <= (ignoring revision).

Again, not sure how often this would be needed. Adding -r is a
workaround for most (all?) cases occurring in practice.

Besides, what is special about revisions? A revbump potentially comes
with changes (like a security fix) as important as any upstream bump.
I can understand the need for the ~ operator, e.g., to keep packages
in sync that are built from the same upstream tarball. For inequality
relations I have doubts if we need anything revision specific.

> 5 Component-wide prefix comparison

I'd rather not introduce more creative ways how the * wildcard can be
abused. Maybe it could be dropped entirely, assuming we would have
version ranges.

Ulrich


pgp1hK3XYbh3_.pgp
Description: PGP signature


Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michael Orlitzky
On 11/06/2016 05:52 AM, Michał Górny wrote:
> 
> I've collected various ideas on operator changes on a wiki page [1].
> I've tried to stay open-minded and cover every possibility, even though
> I doubt some of them would be even considered.
> 
> ...
> 
> So, what are your comments?
> 

I read through the whole thing, and... it's overwhelming. A lot of the
later proposals would be affected by the first one, the reordering of

  >=app-foo/bar-x.y.z

to

  app-foo/bar >= x.y.z

Maybe it makes sense to discuss that first, since it impacts so many of
the rest? In that proposal, the one problem mentioned is that the syntax
would collide with the subslot dependency syntax. For example, right
now, if I want to depend on SLOT=4 of app-foo/bar and I need my package
to rebuild when app-foo/bar changes subslots, then I would use

  app-foo/bar:4=

With the infix change, this becomes a problem if I add an "==" version
operator on the end:

  app-foo/bar:4===4.1

If we're changing everything already, though, can't we adjust the syntax
for the subslot operators? I didn't know that ":4=" was the syntax that
we used to depend on both a slot and a subslot. My first impression is
that it would make more sense to use ":=4", since that can be read as
"slot equals 4", just like ":*" means "slot whatever". It's not a
perfect translation, but it sounds better than ":4=", and ":=4" looks
like a stronger version of ":4", which is accurate.




Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread konsolebox
On Tue, Nov 8, 2016 at 6:28 PM, Michał Górny  wrote:
> Dnia 8 listopada 2016 08:09:55 CET, konsolebox  
> napisał(a):
>>On Sun, Nov 6, 2016 at 6:52 PM, Michał Górny  wrote:
>>> Hi, everyone.
>>>
>>> Following my previous RFC wrt version operator problems, I'd like to
>>> start the second part of the discussion: how to improve version
>>> operators in a Future EAPI?
>>>
>>> I've collected various ideas on operator changes on a wiki page [1].
>>> I've tried to stay open-minded and cover every possibility, even
>>though
>>> I doubt some of them would be even considered.
>>>
>>> I should warn you that some of the solutions are interlinked to each
>>> other, and you probably need to look through the whole page first
>>> before starting to construct an opinion. For example, specific
>>> solutions to most of the problems depend on whether we enable version
>>> ranges and in which form.
>>>
>>> I think we should start by loosely discussing the various ideas
>>> on the wiki page. Feel free to also point out any missing ideas
>>> or remarks that would be useful there.
>>>
>>> So, what are your comments?
>>>
>>> [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes
>>>
>>> --
>>> Best regards,
>>> Michał Górny
>>> 
>>
>>I also like the idea of moving the operator as it's more consistent
>>and opens new doors to other solutions.
>>
>>As for the use of operator & and |, they're quite good, but I'd prefer
>>the use of Gmail's style where expressions placed in () are processed
>>with AND, and expressions placed inside {} are processed with OR:
>>
>>dev-foo/bar[>=1.3&<1.5]dev-foo/bar(>=1.3 <1.5)
>>dev-foo/bar[>=1.3&<1.5&!=1.4.1]dev-foo/bar(>=1.3 <1.5 !=1.4.1)
>>dev-foo/bar[<1.1|>=1.5]dev-foo/bar{<1.1 >=1.5}
>>dev-foo/bar[=1.1*|=1.3*|>=1.5]dev-foo/bar{=1.1* =1.3* >=1.5}
>>
>>I find it more readable.  The former looks too compressed.
>
> Two points here:
>
> 1. I really had no idea Gmail has anything like that, and I suspect a lot of 
> developers don't expect things to work that way either. I'm a programmer 
> though, so infix && and || are entirely obvious to me.

Yes I understand that it's new to most people that's why I'm not
really getting my hopes up on this idea. But I honestly see it as an
implementation that's easier to use in many ways.  The only difference
is how people would get used to it.  There had become a lot of
rules/operators in Portage where people had to refer to the manual in
order to understand them, and the difference between () and {} is just
a simple thing.

> 2. I don't think we are going to allow whitespace inside it. Currently 
> dependency specifications can be tokenized on whitespace (except for special 
> handling for groups). Allowing whitespace inside ranges breaks that.
>
> Furthermore, if we allows whitespace inside ranges, we should probably 
> consider allowing any whitespace in package dependency specifications, to 
> improve readability. This in turn can open a few cans of worms.

I got a bit lost there.  I hope you can give some elaborate/technical
examples about it.

-- 
konsolebox



Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michał Górny
Dnia 8 listopada 2016 09:17:11 CET, konsolebox  
napisał(a):
>On Tue, Nov 8, 2016 at 3:09 PM, konsolebox 
>wrote:
>> On Sun, Nov 6, 2016 at 6:52 PM, Michał Górny 
>wrote:
>>> Hi, everyone.
>>>
>>> Following my previous RFC wrt version operator problems, I'd like to
>>> start the second part of the discussion: how to improve version
>>> operators in a Future EAPI?
>>>
>>> I've collected various ideas on operator changes on a wiki page [1].
>>> I've tried to stay open-minded and cover every possibility, even
>though
>>> I doubt some of them would be even considered.
>>>
>>> I should warn you that some of the solutions are interlinked to each
>>> other, and you probably need to look through the whole page first
>>> before starting to construct an opinion. For example, specific
>>> solutions to most of the problems depend on whether we enable
>version
>>> ranges and in which form.
>>>
>>> I think we should start by loosely discussing the various ideas
>>> on the wiki page. Feel free to also point out any missing ideas
>>> or remarks that would be useful there.
>>>
>>> So, what are your comments?
>>>
>>> [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes
>>>
>>> --
>>> Best regards,
>>> Michał Górny
>>> 
>>
>> I also like the idea of moving the operator as it's more consistent
>> and opens new doors to other solutions.
>>
>> As for the use of operator & and |, they're quite good, but I'd
>prefer
>> the use of Gmail's style where expressions placed in () are processed
>> with AND, and expressions placed inside {} are processed with OR:
>>
>> dev-foo/bar[>=1.3&<1.5]dev-foo/bar(>=1.3 <1.5)
>> dev-foo/bar[>=1.3&<1.5&!=1.4.1]dev-foo/bar(>=1.3 <1.5
>!=1.4.1)
>> dev-foo/bar[<1.1|>=1.5]dev-foo/bar{<1.1 >=1.5}
>> dev-foo/bar[=1.1*|=1.3*|>=1.5]dev-foo/bar{=1.1* =1.3* >=1.5}
>>
>> I find it more readable.  The former looks too compressed.
>
>I should also add that we can allow slots and repositories in the
>expressions:
>
>dev-foo/bar{:1.3 :1.4 :1.5}  ## Solves "A. Range dependencies vs
>slotting"

I'm not sure about this. Slots are kinda special, especially with regard to 
slot operators. Problems I see:

1. := binds to slot of newest version matching the spec. How does this work 
with your spec?

2. Should we allow using := on some of the listed slots? What would happen?

3. It's asymmetric since we can't use an AND variant.

4. Do we allow different ranges per slots? How do we combine various order of 
data?

>dev-foo/bar(:1.6 {::local ::devel})  ## Especially useful in
>/etc/portage/package.{keywords,mask}

Repository deps are not covered by PMS, so that's out of scope. Though if the 
other lands,I see no problem with Portage implementing this one as well.

>
>Along with it, we should also drop the strict order of the slot,
>version, and repo expressions (just change it to "recommended").  It
>makes things more flexible and makes it easier for the parser to be
>implemented.

Problems:

1. This could result in fairly ambiguous variants with some syntaxes purposes.

2. This makes 'simple validation' harder. Strict order makes it possible to 
write a simple regular expression that validates that are elements are in place 
and correct, and are not repeated.

3. Do we allow multiple occurrences of the same type of element? I'm 
specifically thinking of multiple disjoint USE dependency blocks.

>
>Arithmetic ranges on the other hand should only be in the form of
>being "inclusive" in both ends, and not exclusive in any.  Not only is
>it simpler; it is also easier to parse.  There's also no need to use
>special grouping operators like {}.  E.g. 1.3..1.5.  Grouping is only
>necessary if the form would cause other possible conflicts, where in
>that case (1.3..1.5) and {1.3..1.5} should just be the same, unless
>there would be more added expressions in the group.

I'd say that arithmetic ranges are redundant if we do version ranges.


-- 
Best regards,
Michał Górny (by phone)



Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread Michał Górny
Dnia 8 listopada 2016 08:09:55 CET, konsolebox  
napisał(a):
>On Sun, Nov 6, 2016 at 6:52 PM, Michał Górny  wrote:
>> Hi, everyone.
>>
>> Following my previous RFC wrt version operator problems, I'd like to
>> start the second part of the discussion: how to improve version
>> operators in a Future EAPI?
>>
>> I've collected various ideas on operator changes on a wiki page [1].
>> I've tried to stay open-minded and cover every possibility, even
>though
>> I doubt some of them would be even considered.
>>
>> I should warn you that some of the solutions are interlinked to each
>> other, and you probably need to look through the whole page first
>> before starting to construct an opinion. For example, specific
>> solutions to most of the problems depend on whether we enable version
>> ranges and in which form.
>>
>> I think we should start by loosely discussing the various ideas
>> on the wiki page. Feel free to also point out any missing ideas
>> or remarks that would be useful there.
>>
>> So, what are your comments?
>>
>> [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes
>>
>> --
>> Best regards,
>> Michał Górny
>> 
>
>I also like the idea of moving the operator as it's more consistent
>and opens new doors to other solutions.
>
>As for the use of operator & and |, they're quite good, but I'd prefer
>the use of Gmail's style where expressions placed in () are processed
>with AND, and expressions placed inside {} are processed with OR:
>
>dev-foo/bar[>=1.3&<1.5]dev-foo/bar(>=1.3 <1.5)
>dev-foo/bar[>=1.3&<1.5&!=1.4.1]dev-foo/bar(>=1.3 <1.5 !=1.4.1)
>dev-foo/bar[<1.1|>=1.5]dev-foo/bar{<1.1 >=1.5}
>dev-foo/bar[=1.1*|=1.3*|>=1.5]dev-foo/bar{=1.1* =1.3* >=1.5}
>
>I find it more readable.  The former looks too compressed.

Two points here:

1. I really had no idea Gmail has anything like that, and I suspect a lot of 
developers don't expect things to work that way either. I'm a programmer 
though, so infix && and || are entirely obvious to me.

2. I don't think we are going to allow whitespace inside it. Currently 
dependency specifications can be tokenized on whitespace (except for special 
handling for groups). Allowing whitespace inside ranges breaks that.

Furthermore, if we allows whitespace inside ranges, we should probably consider 
allowing any whitespace in package dependency specifications, to improve 
readability. This in turn can open a few cans of worms.

-- 
Best regards,
Michał Górny (by phone)



Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread konsolebox
On Tue, Nov 8, 2016 at 3:09 PM, konsolebox  wrote:
> On Sun, Nov 6, 2016 at 6:52 PM, Michał Górny  wrote:
>> Hi, everyone.
>>
>> Following my previous RFC wrt version operator problems, I'd like to
>> start the second part of the discussion: how to improve version
>> operators in a Future EAPI?
>>
>> I've collected various ideas on operator changes on a wiki page [1].
>> I've tried to stay open-minded and cover every possibility, even though
>> I doubt some of them would be even considered.
>>
>> I should warn you that some of the solutions are interlinked to each
>> other, and you probably need to look through the whole page first
>> before starting to construct an opinion. For example, specific
>> solutions to most of the problems depend on whether we enable version
>> ranges and in which form.
>>
>> I think we should start by loosely discussing the various ideas
>> on the wiki page. Feel free to also point out any missing ideas
>> or remarks that would be useful there.
>>
>> So, what are your comments?
>>
>> [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes
>>
>> --
>> Best regards,
>> Michał Górny
>> 
>
> I also like the idea of moving the operator as it's more consistent
> and opens new doors to other solutions.
>
> As for the use of operator & and |, they're quite good, but I'd prefer
> the use of Gmail's style where expressions placed in () are processed
> with AND, and expressions placed inside {} are processed with OR:
>
> dev-foo/bar[>=1.3&<1.5]dev-foo/bar(>=1.3 <1.5)
> dev-foo/bar[>=1.3&<1.5&!=1.4.1]dev-foo/bar(>=1.3 <1.5 !=1.4.1)
> dev-foo/bar[<1.1|>=1.5]dev-foo/bar{<1.1 >=1.5}
> dev-foo/bar[=1.1*|=1.3*|>=1.5]dev-foo/bar{=1.1* =1.3* >=1.5}
>
> I find it more readable.  The former looks too compressed.

I should also add that we can allow slots and repositories in the expressions:

dev-foo/bar{:1.3 :1.4 :1.5}  ## Solves "A. Range dependencies vs slotting"
dev-foo/bar(:1.6 {::local ::devel})  ## Especially useful in
/etc/portage/package.{keywords,mask}

Along with it, we should also drop the strict order of the slot,
version, and repo expressions (just change it to "recommended").  It
makes things more flexible and makes it easier for the parser to be
implemented.

Arithmetic ranges on the other hand should only be in the form of
being "inclusive" in both ends, and not exclusive in any.  Not only is
it simpler; it is also easier to parse.  There's also no need to use
special grouping operators like {}.  E.g. 1.3..1.5.  Grouping is only
necessary if the form would cause other possible conflicts, where in
that case (1.3..1.5) and {1.3..1.5} should just be the same, unless
there would be more added expressions in the group.

-- 
konsolebox



Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread M. J. Everitt
On 08/11/16 08:03, konsolebox wrote:
> On Tue, Nov 8, 2016 at 3:49 PM, M. J. Everitt  wrote:
>>
>> Ewww, WTF should we use Google as a (bad) example?!
> I don't care if it's from Google or not, and you shouldn't as well.
> Grow up.  It's got nothing to do with the solution.
I'll defer to mgorny as policy maker on this one .. and such rebukes are
wholly unnecessary (although prolific) in Gentoo ..
>> And "bracketising"
>> rather than explicit operators is bound to cause confusion
> Subjective, and depends on the person.  I quickly adapted to it.
>
>> and errors ...
> What errors?
>
Just wait and see ...



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] RFC: Future EAPI version operator changes

2016-11-08 Thread konsolebox
On Tue, Nov 8, 2016 at 3:49 PM, M. J. Everitt  wrote:
> On 08/11/16 07:09, konsolebox wrote:
>> On Sun, Nov 6, 2016 at 6:52 PM, Michał Górny  wrote:
>>> Hi, everyone.
>>>
>>> Following my previous RFC wrt version operator problems, I'd like to
>>> start the second part of the discussion: how to improve version
>>> operators in a Future EAPI?
>>>
>>> I've collected various ideas on operator changes on a wiki page [1].
>>> I've tried to stay open-minded and cover every possibility, even though
>>> I doubt some of them would be even considered.
>>>
>>> I should warn you that some of the solutions are interlinked to each
>>> other, and you probably need to look through the whole page first
>>> before starting to construct an opinion. For example, specific
>>> solutions to most of the problems depend on whether we enable version
>>> ranges and in which form.
>>>
>>> I think we should start by loosely discussing the various ideas
>>> on the wiki page. Feel free to also point out any missing ideas
>>> or remarks that would be useful there.
>>>
>>> So, what are your comments?
>>>
>>> [1]:https://wiki.gentoo.org/wiki/Future_EAPI/Version_syntax_changes
>>>
>>> --
>>> Best regards,
>>> Michał Górny
>>> 
>> I also like the idea of moving the operator as it's more consistent
>> and opens new doors to other solutions.
>>
>> As for the use of operator & and |, they're quite good, but I'd prefer
>> the use of Gmail's style where expressions placed in () are processed
>> with AND, and expressions placed inside {} are processed with OR:
>>
>> dev-foo/bar[>=1.3&<1.5]dev-foo/bar(>=1.3 <1.5)
>> dev-foo/bar[>=1.3&<1.5&!=1.4.1]dev-foo/bar(>=1.3 <1.5 !=1.4.1)
>> dev-foo/bar[<1.1|>=1.5]dev-foo/bar{<1.1 >=1.5}
>> dev-foo/bar[=1.1*|=1.3*|>=1.5]dev-foo/bar{=1.1* =1.3* >=1.5}
>>
>> I find it more readable.  The former looks too compressed.
>>
> Ewww, WTF should we use Google as a (bad) example?!

I don't care if it's from Google or not, and you shouldn't as well.
Grow up.  It's got nothing to do with the solution.

> And "bracketising"
> rather than explicit operators is bound to cause confusion

Subjective, and depends on the person.  I quickly adapted to it.

> and errors ...

What errors?

-- 
konsolebox