unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: 57467@debbugs.gnu.org
Subject: bug#57467: 'guix shell' does not honor default behavior when given a specific command to run
Date: Sun, 28 Aug 2022 21:28:23 -0400	[thread overview]
Message-ID: <CAJ=Rwfb_mPMsOAb3XBM=h4i70+vBQyFTfYZ7wBbr331hM+zc7Q@mail.gmail.com> (raw)
In-Reply-To: <CAJ=RwfZ4mPmqDxvcx=Wdqk92FQwF2c2_w6-q3yMU+BH8dumPCQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 279 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 383 bytes --]

[-- Attachment #2: 0001-shell-Look-for-manifest.scm-guix.scm-in-non-interact.patch --]
[-- Type: text/x-patch, Size: 1346 bytes --]

From f2b8d4a9da5a9df0aef0e9da71a62fd9d285e994 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
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	other threads:[~2022-08-29  1:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28 21:58 bug#57467: 'guix shell' does not honor default behavior when given a specific command to run Thompson, David
2022-08-29  1:28 ` Thompson, David [this message]
2022-08-29 10:29   ` Maxime Devos
2022-08-29 12:48     ` bug#57467: [EXT] " Thompson, David
2022-08-30 13:24       ` Maxime Devos
2022-08-30 13:39         ` bug#57467: [EXT] " Thompson, David
2022-08-30 14:33           ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-08-30 16:22             ` bug#57467: [EXT] " Thompson, David
2022-08-30 19:26 ` bug#57467: [EXT] " Thompson, David
2022-09-05 13:06   ` Ludovic Courtès
2022-09-05 17:23     ` Thompson, David
2022-09-05 19:53     ` Maxime Devos
2022-09-06  7:18       ` Ludovic Courtès
2022-09-06 11:03         ` Maxime Devos
2022-09-06 11:33 ` Thompson, David

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ=Rwfb_mPMsOAb3XBM=h4i70+vBQyFTfYZ7wBbr331hM+zc7Q@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=57467@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).