From 1742f8e12d163852df09575e03edcd3db73198ee Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 17 Mar 2021 13:14:00 -0400 Subject: guix: Add early health check for guix-daemon --- contrib/guix/guix-build | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'contrib/guix') diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index 6c0930df18..7f74524ddc 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -130,6 +130,33 @@ for host in $HOSTS; do esac done +################ +# Check that we can connect to the guix-daemon +################ + +cat << EOF +Checking that we can connect to the guix-daemon... + +Hint: If this hangs, you may want to try turning your guix-daemon off and on + again. + +EOF +if ! guix gc --list-failures > /dev/null; then +cat << EOF + +ERR: Failed to connect to the guix-daemon, please ensure that one is running and + reachable. +EOF +exit 1 +fi + +# Developer note: we could use `guix repl` for this check and run: +# +# (import (guix store)) (close-connection (open-connection)) +# +# However, the internal API is likely to change more than the CLI invocation + + ######### # SETUP # ######### -- cgit v1.2.3