summaryrefslogtreecommitdiff
path: root/guix/ssh.scm
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/ssh.scm
parent5a5e34e3588e863de0028523ada61041e78cf8c6 (diff)
downloadgnu-guix-4eb0f9ae05a9bf20fb91c49b39bebc687265c5e5.tar
gnu-guix-4eb0f9ae05a9bf20fb91c49b39bebc687265c5e5.tar.gz
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/ssh.scm')
-rw-r--r--guix/ssh.scm42
1 files changed, 27 insertions, 15 deletions
diff --git a/guix/ssh.scm b/guix/ssh.scm
index ac8569298b..4dcc6d38bb 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -41,7 +41,10 @@
send-files
retrieve-files
retrieve-files*
- remote-store-host))
+ remote-store-host
+
+ report-guile-error
+ report-module-error))
;;; Commentary:
;;;
@@ -365,21 +368,9 @@ from REMOTE. When RECURSIVE? is true, retrieve the closure of FILES."
(lambda ()
(close-port port))))
((? eof-object?)
- (raise-error (G_ "failed to start Guile on remote host '~A': exit code ~A")
- (remote-store-host remote)
- (channel-get-exit-status port)
- (=> (G_ "Make sure @command{guile} can be found in
-@code{$PATH} on the remote host. Run @command{ssh ~A guile --version} to
-check.")
- (remote-store-host remote))))
+ (report-guile-error (remote-store-host remote)))
(('module-error . _)
- ;; TRANSLATORS: Leave "Guile" untranslated.
- (raise-error (G_ "Guile modules not found on remote host '~A'")
- (remote-store-host remote)
- (=> (G_ "Make sure @code{GUILE_LOAD_PATH} includes Guix'
-own module directory. Run @command{ssh ~A env | grep GUILE_LOAD_PATH} to
-check.")
- (remote-store-host remote))))
+ (report-module-error (remote-store-host remote)))
(('connection-error file code . _)
(raise-error (G_ "failed to connect to '~A' on remote host '~A': ~a")
file (remote-store-host remote) (strerror code)))
@@ -406,4 +397,25 @@ LOCAL. When RECURSIVE? is true, retrieve the closure of FILES."
#:import (lambda (port)
(import-paths local port))))
+
+;;;
+;;; Error reporting.
+;;;
+
+(define (report-guile-error host)
+ (raise-error (G_ "failed to start Guile on remote host '~A'") host
+ (=> (G_ "Make sure @command{guile} can be found in
+@code{$PATH} on the remote host. Run @command{ssh ~A guile --version} to
+check.")
+ host)))
+
+(define (report-module-error host)
+ "Report an error about missing Guix modules on HOST."
+ ;; TRANSLATORS: Leave "Guile" untranslated.
+ (raise-error (G_ "Guile modules not found on remote host '~A'") host
+ (=> (G_ "Make sure @code{GUILE_LOAD_PATH} includes Guix'
+own module directory. Run @command{ssh ~A env | grep GUILE_LOAD_PATH} to
+check.")
+ host)))
+
;;; ssh.scm ends here