Hi again,

I decided to just implement the fix and see what people think of it.
Simply removing a check for non-interactive invocation solves the issue and
now 'guix shell' and 'guix shell -- make' act exactly the same except for
which command they run.  Patch attached.

- Dave
From f2b8d4a9da5a9df0aef0e9da71a62fd9d285e994 Mon Sep 17 00:00:00 2001
From: David Thompson <[email protected]>
Date: Sun, 28 Aug 2022 21:21:09 -0400
Subject: [PATCH] shell: Look for manifest.scm/guix.scm in non-interactive
 case, too.

Fixes <https://issues.guix.gnu.org/57467>.

Fixes a bug where a command like 'guix shell -- make' does not look for
guix.scm or manifest like 'guix shell' with no additional arguments does.

* guix/scripts/shell.scm (auto-detect-manifest): Remove check for
non-interactive invocation that was stopping implicit loading.
---
 guix/scripts/shell.scm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index c115a00320..0e9ab0dd94 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -260,14 +260,10 @@ (define (options-contain-payload? opts)
       ((('expression . _) . _) #t)
       ((_ . rest) (options-contain-payload? rest))))
 
-  (define interactive?
-    (not (assoc-ref opts 'exec)))
-
   (define disallow-implicit-load?
     (assoc-ref opts 'explicit-loading?))
 
-  (if (or (not interactive?)
-          disallow-implicit-load?
+  (if (or disallow-implicit-load?
           (options-contain-payload? opts))
       opts
       (match (find-file-in-parent-directories '("manifest.scm" "guix.scm"))
-- 
2.37.2

Reply via email to