all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
       [not found]   ` <877f3bx4m3.fsf@gmail.com>
@ 2017-03-28 15:03     ` Ludovic Courtès
  2017-03-28 15:19       ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2017-03-28 15:03 UTC (permalink / raw)
  To: Alex Sassmannshausen; +Cc: 26264

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 <alex.sassmannshausen@gmail.com> 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’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26265: [PATCH 1/1] packages: Add optional `for-ui` param to `package-full-name`.
       [not found] ` <20170326122555.22366-2-alex@pompo.co>
@ 2017-03-28 15:06   ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-03-28 15:06 UTC (permalink / raw)
  To: Alex Sassmannshausen; +Cc: 26265, Alex Sassmannshausen

Alex Sassmannshausen <alex.sassmannshausen@gmail.com> skribis:

> * guix/packages.scm (package-full-name): Add optional parameter `for-ui`.
> * guix/scripts/refresh.scm (list-dependents): Use it.
> * tests/packages.scm: Add tests for `package-full-name`.

[...]

> +(define* (package-full-name package #:optional for-ui)
> +  "Return the full name of PACKAGE--i.e., `NAME-VERSION'.  If FOR-UI? is #t,
> +return the full name of PACKAGE using \"@\" as the NAME, VERSION separator."

I’d replace ‘for-ui’ with:

  #:optional (separator "@")

I think it’s less ambiguous.

That also means that we’d need to change *non*-UI call sites, instead of
changing UI call sites.  Hopefully there are few of them, but as
discussed in the other message, it takes manual analysis to determine
which use requires a hyphen and which one does not.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-03-28 15:03     ` bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name Ludovic Courtès
@ 2017-03-28 15:19       ` Tobias Geerinckx-Rice
       [not found]         ` <fe8b8924-3c64-e478-4745-24a692db3a91@tobias.gr>
  2017-05-06 18:32         ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice @ 2017-03-28 15:19 UTC (permalink / raw)
  To: ludo, alex.sassmannshausen; +Cc: 26264


[-- Attachment #1.1: Type: text/plain, Size: 159 bytes --]

On 28/03/17 17:03, Ludovic Courtès wrote:
> So Alex (or Tobias?)

It's up to Alex. I wouldn't mind giving this a try, or not.

Kind regards,

T G-R


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 504 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
       [not found]           ` <87o9wl1j3k.fsf@gnu.org>
@ 2017-03-28 19:49             ` Tobias Geerinckx-Rice
  0 siblings, 0 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice @ 2017-03-28 19:49 UTC (permalink / raw)
  To: ludo; +Cc: 26264


[-- Attachment #1.1: Type: text/plain, Size: 284 bytes --]

On 28/03/17 18:06, Ludovic Courtès wrote:
> There were 3 different numbers for the same thing (yours plus the two
> opened by Alex), which is why I merged them.

I know :-) I was just surprised that I didn't get notifications about
that via e-mail.

Kind regards,

T G-R


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 504 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-03-28 15:19       ` Tobias Geerinckx-Rice
       [not found]         ` <fe8b8924-3c64-e478-4745-24a692db3a91@tobias.gr>
@ 2017-05-06 18:32         ` Tobias Geerinckx-Rice
  2017-05-07 15:37           ` Ludovic Courtès
  2017-05-20  9:28           ` Alex Sassmannshausen
  1 sibling, 2 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice @ 2017-05-06 18:32 UTC (permalink / raw)
  To: ludo, alex.sassmannshausen; +Cc: 26264


[-- Attachment #1.1.1: Type: text/plain, Size: 401 bytes --]

Guix,

On 28/03/17 17:19, Tobias Geerinckx-Rice wrote:
> I wouldn't mind giving this a try, or not.

More revenge from the pre-new-job-mailbag.

I'm sticking to my original patch, and changed the problematic callers
to not use ‘package-full-name’ at all. I don't think it's the right
abstraction in any of those cases. See the overly verbose commit messages.

Kind regards,

T G-R


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0004-packages-Use-as-a-version-separator.patch --]
[-- Type: text/x-patch; name="0004-packages-Use-as-a-version-separator.patch", Size: 1029 bytes --]

From 43892525fc981533445e60a649425791cc315d0a Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 6 May 2017 14:32:12 +0200
Subject: [PATCH 4/4] packages: Use "@" as a version separator.

