Merge branch 'master' into staging
[jackhill/guix/guix.git] / tests / guix-shell.sh
index 7c42fd6..6340f90 100644 (file)
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org>
 #
 # This file is part of GNU Guix.
 #
@@ -35,6 +35,9 @@ guix shell --bootstrap --pure guile-bootstrap -- guile --version
 # '--ad-hoc' is a thing of the past.
 ! guix shell --ad-hoc guile-bootstrap
 
+# Rejecting unsupported packages.
+! guix shell -s armhf-linux intelmetool -n
+
 # Ignoring unauthorized files.
 cat > "$tmpdir/guix.scm" <<EOF
 This is a broken guix.scm file.
@@ -73,6 +76,20 @@ echo "Broken manifest." > "$tmpdir/manifest.scm"
 (cd "$tmpdir"; SHELL="$(realpath fake-shell.sh)" guix shell --bootstrap -q)
 rm "$tmpdir/manifest.scm"
 
+# Make sure '-D' affects only the immediately following '-f', and not packages
+# that appear later: <https://issues.guix.gnu.org/52093>.
+cat > "$tmpdir/empty-package.scm" <<EOF
+(use-modules (guix) (guix tests)
+             (guix build-system trivial))
+
+(dummy-package "empty-package"
+  (build-system trivial-build-system))   ;zero inputs
+EOF
+
+guix shell --bootstrap --pure -D -f "$tmpdir/empty-package.scm" \
+     guile-bootstrap -- guile --version
+rm "$tmpdir/empty-package.scm"
+
 if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
 then
     # Compute the build environment for the initial GNU Make.