GNU bug report logs - #55619
[PATCH] gnu: smlnj: Fix use of Ctrl-c in sml REPL.

Previous Next

Package: guix-patches;

Reported by: Foo Chuan Wei <chuanwei.foo <at> hotmail.com>

Date: Wed, 25 May 2022 01:46:02 UTC

Severity: normal

Tags: patch

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55619 in the body.
You can then email your comments to 55619 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#55619; Package guix-patches. (Wed, 25 May 2022 01:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Foo Chuan Wei <chuanwei.foo <at> hotmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 25 May 2022 01:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: smlnj: Fix use of Ctrl-c in sml REPL.
Date: Wed, 25 May 2022 01:44:59 +0000
* 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





Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Sun, 05 Jun 2022 01:20:01 GMT) Full text and rfc822 format available.

Notification sent to Foo Chuan Wei <chuanwei.foo <at> hotmail.com>:
bug acknowledged by developer. (Sun, 05 Jun 2022 01:20:01 GMT) Full text and rfc822 format available.

Message #10 received at 55619-done <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 55619-done <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: smlnj: Fix use of Ctrl-c in sml REPL.
Date: Sun, 05 Jun 2022 03:12:06 +0200
[Message part 1 (text/plain, inline)]
Hi!

Thanks for the patch and the perfect comment.

The only thing I tweaked was the commit message, to reflect the 
‘what’ rather than (just) the ‘why’:

   * gnu/packages/sml.scm (smlnj): Replace INVOKE with SYSTEM
   which has more favourable signal dispositions.

Tested on a Guix System that could reproduce the original bug & 
pushed as 62da327848311a75723f16642c20d2925919237e.

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Jul 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.