* guix/packages.scm (package-full-name): Use "@" instead of "-" to separate
PACKAGE-NAME and PACKAGE-VERSION.
---
 guix/packages.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 44f2c32fb..802405102 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -385,8 +385,8 @@ object."
 
 
 (define (package-full-name package)
-  "Return the full name of PACKAGE--i.e., `NAME-VERSION'."
-  (string-append (package-name package) "-" (package-version package)))
+  "Return the full name of PACKAGE--i.e., `NAME@VERSION'."
+  (string-append (package-name package) "@" (package-version package)))
 
 (define (%standard-patch-inputs)
   (let* ((canonical (module-ref (resolve-interface '(gnu packages base))
-- 
2.12.2



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.3: 0003-profiles-Don-t-use-PACKAGE-FULL-NAME.patch --]
[-- Type: text/x-patch; name="0003-profiles-Don-t-use-PACKAGE-FULL-NAME.patch", Size: 1940 bytes --]

From 0325e536cf557ff48d885948bf5fab8f59bfc444 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 6 May 2017 14:32:06 +0200
Subject: [PATCH 3/4] profiles: Don't use PACKAGE-FULL-NAME.

The non-hash parts of store paths aren't constructed according to
PACKAGE-FULL-NAME rules.  They just happened to match in the past.

* tests/profile.scm ("profile-derivation, cross-compilation"): Use
PACKAGE-NAME and PACKAGE-VERSION directly.
---
 tests/profiles.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/profiles.scm b/tests/profiles.scm
index d0b1e14a8..68e73c4ca 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -230,15 +230,18 @@
                  (and (string-suffix? name input) input)))
              (derivation-inputs drv))))
 
+    (define (package-store-suffix package)
+      (string-append (package-name package) "-" (package-version package)))
+
     ;; The inputs for grep and sed should be cross-build derivations, but that
     ;; for the glibc-utf8-locales should be a native build.
     (return (and (string=? (derivation-system drv) (%current-system))
-                 (string=? (find-input (package-full-name packages:grep))
+                 (string=? (find-input (package-store-suffix packages:grep))
                            (derivation-file-name grep))
-                 (string=? (find-input (package-full-name packages:sed))
+                 (string=? (find-input (package-store-suffix packages:sed))
                            (derivation-file-name sed))
                  (string=? (find-input
-                            (package-full-name packages:glibc-utf8-locales))
+                            (package-store-suffix packages:glibc-utf8-locales))
                            (derivation-file-name locales))))))
 
 (test-assert "package->manifest-entry defaults to \"out\""
-- 
2.12.2



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.4: 0002-gnu-gcc-boot0-Don-t-use-PACKAGE-FULL-NAME.patch --]
[-- Type: text/x-patch; name="0002-gnu-gcc-boot0-Don-t-use-PACKAGE-FULL-NAME.patch", Size: 1310 bytes --]

From f10c4fb9d269b85f9c388356a17c2b8b2fc54bd5 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 6 May 2017 14:31:56 +0200
Subject: [PATCH 2/4] gnu: gcc-boot0: Don't use PACKAGE-FULL-NAME.

Don't use Guix's naming conventions where a different one is expected.

