GNU bug report logs - #31088
Use '@' as version number separator in guix output

Previous Next

Package: guix;

Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>

Date: Sat, 7 Apr 2018 17:00:02 UTC

Severity: normal

Done: Chris Marusich <cmmarusich <at> gmail.com>

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 31088 in the body.
You can then email your comments to 31088 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#31088; Package guix. (Sat, 07 Apr 2018 17:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <ambrevar <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 07 Apr 2018 17:00:02 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <ambrevar <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: Use '@' as version number separator in guix output
Date: Sat, 07 Apr 2018 22:28:55 +0530
[Message part 1 (text/plain, inline)]
At the moment it seems that there is no syntactic different between the
name and the version number in the output of Guix.

The other day I tried to extract the version number of package
dependencies with "everything after the last '-'", until I stumbled on
the following:

	> guix package --show=ncdu | recsel -R dependencies
	ncurses-6.0-20170930

Here the version number contains a '-'.  Because of this it makes the
problem undecidable I think.

Would it be possible to separate the package name from the version
number with '@' instead?

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

Information forwarded to bug-guix <at> gnu.org:
bug#31088; Package guix. (Tue, 10 Apr 2018 06:39:02 GMT) Full text and rfc822 format available.

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

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Pierre Neidhardt <ambrevar <at> gmail.com>, Mathieu Lirzin <mthl <at> gnu.org>
Cc: 31088 <at> debbugs.gnu.org
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Mon, 09 Apr 2018 23:38:01 -0700
[Message part 1 (text/plain, inline)]
Hi Pierre and Mathieu,

Thank you for the bug report, Pierre!  Mathieu, can you take a look at
the patch I've attached to this email?  It should fix this bug, but
since you made similar changes in the past, I'd value your feedback.

Pierre Neidhardt <ambrevar <at> gmail.com> writes:

> Would it be possible to separate the package name from the version
> number with '@' instead?

Pierre's suggestion makes sense to me.  Starting with Mathieu's commit
1b846da8c372bee78851439fd9e72b2499115e5a about one year ago, we use "@"
to separate the package name from the version in commands like "guix
package -i ncdu <at> 1.13" and also in exported scheme procedures like
specification->package (defined in (gnu packages)).  Before that, we
used "-" instead of "@".  When we made the change, it looks like we did
not also update the "dependencies" output from commands like "guix
package --show".

I've attached a patch that fixes the issue.  It applies cleanly to
df154c05dc65025eac2d14ab45699b34c7a1c7c8 (the tip of the master branch
at the time I drafted this email), and "make check" succeeds.  With the
change, the output now looks like this:

  $ ./pre-inst-env guix package --show=ncdu | recsel -p dependencies
  dependencies: ncurses <at> 6.0-20170930

I was not able to run "make check-system" successfully, but there is no
reason to suspect that the attached patch causes any problem, since the
"check-system" target was already failing in the same way at commit
df154c05dc65025eac2d14ab45699b34c7a1c7c8.  I'll open up a separate bug
report for that separate issue.

