offload: 'test' gracefully handles 'node-repl-error'.

Fixes <https://bugs.gnu.org/28057>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/scripts/offload.scm (assert-node-has-guix): Catch
'node-repl-error' and call 'leave'.
This commit is contained in:
Ludovic Courtès 2018-01-12 22:51:41 +01:00
parent 0e3c8528af
commit 5a5e34e358
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 17 additions and 12 deletions

View File

@ -551,6 +551,8 @@ slot (which must later be released with 'release-build-slot'), or #f and #f."
(define (assert-node-has-guix node name) (define (assert-node-has-guix node name)
"Bail out if NODE lacks the (guix) module, or if its daemon is not running." "Bail out if NODE lacks the (guix) module, or if its daemon is not running."
(catch 'node-repl-error
(lambda ()
(match (node-eval node (match (node-eval node
'(begin '(begin
(use-modules (guix)) (use-modules (guix))
@ -563,6 +565,9 @@ slot (which must later be released with 'release-build-slot'), or #f and #f."
(x (x
(leave (G_ "failed to use Guix module on '~a' (test returned ~s)~%") (leave (G_ "failed to use Guix module on '~a' (test returned ~s)~%")
name x)))) name x))))
(lambda (key . args)
(leave (G_ "remove evaluation on '~a' failed:~{ ~s~}~%")
args))))
(define %random-state (define %random-state
(delay (delay