* gnu/packages/commencement.scm (gcc-boot0)[arguments]: Use PACKAGE-NAME
and PACKAGE-VERSION directly.
---
 gnu/packages/commencement.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 92f6e6c2e..dd3261e37 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -255,7 +255,8 @@
                             ;; Drop trailing letters, as gmp-6.0.0a unpacks
                             ;; into gmp-6.0.0.
                             `(symlink ,(string-trim-right
-                                        (package-full-name lib)
+                                        (string-append (package-name lib) "-"
+                                                       (package-version lib))
                                         char-set:letter)
                                       ,(package-name lib)))
                           (list gmp-6.0 mpfr mpc))))
-- 
2.12.2



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.5: 0001-graph-Don-t-use-PACKAGE-FULL-NAME.patch --]
[-- Type: text/x-patch; name="0001-graph-Don-t-use-PACKAGE-FULL-NAME.patch", Size: 1185 bytes --]

From c090e526e21a960f34f0f02f9904757952d5a36e Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 6 May 2017 14:31:48 +0200
Subject: [PATCH 1/4] graph: Don't use PACKAGE-FULL-NAME.

Derivation files aren't named according to PACKAGE-FULL-NAME rules.
We already forfeit any supposed abstraction by manually adding ".drv".

* tests/graph.scm ("bag-emerged DAG"): Use PACKAGE-NAME and PACKAGE-VERSION
directly.
---
 tests/graph.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/graph.scm b/tests/graph.scm
index 6431c482f..53475597a 100644
--- a/tests/graph.scm
+++ b/tests/graph.scm
@@ -130,7 +130,9 @@ edges."
                      (map (lambda (destination)
                             (list "p-0.drv"
                                   (string-append
-                                   (package-full-name destination)
+                                   (package-name destination)
+                                   "-"
+                                   (package-version destination)
                                    ".drv")))
                           implicit)))))))
 
-- 
2.12.2



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 504 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-05-06 18:32         ` Tobias Geerinckx-Rice
@ 2017-05-07 15:37           ` Ludovic Courtès
  2017-05-07 21:13             ` Tobias Geerinckx-Rice
  2017-05-20  9:28           ` Alex Sassmannshausen
  1 sibling, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2017-05-07 15:37 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: alex.sassmannshausen, 26264

Hello!

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> From 43892525fc981533445e60a649425791cc315d0a Mon Sep 17 00:00:00 2001
> From: Tobias Geerinckx-Rice <me@tobias.gr>
> Date: Sat, 6 May 2017 14:32:12 +0200
> Subject: [PATCH 4/4] packages: Use "@" as a version separator.
>
> * guix/packages.scm (package-full-name): Use "@" instead of "-" to separate
> PACKAGE-NAME and PACKAGE-VERSION.
> ---
>  guix/packages.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/guix/packages.scm b/guix/packages.scm
> index 44f2c32fb..802405102 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -385,8 +385,8 @@ object."
>  
>  
>  (define (package-full-name package)
> -  "Return the full name of PACKAGE--i.e., `NAME-VERSION'."
> -  (string-append (package-name package) "-" (package-version package)))
> +  "Return the full name of PACKAGE--i.e., `NAME@VERSION'."
> +  (string-append (package-name package) "@" (package-version package)))

WDYT of making it:

  (define* (package-full-name package #:optional (separator "@"))
    …)

?

(I think I suggested it somewhere, but maybe not.  :-))

That would make the adjustments to places that need a hyphen slightly
shorter.

Thanks, and good luck with your new $DAYJOB!

Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-05-07 15:37           ` Ludovic Courtès
@ 2017-05-07 21:13             ` Tobias Geerinckx-Rice
  2017-05-08 12:39               ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Tobias Geerinckx-Rice @ 2017-05-07 21:13 UTC (permalink / raw)
  To: ludo; +Cc: 26264


