From: Foo Chuan Wei <chuanwei.foo@hotmail.com>
To: 55619@debbugs.gnu.org
Subject: [bug#55619] [PATCH] gnu: smlnj: Fix use of Ctrl-c in sml REPL.
Date: Wed, 25 May 2022 01:44:59 +0000 [thread overview]
Message-ID: <PU1PR01MB21558F43DCE101CA76C722DA8DD69@PU1PR01MB2155.apcprd01.prod.exchangelabs.com> (raw)
* gnu/packages/sml.scm (smlnj): Fix use of Ctrl-c in sml REPL.
---
Related mailing list thread:
https://lists.gnu.org/archive/html/guix-devel/2022-05/msg00209.html
("Why does sh in the build environment ignore SIGINT and SIGQUIT?")
gnu/packages/sml.scm | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/sml.scm b/gnu/packages/sml.scm
index 04411c02c3..94a65961d6 100644
--- a/gnu/packages/sml.scm
+++ b/gnu/packages/sml.scm
@@ -175,10 +175,22 @@ function interface, and a symbolic debugger.")
"sml.boot.amd64-unix/SMLNJ-BASIS/.cm/amd64-unix/basis-common.cm"))
;; Build.
- (invoke "./config/install.sh" "-default"
- (if (string=? "i686-linux" ,(%current-system))
- "32"
- "64"))
+ ;; The `sml` executable built by this package somehow inherits the
+ ;; signal dispositions of the shell where it was built. If SIGINT
+ ;; is ignored in the shell, the resulting `sml` will also ignore
+ ;; SIGINT. This will break the use of Ctrl-c for interrupting
+ ;; execution in the SML/NJ REPL.
+ ;; Here, we use Guile's `system` procedure instead of Guix's
+ ;; `invoke` because `invoke` uses Guile's `system*`, which causes
+ ;; SIGINT and SIGQUIT to be ignored.
+ (let ((exit-code
+ (system (string-append "./config/install.sh -default "
+ (if (string=? "i686-linux"
+ ,(%current-system))
+ "32"
+ "64")))))
+ (unless (zero? exit-code)
+ (error (format #f "Exit code: ~a" exit-code))))
;; Undo the binary patch.
(for-each
base-commit: d129d962e437fd215c5e9428fc1b26e2d72ffbda
--
2.25.1
next reply other threads:[~2022-05-25 1:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 1:44 Foo Chuan Wei [this message]
2022-06-05 1:12 ` bug#55619: [PATCH] gnu: smlnj: Fix use of Ctrl-c in sml REPL Tobias Geerinckx-Rice via Guix-patches via
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PU1PR01MB21558F43DCE101CA76C722DA8DD69@PU1PR01MB2155.apcprd01.prod.exchangelabs.com \
--to=chuanwei.foo@hotmail.com \
--cc=55619@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.