GNU bug report logs - #28446
linux-libre@4.1 should select 4.1.x, not 4.13.x

Previous Next

Package: guix;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Wed, 13 Sep 2017 15:08:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28446 in the body.
You can then email your comments to 28446 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#28446; Package guix. (Wed, 13 Sep 2017 15:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark H Weaver <mhw <at> netris.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 13 Sep 2017 15:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: bug-guix <at> gnu.org
Subject: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Wed, 13 Sep 2017 11:07:32 -0400
Currently, the package specification "linux-libre <at> 4.1" selects version
4.13.  It should instead select version 4.1.

      Mark




Information forwarded to bug-guix <at> gnu.org:
bug#28446; Package guix. (Thu, 21 Sep 2017 12:50:01 GMT) Full text and rfc822 format available.

Message #8 received at 28446 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 28446 <at> debbugs.gnu.org
Subject: Re: bug#28446: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Thu, 21 Sep 2017 14:48:58 +0200
Hi Mark,

> Currently, the package specification "linux-libre <at> 4.1" selects version
> 4.13.  It should instead select version 4.1.

We consider everthing following the “@” a version string prefix.  Since
versions are arbitrary strings “4.1” is considered a valid prefix of
“4.13”.  If a user supplied the version string “4.1.” they would get the
appropriate package.

The current implementation sorts all matches in decreasing version order
and picks the package with the highest version.  This is implemented in
(gnu packages) with “%find-packages”, “find-best-packages-by-name”, and
“find-packages-by-name”.

Should we try to make the code understand version strings better and
compare substrings of the version string?  We could fall back to using
“string-prefix?” when the substring is not a number.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





Information forwarded to bug-guix <at> gnu.org:
bug#28446; Package guix. (Fri, 22 Sep 2017 01:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 28446 <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Mark H Weaver <mhw <at> netris.org>, 28446 <at> debbugs.gnu.org
Subject: Re: bug#28446: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Thu, 21 Sep 2017 18:53:58 -0700
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:

> Hi Mark,
>
>> Currently, the package specification "linux-libre <at> 4.1" selects version
>> 4.13.  It should instead select version 4.1.
>
> We consider everthing following the “@” a version string prefix.  Since
> versions are arbitrary strings “4.1” is considered a valid prefix of
> “4.13”.  If a user supplied the version string “4.1.” they would get the
> appropriate package.
>
> The current implementation sorts all matches in decreasing version order
> and picks the package with the highest version.  This is implemented in
> (gnu packages) with “%find-packages”, “find-best-packages-by-name”, and
> “find-packages-by-name”.
>
> Should we try to make the code understand version strings better and
> compare substrings of the version string?  We could fall back to using
> “string-prefix?” when the substring is not a number.
>

Why not require an exact match?  If someone asks for 4.1, they shouldn't
get 4.11 or 4.13 or anything else; they should get 4.1.  In my
experience, mechanisms that attempt to guess which package version the
user meant generally wind up choosing the wrong thing at some point.  I
think it would be reasonable to bail out and ask the user to clarify
what they wanted.

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#28446; Package guix. (Fri, 22 Sep 2017 08:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 28446 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: Mark H Weaver <mhw <at> netris.org>, 28446 <at> debbugs.gnu.org
Subject: Re: bug#28446: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Fri, 22 Sep 2017 10:04:53 +0200
Chris Marusich <cmmarusich <at> gmail.com> writes:

> Ricardo Wurmus <rekado <at> elephly.net> writes:
>
>> Hi Mark,
>>
>>> Currently, the package specification "linux-libre <at> 4.1" selects version
>>> 4.13.  It should instead select version 4.1.
>>
>> We consider everthing following the “@” a version string prefix.  Since
>> versions are arbitrary strings “4.1” is considered a valid prefix of
>> “4.13”.  If a user supplied the version string “4.1.” they would get the
>> appropriate package.
>>
>> The current implementation sorts all matches in decreasing version order
>> and picks the package with the highest version.  This is implemented in
>> (gnu packages) with “%find-packages”, “find-best-packages-by-name”, and
>> “find-packages-by-name”.
>>
>> Should we try to make the code understand version strings better and
>> compare substrings of the version string?  We could fall back to using
>> “string-prefix?” when the substring is not a number.
>>
>
> Why not require an exact match?  If someone asks for 4.1, they shouldn't
> get 4.11 or 4.13 or anything else; they should get 4.1.