[-- Attachment #1.1: Type: text/plain, Size: 1423 bytes --]

Ludo',

On 07/05/17 17:37, Ludovic Courtès wrote:
> WDYT of making it:
>   (define* (package-full-name package #:optional (separator "@"))
>     …)
> ?
> (I think I suggested it somewhere, but maybe not.  :-))

You did! I simply forgot to address it explicitly (‘I'm sticking...’).

> That would make the adjustments to places that need a hyphen slightly
> shorter.

I considered it back when, but decided not to because it just felt...
wrong. That's it. My intuitive, rambling reasoning:

- All of the patched ex-callers are manually constructing some raw
  file or directory name. It includes the package's name and version
  in some way, but not really Guix's abstract concept of a
  ‘package-full-name’ atom. It just happened to be the same string.

- Making ‘separator’ configurable turns ‘package-full-name’ into
  ‘package-name-version-join’. If one cares about the separator,
  one also cares about the components, at which point one should just
  call string-join explicitly. Doing so isn't ugly, and is more clear.

Does that make any sense?

In the end, I care more about users' ability to finally copy & paste
without confusing warnings than my perso'pinions on function naming.
This bug has been open for long enough.

> Thanks, and good luck with your new $DAYJOB!

Thanks! It doesn't involve computers, so it won't last.

Kind regards,

T G-R


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 504 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-05-07 21:13             ` Tobias Geerinckx-Rice
@ 2017-05-08 12:39               ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-05-08 12:39 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 26264

Heya!

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> On 07/05/17 17:37, Ludovic Courtès wrote:
>> WDYT of making it:
>>   (define* (package-full-name package #:optional (separator "@"))
>>     …)
>> ?
>> (I think I suggested it somewhere, but maybe not.  :-))
>
> You did! I simply forgot to address it explicitly (‘I'm sticking...’).
>
>> That would make the adjustments to places that need a hyphen slightly
>> shorter.
>
> I considered it back when, but decided not to because it just felt...
> wrong. That's it. My intuitive, rambling reasoning:
>
> - All of the patched ex-callers are manually constructing some raw
>   file or directory name. It includes the package's name and version
>   in some way, but not really Guix's abstract concept of a
>   ‘package-full-name’ atom. It just happened to be the same string.
>
> - Making ‘separator’ configurable turns ‘package-full-name’ into
>   ‘package-name-version-join’. If one cares about the separator,
>   one also cares about the components, at which point one should just
>   call string-join explicitly. Doing so isn't ugly, and is more clear.
>
> Does that make any sense?

I does, I wondered about that too.

So yeah, please push the patches, thanks!

>> Thanks, and good luck with your new $DAYJOB!
>
> Thanks! It doesn't involve computers, so it won't last.

Heheh.  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-05-06 18:32         ` Tobias Geerinckx-Rice
  2017-05-07 15:37           ` Ludovic Courtès
@ 2017-05-20  9:28           ` Alex Sassmannshausen
  2017-05-31 12:11             ` Ludovic Courtès
  1 sibling, 1 reply; 10+ messages in thread
From: Alex Sassmannshausen @ 2017-05-20  9:28 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 26264

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Heya,

Following on from Tobias patch I will also submit my revised patch.  I'm
afraid I've been sitting on it for a while.

My patch takes the approach of refactoring ‘package-full-name‘ to accept
an optional argument, ‘separator’, which defaults to ’@’ as proposed by
Ludo.

On the bright side, it seems both me and Tobias are touching the same
files in our patches, and presumably have done some testing — so either
patch should work nicely.

I'm happy for either patch to be pushed.

Best wishes,

Alex


[-- Attachment #2: Patch --]
[-- Type: text/plain, Size: 3902 bytes --]

From 44c356f50058a7d0c60523c1411150847ac66578 Mon Sep 17 00:00:00 2001
From: Alex Sassmannshausen <alex@pompo.co>
Date: Mon, 10 Apr 2017 14:38:02 +0200
Subject: [PATCH] Use '@' as default separator in `package-full-name`.

* guix/packages.scm (package-full-name): New optional argument, 'separator'
  defaulting to '@'.
* gnu/packages/commencement.scm (gcc-boot0): Set use of '-' as
  `package-full-name` separator.
* tests/graph.scm: Update tests to account for new `package-full-name`.
* tests/profiles.scm: Update tests to account for new `package-full-name`.
---
 gnu/packages/commencement.scm | 2 +-
 guix/packages.scm             | 7 ++++---
 tests/graph.scm               | 2 +-
 tests/profiles.scm            | 7 ++++---
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 1b41feac1..552358d67 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -256,7 +256,7 @@
                             ;; Drop trailing letters, as gmp-6.0.0a unpacks
                             ;; into gmp-6.0.0.
                             `(symlink ,(string-trim-right
-                                        (package-full-name lib)
+                                        (package-full-name lib "-")
                                         char-set:letter)
                                       ,(package-name lib)))
                           (list gmp-6.0 mpfr mpc))))
diff --git a/guix/packages.scm b/guix/packages.scm
index 8ead95073..92b3f034c 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -385,9 +385,10 @@ object."
   package-cross-build-system-error?)
 
 
