GNU bug report logs - #52961
[PATCH] home: import: Fix handling of manifest entries with specific output.

Previous Next

Package: guix-patches;

Reported by: Arjan Adriaanse <arjan <at> adriaan.se>

Date: Sun, 2 Jan 2022 17:23:01 UTC

Severity: normal

Tags: patch

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

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 52961 in the body.
You can then email your comments to 52961 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 guix-patches <at> gnu.org:
bug#52961; Package guix-patches. (Sun, 02 Jan 2022 17:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arjan Adriaanse <arjan <at> adriaan.se>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 02 Jan 2022 17:23:02 GMT) Full text and rfc822 format available.

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

From: Arjan Adriaanse <arjan <at> adriaan.se>
To: guix-patches <at> gnu.org
Cc: Arjan Adriaanse <arjan <at> adriaan.se>
Subject: [PATCH] home: import: Fix handling of manifest entries with specific
 output.
Date: Sun,  2 Jan 2022 18:20:45 +0100
specification->package fails on manifest entries with specific outputs,
resulting in an invalid home configuration.  This changes the import command
to use specification->package+output instead.

* guix/scripts/home/import.scm (manifest+configuration-files->code): Make sure
manifest entries with specific output are also handled.
* tests/home-import.scm: Specify output in home environment manifest entry.
---
 guix/scripts/home/import.scm |  4 +++-
 tests/home-import.scm        | 14 ++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index fbf89069a7..15bd3140ed 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;; Copyright © 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Arjan Adriaanse <arjan <at> adriaan.se>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -164,7 +165,8 @@ (define (manifest+configuration-files->code manifest
                         ,@(delete-duplicates (concatenate modules)))
 
            (home-environment
-            (packages (map specification->package ,packages))
+            (packages (map (compose list specification->package+output)
+                           ,packages))
             (services (list ,@services)))))))))
 
 (define* (import-manifest
diff --git a/tests/home-import.scm b/tests/home-import.scm
index 0bcdf8a469..6d373acf79 100644
--- a/tests/home-import.scm
+++ b/tests/home-import.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
+;;; Copyright © 2022 Arjan Adriaanse <arjan <at> adriaan.se>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -52,7 +53,8 @@ (define glibc
 (define gcc
   (manifest-entry
     (name "gcc")
-    (version "10.3.0")
+    (version "")
+    (output "lib")
     (item "/gnu/store/...")))
 
 ;; Helpers for checking and generating home environments.
@@ -101,8 +103,8 @@ (define-home-environment-matcher match-home-environment-no-services
      ('gnu 'services))
     ('home-environment
      ('packages
-      ('map 'specification->package
-            ('list "guile <at> 2.0.9" "gcc" "glibc <at> 2.19")))
+      ('map ('compose 'list 'specification->package+output)
+            ('list "guile <at> 2.0.9" "gcc:lib" "glibc <at> 2.19")))
      ('services
       ('list)))))
 
@@ -118,7 +120,7 @@ (define-home-environment-matcher match-home-environment-transformations
     ('home-environment
      ('packages
       ('list (transform ('specification->package "guile <at> 2.0.9"))
-             ('specification->package "gcc")
+             ('list ('specification->package "gcc") "lib")
              ('specification->package "glibc <at> 2.19")))
      ('services ('list)))))
 
@@ -130,7 +132,7 @@ (define-home-environment-matcher match-home-environment-no-services-nor-packages
      ('gnu 'services))
     ('home-environment
      ('packages
-      ('map 'specification->package
+      ('map ('compose 'list 'specification->package+output)
             ('list)))
      ('services
       ('list)))))
@@ -145,7 +147,7 @@ (define-home-environment-matcher match-home-environment-bash-service
      ('gnu 'home 'services 'shells))
     ('home-environment
      ('packages
-      ('map 'specification->package
+      ('map ('compose 'list 'specification->package+output)
             ('list)))
      ('services
       ('list ('service

base-commit: a655d731e2c1bb912aa52b6e00b0d69394aa2a3b
-- 
2.34.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 05 Jan 2022 22:09:02 GMT) Full text and rfc822 format available.

Notification sent to Arjan Adriaanse <arjan <at> adriaan.se>:
bug acknowledged by developer. (Wed, 05 Jan 2022 22:09:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arjan Adriaanse <arjan <at> adriaan.se>
Cc: 52961-done <at> debbugs.gnu.org
Subject: Re: bug#52961: [PATCH] home: import: Fix handling of manifest
 entries with specific output.
Date: Wed, 05 Jan 2022 23:08:39 +0100
Hi,

Arjan Adriaanse <arjan <at> adriaan.se> skribis:

> specification->package fails on manifest entries with specific outputs,
> resulting in an invalid home configuration.  This changes the import command
> to use specification->package+output instead.
>
> * guix/scripts/home/import.scm (manifest+configuration-files->code): Make sure
> manifest entries with specific output are also handled.
> * tests/home-import.scm: Specify output in home environment manifest entry.

Applied, thanks for fixing it!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 03 Feb 2022 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 54 days ago.

Previous Next


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