aboutsummaryrefslogtreecommitdiff
path: root/contrib/guix
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2021-03-17 13:14:00 -0400
committerCarl Dong <contact@carldong.me>2021-04-05 11:00:39 -0400
commit1742f8e12d163852df09575e03edcd3db73198ee (patch)
treeb149197696feb6f02698f57ee4594e8bb36faff5 /contrib/guix
parentc1ae726a13ecfa5e7e9fdc3030a8110b8bb263f8 (diff)
downloadbitcoin-1742f8e12d163852df09575e03edcd3db73198ee.tar.xz
guix: Add early health check for guix-daemon
Diffstat (limited to 'contrib/guix')
-rwxr-xr-xcontrib/guix/guix-build27
1 files changed, 27 insertions, 0 deletions
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 #
#########