-(define (package-full-name package)
-  "Return the full name of PACKAGE--i.e., `NAME-VERSION'."
-  (string-append (package-name package) "-" (package-version package)))
+(define* (package-full-name package #:optional (separator "@"))
+  "Return the full name of PACKAGE, separated by SEPARATOR--i.e.,
+`NAME@VERSION' by default."
+  (string-append (package-name package) separator (package-version package)))
 
 (define (%standard-patch-inputs)
   (let* ((canonical (module-ref (resolve-interface '(gnu packages base))
diff --git a/tests/graph.scm b/tests/graph.scm
index 6431c482f..a48fbfd51 100644
--- a/tests/graph.scm
+++ b/tests/graph.scm
@@ -130,7 +130,7 @@ edges."
                      (map (lambda (destination)
                             (list "p-0.drv"
                                   (string-append
-                                   (package-full-name destination)
+                                   (package-full-name destination "-")
                                    ".drv")))
                           implicit)))))))
 
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 093422792..ea2111355 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -239,12 +239,13 @@
     ;; The inputs for grep and sed should be cross-build derivations, but that
     ;; for the glibc-utf8-locales should be a native build.
     (return (and (string=? (derivation-system drv) (%current-system))
-                 (string=? (find-input (package-full-name packages:grep))
+                 (string=? (find-input (package-full-name packages:grep "-"))
                            (derivation-file-name grep))
-                 (string=? (find-input (package-full-name packages:sed))
+                 (string=? (find-input (package-full-name packages:sed "-"))
                            (derivation-file-name sed))
                  (string=? (find-input
-                            (package-full-name packages:glibc-utf8-locales))
+                            (package-full-name packages:glibc-utf8-locales
+                                               "-"))
                            (derivation-file-name locales))))))
 
 (test-assert "package->manifest-entry defaults to \"out\""
-- 
2.12.2


[-- Attachment #3: Type: text/plain, Size: 6002 bytes --]


Tobias Geerinckx-Rice writes:

> Guix,
>
> On 28/03/17 17:19, Tobias Geerinckx-Rice wrote:
>> I wouldn't mind giving this a try, or not.
>
> More revenge from the pre-new-job-mailbag.
>
> I'm sticking to my original patch, and changed the problematic callers
> to not use ‘package-full-name’ at all. I don't think it's the right
> abstraction in any of those cases. See the overly verbose commit messages.
>
> Kind regards,
>
> T G-R
>
> From 43892525fc981533445e60a649425791cc315d0a Mon Sep 17 00:00:00 2001
> From: Tobias Geerinckx-Rice <me@tobias.gr>
> Date: Sat, 6 May 2017 14:32:12 +0200
> Subject: [PATCH 4/4] packages: Use "@" as a version separator.
>
> * guix/packages.scm (package-full-name): Use "@" instead of "-" to separate
> PACKAGE-NAME and PACKAGE-VERSION.
> ---
>  guix/packages.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/guix/packages.scm b/guix/packages.scm
> index 44f2c32fb..802405102 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -385,8 +385,8 @@ object."
>  
>  
>  (define (package-full-name package)
> -  "Return the full name of PACKAGE--i.e., `NAME-VERSION'."
> -  (string-append (package-name package) "-" (package-version package)))
> +  "Return the full name of PACKAGE--i.e., `NAME@VERSION'."
> +  (string-append (package-name package) "@" (package-version package)))
>  
>  (define (%standard-patch-inputs)
>    (let* ((canonical (module-ref (resolve-interface '(gnu packages base))
> -- 
> 2.12.2
>
>
> From 0325e536cf557ff48d885948bf5fab8f59bfc444 Mon Sep 17 00:00:00 2001
> From: Tobias Geerinckx-Rice <me@tobias.gr>
> Date: Sat, 6 May 2017 14:32:06 +0200
> Subject: [PATCH 3/4] profiles: Don't use PACKAGE-FULL-NAME.
>
> The non-hash parts of store paths aren't constructed according to
> PACKAGE-FULL-NAME rules.  They just happened to match in the past.
>
> * tests/profile.scm ("profile-derivation, cross-compilation"): Use
> PACKAGE-NAME and PACKAGE-VERSION directly.
> ---
>  tests/profiles.scm | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tests/profiles.scm b/tests/profiles.scm
> index d0b1e14a8..68e73c4ca 100644
> --- a/tests/profiles.scm
> +++ b/tests/profiles.scm
> @@ -230,15 +230,18 @@
>                   (and (string-suffix? name input) input)))
>               (derivation-inputs drv))))
>  
> +    (define (package-store-suffix package)
> +      (string-append (package-name package) "-" (package-version package)))
> +
>      ;; The inputs for grep and sed should be cross-build derivations, but that
>      ;; for the glibc-utf8-locales should be a native build.
>      (return (and (string=? (derivation-system drv) (%current-system))
> -                 (string=? (find-input (package-full-name packages:grep))
> +                 (string=? (find-input (package-store-suffix packages:grep))
>                             (derivation-file-name grep))
> -                 (string=? (find-input (package-full-name packages:sed))
> +                 (string=? (find-input (package-store-suffix packages:sed))
>                             (derivation-file-name sed))
>                   (string=? (find-input
> -                            (package-full-name packages:glibc-utf8-locales))
> +                            (package-store-suffix packages:glibc-utf8-locales))
>                             (derivation-file-name locales))))))
>  
>  (test-assert "package->manifest-entry defaults to \"out\""
> -- 
> 2.12.2
>
>
> From f10c4fb9d269b85f9c388356a17c2b8b2fc54bd5 Mon Sep 17 00:00:00 2001
> From: Tobias Geerinckx-Rice <me@tobias.gr>
> Date: Sat, 6 May 2017 14:31:56 +0200
> Subject: [PATCH 2/4] gnu: gcc-boot0: Don't use PACKAGE-FULL-NAME.
>
> Don't use Guix's naming conventions where a different one is expected.
>
> * gnu/packages/commencement.scm (gcc-boot0)[arguments]: Use PACKAGE-NAME
> and PACKAGE-VERSION directly.
> ---
>  gnu/packages/commencement.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 92f6e6c2e..dd3261e37 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -255,7 +255,8 @@
>                              ;; Drop trailing letters, as gmp-6.0.0a unpacks
>                              ;; into gmp-6.0.0.
>                              `(symlink ,(string-trim-right
> -                                        (package-full-name lib)
> +                                        (string-append (package-name lib) "-"
> +                                                       (package-version lib))
>                                          char-set:letter)
>                                        ,(package-name lib)))
>                            (list gmp-6.0 mpfr mpc))))
> -- 
> 2.12.2
>
>
> From c090e526e21a960f34f0f02f9904757952d5a36e Mon Sep 17 00:00:00 2001
> From: Tobias Geerinckx-Rice <me@tobias.gr>
> Date: Sat, 6 May 2017 14:31:48 +0200
> Subject: [PATCH 1/4] graph: Don't use PACKAGE-FULL-NAME.
>
> Derivation files aren't named according to PACKAGE-FULL-NAME rules.
> We already forfeit any supposed abstraction by manually adding ".drv".
>
> * tests/graph.scm ("bag-emerged DAG"): Use PACKAGE-NAME and PACKAGE-VERSION
> directly.
> ---
>  tests/graph.scm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tests/graph.scm b/tests/graph.scm
> index 6431c482f..53475597a 100644
> --- a/tests/graph.scm
> +++ b/tests/graph.scm
> @@ -130,7 +130,9 @@ edges."
>                       (map (lambda (destination)
>                              (list "p-0.drv"
>                                    (string-append
> -                                   (package-full-name destination)
> +                                   (package-name destination)
> +                                   "-"
> +                                   (package-version destination)
>                                     ".drv")))
>                            implicit)))))))


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name
  2017-05-20  9:28           ` Alex Sassmannshausen
@ 2017-05-31 12:11             ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-05-31 12:11 UTC (permalink / raw)
  To: Alex Sassmannshausen; +Cc: 26264

Hi!

Alex Sassmannshausen <alex.sassmannshausen@gmail.com> skribis:

> On the bright side, it seems both me and Tobias are touching the same
> files in our patches, and presumably have done some testing — so either
> patch should work nicely.
>
> I'm happy for either patch to be pushed.

Same here.  :-)  Tobias, thoughts?  ISTR Tobias wasn’t enthusiastic
about the idea of an optional argument.