“4.1” has no exact match.  The full version string is “4.1.43”.  If we
want users to get “4.1.43” when they input “4.1”, then we’ll have to
make the code understand version strings better.

Not all version strings are dot-separated numbers.  Maybe this doesn’t
matter and we’ll just ignore those cases.

> In my
> experience, mechanisms that attempt to guess which package version the
> user meant generally wind up choosing the wrong thing at some point.  I
> think it would be reasonable to bail out and ask the user to clarify
> what they wanted.

The code already produces a warning in this case but proceeds to pick
the match with the highest version.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





Information forwarded to bug-guix <at> gnu.org:
bug#28446; Package guix. (Tue, 26 Sep 2017 04:27:02 GMT) Full text and rfc822 format available.

Message #17 received at 28446 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 28446 <at> debbugs.gnu.org
Subject: Re: bug#28446: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Tue, 26 Sep 2017 00:26:15 -0400
Hi Ricardo,

Ricardo Wurmus <rekado <at> elephly.net> writes:

>> Currently, the package specification "linux-libre <at> 4.1" selects version
>> 4.13.  It should instead select version 4.1.
>
> We consider everthing following the “@” a version string prefix.  Since
> versions are arbitrary strings “4.1” is considered a valid prefix of
> “4.13”.  If a user supplied the version string “4.1.” they would get the
> appropriate package.
>
> The current implementation sorts all matches in decreasing version order
> and picks the package with the highest version.  This is implemented in
> (gnu packages) with “%find-packages”, “find-best-packages-by-name”, and
> “find-packages-by-name”.
>
> Should we try to make the code understand version strings better and
> compare substrings of the version string?  We could fall back to using
> “string-prefix?” when the substring is not a number.

One possible approach would be as follows: if the last character of the
specification is a digit, then priority should be given to versions that
have a non-digit (or end-of-string) after the last matching character.

Put another way, if the provided specification {SPEC} ends with a digit,
then we should first search based on the following regexp:

  ^{SPEC}[^0-9]

if no matches are found, then fall back to:

  ^{SPEC}

This would gracefully handle the common case where groups of adjacent
digits should be considered as single numbers, while still allowing
prefixes of other numeric components such as dates or commit ids.

I admit that this proposal lacks elegance.  So far I have no better
ideas.

      Mark




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Sun, 13 May 2018 11:32:01 GMT) Full text and rfc822 format available.

Notification sent to Mark H Weaver <mhw <at> netris.org>:
bug acknowledged by developer. (Sun, 13 May 2018 11:32:01 GMT) Full text and rfc822 format available.

Message #22 received at 28446-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 28446-done <at> debbugs.gnu.org
Subject: Re: bug#28446: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Sun, 13 May 2018 13:31:08 +0200
Hello,

Mark H Weaver <mhw <at> netris.org> skribis:

> Ricardo Wurmus <rekado <at> elephly.net> writes:
>
>>> Currently, the package specification "linux-libre <at> 4.1" selects version
>>> 4.13.  It should instead select version 4.1.
>>
>> We consider everthing following the “@” a version string prefix.  Since
>> versions are arbitrary strings “4.1” is considered a valid prefix of
>> “4.13”.  If a user supplied the version string “4.1.” they would get the
>> appropriate package.

I pushed a fix that I think does what we want as
348987d3d12ebaf11fdbcc3dbd56585e7d69a1f5.

Basically ‘version-prefix?’ splits a version string at dots and compares
whole components.

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Jun 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.