guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/09: shell: When using '-D -f', '-D' has no effect on remaining packag


From: guix-commits
Subject: 02/09: shell: When using '-D -f', '-D' has no effect on remaining packages.
Date: Fri, 10 Dec 2021 09:33:39 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 71977101218d1fd5d7f5016cbbcb8710be057d49
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Dec 10 12:26:29 2021 +0100

    shell: When using '-D -f', '-D' has no effect on remaining packages.
    
    Fixes <https://issues.guix.gnu.org/52093>.
    Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>.
    
    * guix/scripts/shell.scm (%options): In "--file" handler, add call to
    'ensure-ad-hoc'.
    * tests/guix-shell.sh: Add test.
---
 guix/scripts/shell.scm |  2 +-
 tests/guix-shell.sh    | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 7cd7ce7..5466398 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -115,7 +115,7 @@ interactive shell in that environment.\n"))
               (option '(#\f "file") #t #f
                       (lambda (opt name arg result)
                         (alist-cons 'load (tag-package-arg result arg)
-                                    result)))
+                                    (ensure-ad-hoc result))))
               (option '(#\q) #f #f
                       (lambda (opt name arg result)
                         (alist-cons 'explicit-loading? #t result)))
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index 3bdf625..d8cae9d 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -73,6 +73,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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]