Anyway we should push something now!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-31 12:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170326122555.22366-1-alex@pompo.co>
     [not found] ` <6da6e290-feed-e500-e53a-d308e5dc9dde@tobias.gr>
     [not found]   ` <877f3bx4m3.fsf@gmail.com>
2017-03-28 15:03     ` bug#26264: [PATCH 0/1] Use '@' to separate name, version in package-full-name Ludovic Courtès
2017-03-28 15:19       ` Tobias Geerinckx-Rice
     [not found]         ` <fe8b8924-3c64-e478-4745-24a692db3a91@tobias.gr>
     [not found]           ` <87o9wl1j3k.fsf@gnu.org>
2017-03-28 19:49             ` Tobias Geerinckx-Rice
2017-05-06 18:32         ` Tobias Geerinckx-Rice
2017-05-07 15:37           ` Ludovic Courtès
2017-05-07 21:13             ` Tobias Geerinckx-Rice
2017-05-08 12:39               ` Ludovic Courtès
2017-05-20  9:28           ` Alex Sassmannshausen
2017-05-31 12:11             ` Ludovic Courtès
     [not found] ` <20170326122555.22366-2-alex@pompo.co>
2017-03-28 15:06   ` bug#26265: [PATCH 1/1] packages: Add optional `for-ui` param to `package-full-name` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.