Because I changed the package-full-name procedure, this also fixes the
package names in other places, such as graphs produced by "guix graph".
I'm not sure how many package rebuilds (if any?) this will cause, and
I'd like to hear what Mathieu has to say about my patch, so I'll wait to
push it until after I get feedback from him or another interested
person.  We should probably also regenerate the images in
guix/doc/images (so that the delimiter used in the images is "@" instead
of "-", although I'm not sure yet how to regenerate the source dot
files.  Mathieu, please let me know what you think!

In the meantime, Pierre, you can work around the issue by writing a
Guile script that gets the package version using the Guix API like so:

  scheme@(guile-user)> ,use (gnu packages ncdu)
  scheme@(guile-user)> ,use (guix packages)
  scheme@(guile-user)> (package-version ncdu)
  $1 = "1.13"

If you aren't sure how to get started writing Guile scripts, please
refer to the section "Running Guile Scripts" in the Guile manual.

-- 
Chris

[0001-guix-Separate-the-package-name-and-version-with-not.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#31088; Package guix. (Tue, 10 Apr 2018 07:00:02 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <ambrevar <at> gmail.com>
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: Mathieu Lirzin <mthl <at> gnu.org>, 31088 <at> debbugs.gnu.org
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Tue, 10 Apr 2018 12:29:37 +0530
[Message part 1 (text/plain, inline)]
Thank you very much for the hard work!

-- 
Pierre Neidhardt

We totally deny the allegations, and we're trying to identify the allegators.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#31088; Package guix. (Tue, 10 Apr 2018 16:52:01 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: 31088 <at> debbugs.gnu.org, Mathieu Lirzin <mthl <at> gnu.org>,
 Pierre Neidhardt <ambrevar <at> gmail.com>
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Tue, 10 Apr 2018 19:51:09 +0300
Chris Marusich (2018-04-09 23:38 -0700) wrote:

[...]
> Because I changed the package-full-name procedure, this also fixes the
> package names in other places, such as graphs produced by "guix graph".

I recall there was some discussion about 'package-full-name' in the past
but I remember nothing about it :-)

Well, maybe it is not relevant at all, but I've found there was a
proposition to use "@" in 'package-full-name' and it is still not used
there.  Look at:

  http://lists.gnu.org/archive/html/guix-devel/2016-04/msg01141.html

-- 
Alex




Information forwarded to bug-guix <at> gnu.org:
bug#31088; Package guix. (Wed, 11 Apr 2018 04:42:01 GMT) Full text and rfc822 format available.

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

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Pierre Neidhardt <ambrevar <at> gmail.com>
Cc: Mathieu Lirzin <mthl <at> gnu.org>, 31088 <at> debbugs.gnu.org
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Tue, 10 Apr 2018 21:41:23 -0700
[Message part 1 (text/plain, inline)]
Hi,

Here's a new version of the patch.  The only change is: I modified the
tests (tests/graph.scm and tests/profiles.scm) so that they also use the
package-full-name procedure's new #:delimiter keyword argument when
necessary.  I intended to do that from the start, but I forgot.

Alex Kost <alezost <at> gmail.com> writes:

> Chris Marusich (2018-04-09 23:38 -0700) wrote:
>
> [...]
>> Because I changed the package-full-name procedure, this also fixes the
>> package names in other places, such as graphs produced by "guix graph".
>
> I recall there was some discussion about 'package-full-name' in the past
> but I remember nothing about it :-)
>
> Well, maybe it is not relevant at all, but I've found there was a
> proposition to use "@" in 'package-full-name' and it is still not used
> there.  Look at:
>
>   http://lists.gnu.org/archive/html/guix-devel/2016-04/msg01141.html

Yes, we need to be careful.  The most obvious problem I encountered was
that the Guix daemon prohibits "@" in store item names (which I learned
only after attempting to change the delimiter everywhere and then
running some tests).  However, my patch does not put the "@" symbol into
store item names.  In fact, to be extra clear, I've added a comment to
the package->bag procedure to explain why we can't use "@" there.

I think the risk is fairly low that something in Guix itself will
malfunction if we make this change, since I've looked at the call sites
for package-full-name (in the guix Git repo only), I've run "make check"
successfully, and I've verified manually that a handful of guix commands
still function correctly.  But you never really know until you try.  We
should probably still check in some other places before changing the
default delimiter from "-" to "@".  For example, we should probably
check at least the following places:

* Hydra
* Cuirass
* Emacs-Guix

Where else should we check?

If it's too risky, we can always make the default delimiter "-" and only
change it to "@" in those places where we really need to (e.g., the
package->recutils procedure in (guix ui), to fix this specific bug
report).  What do you think?

-- 
Chris
[0001-guix-Separate-the-package-name-and-version-with-not.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#31088; Package guix. (Tue, 01 May 2018 21:05:01 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: Mathieu Lirzin <mthl <at> gnu.org>, 31088 <at> debbugs.gnu.org,
 Pierre Neidhardt <ambrevar <at> gmail.com>
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Tue, 01 May 2018 23:04:37 +0200
Hello Chris,

Thanks for digging into this.

Chris Marusich <cmmarusich <at> gmail.com> skribis:

> From 67165c95ff9b52b7ae34d7c07778138548013ccd Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich <at> gmail.com>
> Date: Sun, 8 Apr 2018 16:51:42 -0700
> Subject: [PATCH] guix: Separate the package name and version with "@", not
>  "-".
>
> * guix/packages.scm (package-full-name): By default, use "@" to separate
>   the package name and package version.  Add #:delimiter keyword
>   argument so that there is still a way to explicitly use a different
>   delimiter.
> * gnu/packages/commencement.scm (gcc-boot0) <unpack-gmp&co>: Adjust
>   accordingly.
> * tests/graph.scm: Adjust accordingly.
> * tests/profiles.scm: Adjust accordingly.
> * NEWS: Mention the change.
>
> Fixes: <https://bugs.gnu.org/31088>.
> Reported by Pierre Neidhardt <ambrevar <at> gmail.com>.

[...]

> diff --git a/NEWS b/NEWS
> index 2c898e65f..9769bfc87 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -777,6 +777,7 @@ zynaddsubfx <at> 3.0.2
>  
>  ** Programming interfaces
>  
> +*** package-full-name (guix packages) now uses "@" instead of "-" as its delimiter.

This is under “Changes in 0.14.0 (since 0.13.0)”, which is probably not
what you want.  :-)

