summaryrefslogtreecommitdiff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/guix-shell.sh33
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index 2f5fd868092..b2f820bf26d 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -1,5 +1,5 @@
1# GNU Guix --- Functional package management for GNU 1# GNU Guix --- Functional package management for GNU
2# Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org> 2# Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org>
3# 3#
4# This file is part of GNU Guix. 4# This file is part of GNU Guix.
5# 5#
@@ -103,6 +103,37 @@ guix shell --bootstrap --pure -D -f "$tmpdir/empty-package.scm" \
103 guile-bootstrap -- guile --version 103 guile-bootstrap -- guile --version
104rm "$tmpdir/empty-package.scm" 104rm "$tmpdir/empty-package.scm"
105 105
106# Make sure '--development' honors '--system'.
107this_system="$(guile -c '(use-modules (guix utils))
108 (display (%current-system))')"
109other_system="$(guile -c '(use-modules (guix utils))
110 (display (if (string=? "riscv64-linux" (%current-system))
111 "x86_64-linux"
112 "riscv64-linux"))')"
113cat > "$tmpdir/some-package.scm" <<EOF
114(use-modules (guix utils)
115 (guix packages)
116 (gnu packages base))
117
118(define unsupported-dependency
119 (package
120 (inherit grep)
121 (name "unsupported-dependency")
122 (supported-systems '())))
123
124(package
125 (inherit hello)
126 (name "phony-package")
127 (inputs
128 (if (string=? (%current-system) "$this_system")
129 (list unsupported-dependency)
130 '())))
131EOF
132
133guix shell -D -f "$tmpdir/some-package.scm" -n && false
134guix shell -D -f "$tmpdir/some-package.scm" -n -s "$other_system"
135
136
106if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null 137if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
107then 138then
108 # Compute the build environment for the initial GNU Make. 139 # Compute the build environment for the initial GNU Make.