GNU bug report logs - #71287
[PATCH] etc: Add explicit ‘--substitute-urls’ in guix-daemon service files.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Fri, 31 May 2024 09:14:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71287 in the body.
You can then email your comments to 71287 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#71287; Package guix-patches. (Fri, 31 May 2024 09:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 31 May 2024 09:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH] etc: Add explicit ‘--substitute-urls’ in guix-daemon service files.
Date: Fri, 31 May 2024 11:12:45 +0200
Having substitute URLs explicitly listed in the service startup file
makes it clearer what should be modified to permanently change the list
of substitute URLs.

* config-daemon.ac: Rename ‘guix_substitute_urls’ to
‘GUIX_SUBSTITUTE_URLS’ and substitute it.
* nix/local.mk (etc/guix-%.service, etc/init.d/guix-daemon)
(etc/guix-%.conf): Substitute it.
* etc/guix-daemon.conf.in, etc/guix-daemon.service.in,
etc/init.d/guix-daemon.in: Add an explicit ‘--substitute-urls’ option.

Change-Id: Ie491b7fab5c42e54dca582801c03805a85de2bf9
---
 config-daemon.ac           |  7 ++++---
 etc/guix-daemon.conf.in    |  2 +-
 etc/guix-daemon.service.in |  3 ++-
 etc/init.d/guix-daemon.in  |  4 +++-
 nix/local.mk               | 17 ++++++++++-------
 5 files changed, 20 insertions(+), 13 deletions(-)

Hello!

The goal is to improve transparency: one will now easily see in
their .service file (or similar) where the URLs are, allowing them
to add new URLs without first having to look up the Guix manual for
the right option and then the systemd (or similar) manual for the
right syntax.

Thoughts?

Ludo’.

diff --git a/config-daemon.ac b/config-daemon.ac
index 9188f93bda8..9854f1d694f 100644
--- a/config-daemon.ac
+++ b/config-daemon.ac
@@ -106,12 +106,13 @@ if test "x$guix_build_daemon" = "xyes"; then
 
   dnl Determine the appropriate default list of substitute URLs (GnuTLS
   dnl is required so we can default to 'https'.)
-  guix_substitute_urls="https://bordeaux.guix.gnu.org https://ci.guix.gnu.org"
+  GUIX_SUBSTITUTE_URLS="https://bordeaux.guix.gnu.org https://ci.guix.gnu.org"
 
   AC_MSG_CHECKING([for default substitute URLs])
-  AC_MSG_RESULT([$guix_substitute_urls])
+  AC_MSG_RESULT([$GUIX_SUBSTITUTE_URLS])
+  AC_SUBST([GUIX_SUBSTITUTE_URLS])
 
-  AC_DEFINE_UNQUOTED([GUIX_SUBSTITUTE_URLS], ["$guix_substitute_urls"],
+  AC_DEFINE_UNQUOTED([GUIX_SUBSTITUTE_URLS], ["$GUIX_SUBSTITUTE_URLS"],
     [Default list of substitute URLs used by 'guix-daemon'.])
 
   dnl Check for Guile-SSH, which is required by 'guix offload'.
diff --git a/etc/guix-daemon.conf.in b/etc/guix-daemon.conf.in
index fb681d1f802..aa368d6272c 100644
--- a/etc/guix-daemon.conf.in
+++ b/etc/guix-daemon.conf.in
@@ -7,4 +7,4 @@ start on runlevel [2345]
 
 stop on runlevel [016]
 
-exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --discover=no
+exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --discover=no --substitute-urls='@GUIX_SUBSTITUTE_URLS@'
diff --git a/etc/guix-daemon.service.in b/etc/guix-daemon.service.in
index 5e75379b5e4..5c43d9b7f1b 100644
--- a/etc/guix-daemon.service.in
+++ b/etc/guix-daemon.service.in
@@ -7,7 +7,8 @@ Description=Build daemon for GNU Guix
 
 [Service]
 ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
-    --build-users-group=guixbuild --discover=no
+    --build-users-group=guixbuild --discover=no \
+    --substitute-urls='@GUIX_SUBSTITUTE_URLS@'
 Environment='GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8
 StandardOutput=journal
 StandardError=journal
diff --git a/etc/init.d/guix-daemon.in b/etc/init.d/guix-daemon.in
index b7d4bb72bbb..913210a5434 100644
--- a/etc/init.d/guix-daemon.in
+++ b/etc/init.d/guix-daemon.in
@@ -36,7 +36,9 @@ start)
       -E LC_ALL=en_US.utf8 \
       -p "/var/run/guix-daemon.pid" \
       @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
