summaryrefslogtreecommitdiff
path: root/guix/scripts/environment.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-12-06 17:55:49 +0100
committerLudovic Courtès <ludo@gnu.org>2023-12-06 23:50:04 +0100
commitd98a0203b733316a8a5c9440469dfdd10fc9613f (patch)
treeaab053f7ebc269f76a95daa4190e12eb323d0828 /guix/scripts/environment.scm
parent4a6cef9d66ff26e96d63f2f1f886b8212154ca00 (diff)
shell: ‘--development’ honors ‘--system’.
Fixes a bug whereby ‘package->development-manifest’ would run with the wrong system in mind, leading to errors like this: $ guix shell -s i586-gnu -D shepherd --no-grafts guix shell: error: package linux-libre-headers@5.15.49 does not support i586-gnu * guix/scripts/environment.scm (options/resolve-packages): Define ‘system’ and pass it to ‘package->development-manifest’.’ * tests/guix-shell.sh: Test it. Change-Id: I95c471c1918913ab80dec7d3ca64fe38583cce78
Diffstat (limited to 'guix/scripts/environment.scm')
-rw-r--r--guix/scripts/environment.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 6ae3b11e39..1d7a6e198d 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -311,6 +311,9 @@ use '--preserve' instead~%"))
(define (options/resolve-packages store opts)
"Return OPTS with package specification strings replaced by manifest entries
for the corresponding packages."
+ (define system
+ (assoc-ref opts 'system))
+
(define (manifest-entry=? e1 e2)
(and (eq? (manifest-entry-item e1) (manifest-entry-item e2))
(string=? (manifest-entry-output e1)
@@ -327,11 +330,11 @@ for the corresponding packages."
((? package? package)
(if (eq? mode 'ad-hoc-package)
(list (package->manifest-entry* package))
- (manifest-entries (package->development-manifest package))))
+ (manifest-entries (package->development-manifest package system))))
(((? package? package) (? string? output))
(if (eq? mode 'ad-hoc-package)
(list (package->manifest-entry* package output))
- (manifest-entries (package->development-manifest package))))
+ (manifest-entries (package->development-manifest package system))))
((lst ...)
(append-map (cut packages->outputs <> mode) lst))))
@@ -345,7 +348,8 @@ for the corresponding packages."
(('package 'package (? string? spec))
(manifest-entries
(package->development-manifest
- (transform (specification->package+output spec)))))
+ (transform (specification->package+output spec))
+ system)))
(('expression mode str)
;; Add all the outputs of the package STR evaluates to.
(packages->outputs (read/eval str) mode))