summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-01-12 23:16:53 +0100
committerLudovic Courtès <ludo@gnu.org>2018-01-12 23:41:15 +0100
commit4eb0f9ae05a9bf20fb91c49b39bebc687265c5e5 (patch)
tree2e7eabef24a6e87463a14a70ef0e56fda8941815 /guix/scripts
parent5a5e34e3588e863de0028523ada61041e78cf8c6 (diff)
offload: 'test' reports Guile and module errors more nicely.
Fixes <https://bugs.gnu.org/26008>. Reported by Myles English <mylesenglish@gmail.com>. * guix/ssh.scm (retrieve-files*): Move error reporting to... (report-guile-error, report-module-error): ... here. New procedures. * guix/scripts/offload.scm (assert-node-repl): Use 'report-guile-error'. (assert-node-has-guix): Explicitly check for 'use-modules' first. Use 'report-module-error'.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/offload.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index aaad992289..d011520885 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -542,8 +542,7 @@ slot (which must later be released with 'release-build-slot'), or #f and #f."
"Bail out if NODE is not running Guile."
(match (node-guile-version node)
(#f
- (leave (G_ "Guile could not be started on '~a'~%")
- name))
+ (report-guile-error name))
((? string? version)
;; Note: The version string already contains the word "Guile".
(info (G_ "'~a' is running ~a~%")
@@ -556,6 +555,17 @@ slot (which must later be released with 'release-build-slot'), or #f and #f."
(match (node-eval node
'(begin
(use-modules (guix))
+ (and add-text-to-store 'alright)))
+ ('alright #t)
+ (_ (report-module-error name))))
+ (lambda (key . args)
+ (report-module-error name)))
+
+ (catch 'node-repl-error
+ (lambda ()
+ (match (node-eval node
+ '(begin
+ (use-modules (guix))
(with-store store
(add-text-to-store store "test"
"Hello, build machine!"))))
@@ -563,7 +573,7 @@ slot (which must later be released with 'release-build-slot'), or #f and #f."
(info (G_ "Guix is usable on '~a' (test returned ~s)~%")
name str))
(x
- (leave (G_ "failed to use Guix module on '~a' (test returned ~s)~%")
+ (leave (G_ "failed to talk to guix-daemon on '~a' (test returned ~s)~%")
name x))))
(lambda (key . args)
(leave (G_ "remove evaluation on '~a' failed:~{ ~s~}~%")