diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-11-25 11:57:56 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-11-25 11:59:54 +0100 |
commit | b9c7ed71b1c4110c3c8580f1bb8050c31324fa6a (patch) | |
tree | c880f2dfc2014a535722a4f011e3739b64f6f097 /gnu/services/dmd.scm | |
parent | 317714979788fee3e702541b39d89c123d7abdef (diff) | |
download | patches-b9c7ed71b1c4110c3c8580f1bb8050c31324fa6a.tar patches-b9c7ed71b1c4110c3c8580f1bb8050c31324fa6a.tar.gz |
services: dmd: Spawn a REPL upon failure to load a service definition.
Fixes <http://bugs.gnu.org/19779>.
Reported by Mark H Weaver <mhw@netris.org>.
* gnu/services/dmd.scm (dmd-configuration-file)[config]: Wrap
'primitive-load' calls in 'call-with-error-handling'.
Diffstat (limited to 'gnu/services/dmd.scm')
-rw-r--r-- | gnu/services/dmd.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/services/dmd.scm b/gnu/services/dmd.scm index 6f70f3d79b..545087acc9 100644 --- a/gnu/services/dmd.scm +++ b/gnu/services/dmd.scm @@ -223,7 +223,13 @@ stored." (set! %load-compiled-path (cons #$compiled %load-compiled-path))) - (apply register-services (map primitive-load '#$files)) + (use-modules (system repl error-handling)) + + ;; Arrange to spawn a REPL if loading one of FILES fails. This is + ;; better than a kernel panic. + (call-with-error-handling + (lambda () + (apply register-services (map primitive-load '#$files)))) ;; guix-daemon 0.6 aborts if 'PATH' is undefined, so work around it. (setenv "PATH" "/run/current-system/profile/bin") |