> +(define* (package-full-name package #:key (delimiter "@"))
> +  "Return the full name of PACKAGE--i.e., `NAME <at> VERSION'.  By specifying
> +DELIMITER (a string), you can customize what will appear between the name and
> +the version.  By default, DELIMITER is \"@\"."

I’d prefer #:optional instead of #:key, it’d be less verbose.

Other than that, please make sure “make check” passes, and make sure
this doesn’t trigger a full rebuild (from the patch it looks you already
checked both of these, but who knows ;-)).

OK with this.

Thank you!

Ludo’.




Reply sent to Chris Marusich <cmmarusich <at> gmail.com>:
You have taken responsibility. (Wed, 09 May 2018 05:37:02 GMT) Full text and rfc822 format available.

Notification sent to Pierre Neidhardt <ambrevar <at> gmail.com>:
bug acknowledged by developer. (Wed, 09 May 2018 05:37:05 GMT) Full text and rfc822 format available.

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

From: Chris Marusich <cmmarusich <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès), Mathieu Lirzin
 <mthl <at> gnu.org>,  Pierre Neidhardt <ambrevar <at> gmail.com>
Cc: 31088-done <at> debbugs.gnu.org
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Tue, 08 May 2018 22:36:28 -0700
[Message part 1 (text/plain, inline)]
Hi everyone!

I've committed this as ede121de426f9c56820852888a0b370f0ccbce49 on the
master branch.  If anything breaks on Hydra or elsewhere, please don't
hesitate to revert it.

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

>> diff --git a/NEWS b/NEWS
>> index 2c898e65f..9769bfc87 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -777,6 +777,7 @@ zynaddsubfx <at> 3.0.2
>>  
>>  ** Programming interfaces
>>  
>> +*** package-full-name (guix packages) now uses "@" instead of "-" as its delimiter.
>
> This is under “Changes in 0.14.0 (since 0.13.0)”, which is probably not
> what you want.  :-)

Ah!  Good catch.  I've added a new section for 0.15.0 - which I'm sure
will be released soon!  ;-)

>> +(define* (package-full-name package #:key (delimiter "@"))>
> +  "Return the full name of PACKAGE--i.e., `NAME <at> VERSION'.  By specifying
>> +DELIMITER (a string), you can customize what will appear between the name and
>> +the version.  By default, DELIMITER is \"@\"."
>
> I’d prefer #:optional instead of #:key, it’d be less verbose.

Sounds good.  I've implemented your suggestion.

> Other than that, please make sure “make check” passes, and make sure
> this doesn’t trigger a full rebuild (from the patch it looks you already
> checked both of these, but who knows ;-)).

I've confirmed the following:

1) It builds, and "make check" passes [1].

2) It does not trigger a full rebuild.  I tested this by first invoking
"./pre-inst-env guix system build gnu/system/examples/desktop.tmpl"
before and after the change.

3) I reconfigured my own system a few days ago, too, using this change.
So far, I have observed no problems.

> OK with this.

Thank you for the review!  And thank you, Pierre, for reporting the bug!

Footnotes: 
[1]  tests/guix-system.sh fails, but it was already failing on the
master branch.  I will open a bug report for that if there is not
already one open.

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

Information forwarded to bug-guix <at> gnu.org:
bug#31088; Package guix. (Wed, 09 May 2018 09:16:01 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: 31088-done <at> debbugs.gnu.org, Mathieu Lirzin <mthl <at> gnu.org>,
 Pierre Neidhardt <ambrevar <at> gmail.com>
Subject: Re: bug#31088: Use '@' as version number separator in guix output
Date: Wed, 09 May 2018 11:15:28 +0200
Hey Chris,

Chris Marusich <cmmarusich <at> gmail.com> skribis:

> I've committed this as ede121de426f9c56820852888a0b370f0ccbce49 on the
> master branch.  If anything breaks on Hydra or elsewhere, please don't
> hesitate to revert it.

Awesome, thank you!

Ludo’.




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

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

Previous Next


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