guix-commits
[Top][All Lists]
Advanced

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

05/05: gnu: smlnj: Fix use of Ctrl-c in sml REPL.


From: guix-commits
Subject: 05/05: gnu: smlnj: Fix use of Ctrl-c in sml REPL.
Date: Sat, 4 Jun 2022 21:10:49 -0400 (EDT)

nckx pushed a commit to branch master
in repository guix.

commit 62da327848311a75723f16642c20d2925919237e
Author: Foo Chuan Wei <chuanwei.foo@hotmail.com>
AuthorDate: Wed May 25 01:44:59 2022 +0000

    gnu: smlnj: Fix use of Ctrl-c in sml REPL.
    
    * gnu/packages/sml.scm (smlnj): Replace INVOKE with SYSTEM which has
    more favourable signal dispositions.
    
    Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
---
 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 1895d8eeee..368abf6cfa 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



reply via email to

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