unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Arjan Adriaanse <arjan@adriaan.se>
To: 52961@debbugs.gnu.org
Cc: Arjan Adriaanse <arjan@adriaan.se>
Subject: [bug#52961] [PATCH] home: import: Fix handling of manifest entries with specific output.
Date: Sun,  2 Jan 2022 18:20:45 +0100	[thread overview]
Message-ID: <a0ac881ea3a7a61616cbeba8c087cd08ca857738.1641143800.git.arjan@adriaan.se> (raw)

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@yoctocell.xyz>
 ;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2022 Arjan Adriaanse <arjan@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@yoctocell.xyz>
+;;; Copyright © 2022 Arjan Adriaanse <arjan@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@2.0.9" "gcc" "glibc@2.19")))
+      ('map ('compose 'list 'specification->package+output)
+            ('list "guile@2.0.9" "gcc:lib" "glibc@2.19")))
      ('services
       ('list)))))
 
@@ -118,7 +120,7 @@ (define-home-environment-matcher match-home-environment-transformations
     ('home-environment
      ('packages
       ('list (transform ('specification->package "guile@2.0.9"))
-             ('specification->package "gcc")
+             ('list ('specification->package "gcc") "lib")
              ('specification->package "glibc@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	other threads:[~2022-01-02 17:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 17:20 Arjan Adriaanse [this message]
2022-01-05 22:08 ` bug#52961: [PATCH] home: import: Fix handling of manifest entries with specific output Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0ac881ea3a7a61616cbeba8c087cd08ca857738.1641143800.git.arjan@adriaan.se \
    --to=arjan@adriaan.se \
    --cc=52961@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).