-      --build-users-group=guixbuild --discover=no
+      --build-users-group=guixbuild --discover=no \
+      --substitute-urls='@GUIX_SUBSTITUTE_URLS@'
+
   fi
   ;;
 stop)
diff --git a/nix/local.mk b/nix/local.mk
index 44a26dd2c8f..8a2b2b88e86 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+# Copyright © 2012-2016, 2018-2020, 2024 Ludovic Courtès <ludo <at> gnu.org>
 # Copyright © 2016 Mathieu Lirzin <mthl <at> gnu.org>
 # Copyright © 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
 #
@@ -166,8 +166,9 @@ etc/%.mount: etc/%.mount.in	\
 etc/guix-%.service: etc/guix-%.service.in	\
 			 $(top_builddir)/config.status
 	$(AM_V_GEN)$(MKDIR_P) "`dirname $@`";	\
-	$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' <	\
-	       "$<" > "$@.tmp";		\
+	$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' \
+	       -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \
+	       < "$<" > "$@.tmp";		\
 	mv "$@.tmp" "$@"
 
 # The service script for sysvinit.
@@ -177,8 +178,9 @@ nodist_sysvinitservice_DATA = etc/init.d/guix-daemon
 etc/init.d/guix-daemon: etc/init.d/guix-daemon.in	\
 			 $(top_builddir)/config.status
 	$(AM_V_GEN)$(MKDIR_P) "`dirname $@`";	\
-	$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' <	\
-	       "$<" > "$@.tmp";		\
+	$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' \
+	       -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \
+	       < "$<" > "$@.tmp";		\
 	mv "$@.tmp" "$@"
 
 # The service script for openrc.
@@ -199,8 +201,9 @@ nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
 etc/guix-%.conf: etc/guix-%.conf.in	\
 			 $(top_builddir)/config.status
 	$(AM_V_GEN)$(MKDIR_P) "`dirname $@`";	\
-	$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' <	\
-	       "$<" > "$@.tmp";		\
+	$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' \
+	       -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \
+	        < "$<" > "$@.tmp";		\
 	mv "$@.tmp" "$@"
 
 CLEANFILES +=					\

base-commit: cca25a67693bb68a1884a081b415a43fad1e8641
-- 
2.41.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 26 Jun 2024 22:24:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Wed, 26 Jun 2024 22:24:02 GMT) Full text and rfc822 format available.

Message #10 received at 71287-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 71287-done <at> debbugs.gnu.org
Subject: Re: [bug#71287] [PATCH] etc: Add explicit ‘--substitute-urls’ in guix-daemon service files.
Date: Thu, 27 Jun 2024 00:22:58 +0200
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Having substitute URLs explicitly listed in the service startup file
> makes it clearer what should be modified to permanently change the list
> of substitute URLs.
>
> * config-daemon.ac: Rename ‘guix_substitute_urls’ to
> ‘GUIX_SUBSTITUTE_URLS’ and substitute it.
> * nix/local.mk (etc/guix-%.service, etc/init.d/guix-daemon)
> (etc/guix-%.conf): Substitute it.
> * etc/guix-daemon.conf.in, etc/guix-daemon.service.in,
> etc/init.d/guix-daemon.in: Add an explicit ‘--substitute-urls’ option.
>
> Change-Id: Ie491b7fab5c42e54dca582801c03805a85de2bf9

I went ahead and pushed this as
d11b96eb5493231a5a35045505ff8ae8aa746b8e.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Jul 2024 11:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.