Subject: Re: bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name

From: [email-masked] (Ludovic Courtès)
Date: Tue, 28 Mar 2017 17:03:07 +0200

Hello!

Thanks for addressing this longstanding issue!

For the record ‘package-full-name’ was briefly discussed at the time:

  https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00891.html

I suppose we’ll have to grep for all uses in the code to see whether
they rely on a hyphen for separation, including the web site (and prolly
Emacs-Guix.)

Alex Sassmannshausen <[email-masked]> skribis:

> The example I encountered which caused me to bail (after having adapted
> a few unit tests, e.g. in tests/profiles.scm, to expect the new name
> format), is at `gnu/packages/commencement.scm`, line 234 ff (in
> `gcc-boot0`):
> -----------------8<------------------>8----------------
>                    ,@(map (lambda (lib)
>                             ;; Drop trailing letters, as gmp-6.0.0a unpacks
>                             ;; into gmp-6.0.0.
>                             `(symlink ,(string-trim-right
>                                         (package-full-name lib)
>                                         char-set:letter)
>                                       ,(package-name lib)))
>                           (list gmp-6.0 mpfr mpc))))
> -----------------8<------------------>8----------------
>
> It seems `package-full-name` is here used to write symlinks.  I'm afraid
> I don't understand the context well enough to ascertain what effect
> changing this to '@' based writing would have.

This code definitely relies on ‘package-full-name’ using a hyphen (it
computes the name of the directory GMP etc. extract to.)

>>   - If someone's scripts do rely on parsing this kind of output, they're
>>     living on borrowed time, and will need to fix their scripts anyway.
>
> Well… I guess it all depends on whether the function is intended for
> file-system or UI name generation, and whether file-system filenames
> should have a different format from UI names…

Right, I think there have been uses beyond merely UI info, and these are
those we need to find by grepping through the code.  :-)

>>   - ‘-’'s been deprecated for quite a long while, and the next
>>     core-updates cycle is a good time to purge the last remnants of it.
>>     Of course, this patch is about 2 cycles old by now...
>
> Right, agreed, in the UI context; don't know about filename schemes.

+1!  That can be done in a subsequent commit.

>>   - If we're rebuilding the whole world for this we should get it right.
>
> Agreed.

This change should not trigger a full rebuild (the ‘package-full-name’
call in commencement.scm must be adjusted, but that’s fine.)

So Alex (or Tobias?), the check list would be:

  1. Make sure it’s a zero-rebuild change; if it’s not, it’s a bug;

  2. Grep ‘package-full-name’ through guix.git and guix-artwork.git and
     see if any use clearly requires a hyphen;

  3. Change the uses in guix-artwork.git (the web site) that uses
    ‘package-full-name’ to compute anchors;

  4. Make sure ‘make check’ passes.

If we get a green light here, then we can go ahead!

Thanks,
Ludo’.