From 338154a65451c088f9d14334e64e2bb12db255d7 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Sat, 23 Nov 2024 17:04:05 +0100 Subject: [PATCH] website: Makefile.am: use common guix shell command. This change has several goals: - It reduces code duplication. This also makes it easier to check that all the commands using Guix use the same revision and system, which are supposed to be common to the use of Guix. Unifying the Guix revision between the website and the rest of GNU Boot will be done later on. - It reduce the size of the commands, which also help reduces the indentation and/or increase readability. Guix users typically run "guix shell [arguments] -- [command]", and here we abstract away some GNU Boot specific parts like using Guix 1.4.0 and i686-linux, so it makes sense to abstract them. The --container argument is also specific to GNU Boot as it avoids potentially leaks between the host and the container (which we want to avoid for increased reproducibility across different host distributions), however people used to guix shell will typically expect to select between --container or not. In order to more easily enforce --container and make it clear that we use it, we named the variable GUIX_SHELL_CONTAINER. Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien Bourmault --- website/Makefile.am | 54 ++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/website/Makefile.am b/website/Makefile.am index 26f43c1..20e2b60 100644 --- a/website/Makefile.am +++ b/website/Makefile.am @@ -27,15 +27,17 @@ endif index.html: index.html.tmpl sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@" -if WANT_GUIX -DOT_CMD = \ -guix time-machine \ +GUIX_SHELL_CONTAINER = guix time-machine \ --commit=$(GUIX_REVISION) \ -- \ shell \ - --system=i686-linux \ - --container \ - graphviz \ + --system=i686-linux \ + --container \ + $(SENTINEL) + +if WANT_GUIX +DOT_CMD = $(GUIX_SHELL_CONTAINER) \ + graphviz \ -- \ dot else @@ -74,24 +76,20 @@ site.cfg: site.cfg.tmpl sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@" if WANT_GUIX -BUILD_SH_CMD = \ -guix time-machine \ - --commit=c15a1cd88f80a90437f4b0159f22dfc84b9e6851 \ - -- shell \ - --container \ - --network \ - --emulate-fhs \ - $(GUIX_SHARE_OPTIONS) \ - bash \ - coreutils \ - findutils \ - git \ - grep \ - nss-certs \ - pandoc \ - sed \ - -- \ - ./build.sh +BUILD_SH_CMD = $(GUIX_SHELL_CONTAINER) \ + --network \ + --emulate-fhs \ + $(GUIX_SHARE_OPTIONS) \ + bash \ + coreutils \ + findutils \ + git \ + grep \ + nss-certs \ + pandoc \ + sed \ + -- \ + ./build.sh else BUILD_SH_CMD = ./build.sh endif @@ -100,9 +98,7 @@ build: site.cfg pages/footer.include $(BUILD_SH_CMD) $(BUILD_OPTIONS) if WANT_GUIX -CHECK_SH_CMD = \ -guix shell \ - --container \ +CHECK_SH_CMD = $(GUIX_SHELL_CONTAINER) \ --network \ --emulate-fhs \ bash \ @@ -138,9 +134,7 @@ help: "website.tar.gz # Create a tarball of the website" if WANT_GUIX -SERVE_SH_CMD = \ -guix shell \ - --container \ +SERVE_SH_CMD = $(GUIX_SHELL_CONTAINER) \ --network \ --emulate-fhs \ bash \