From a9a685cc0024a4e0dad5d7abd9ca6fb880ae4f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 14 Jun 2018 23:08:08 +0200 Subject: [PATCH] offload: Gracefully handle invalid results from 'machines.scm'. * guix/scripts/offload.scm (build-machines): Check the result of FILE. Ignore it if it's not a list of . --- guix/scripts/offload.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index fb61d7c059..664497bcd5 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -124,7 +124,15 @@ determined." (save-module-excursion (lambda () (set-current-module %user-module) - (primitive-load file)))) + (match (primitive-load file) + (((? build-machine? machines) ...) + machines) + (_ + ;; Instead of crashing, assume the empty list. + (warning (G_ "'~a' did not return a list of build machines; \ +ignoring it~%") + file) + '()))))) (lambda args (match args (('system-error . rest)