GNU logs - #71038, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 0/2] Enable specifying the available builtin builders.
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 18 May 2024 13:13:01 +0000
Resent-Message-ID: <handler.71038.B.171603793412673 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.171603793412673
          (code B ref -1); Sat, 18 May 2024 13:13:01 +0000
Received: (at submit) by debbugs.gnu.org; 18 May 2024 13:12:14 +0000
Received: from localhost ([127.0.0.1]:33409 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s8JrC-0003IL-0g
	for submit <at> debbugs.gnu.org; Sat, 18 May 2024 09:12:14 -0400
Received: from lists.gnu.org ([209.51.188.17]:53410)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1s8JrA-0003IF-Ls
 for submit <at> debbugs.gnu.org; Sat, 18 May 2024 09:12:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1s8Jr6-0007iC-Qg
 for guix-patches@HIDDEN; Sat, 18 May 2024 09:12:08 -0400
Received: from mira.cbaines.net ([212.71.252.8])
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <mail@HIDDEN>) id 1s8Jr0-0003mb-UU
 for guix-patches@HIDDEN; Sat, 18 May 2024 09:12:08 -0400
Received: from localhost (unknown [89.207.171.92])
 by mira.cbaines.net (Postfix) with ESMTPSA id 750FE27BBE2
 for <guix-patches@HIDDEN>; Sat, 18 May 2024 14:12:00 +0100 (BST)
Received: from felis (localhost [127.0.0.1])
 by localhost (OpenSMTPD) with ESMTP id 4c30137f
 for <guix-patches@HIDDEN>; Sat, 18 May 2024 13:11:56 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
User-Agent: mu4e 1.12.2; emacs 29.3
Date: Sat, 18 May 2024 14:11:56 +0100
Message-ID: <87y187b6xv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@HIDDEN;
 helo=mira.cbaines.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

This will enable addressing [11 by having the data service specify
'("download") for the builtin builders.

1: https://issues.guix.gnu.org/67250


Christopher Baines (2):
  guix: store: Enable specifying the available builtin builders.
  guix: channels: Enable specifiying available builtin builders.

 build-aux/build-self.scm | 28 ++++++++++++++++++--------
 guix/channels.scm        | 43 +++++++++++++++++++++++++++++-----------
 guix/store.scm           | 13 ++++++++----
 3 files changed, 60 insertions(+), 24 deletions(-)


base-commit: 0846eaecd45783bf40e8dc67b0c16f71068524b7
=2D-=20
2.41.0

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZIqRxfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XdkqhAAiSoK89xGVo8caiP6YdEi+YmUOH08gEmi
C6NajcBASwFCeOI6fHxUpeaK4kCJ4DE7AhTBFcOwEgcfo6xELL/LiIdhEwvWi9hy
P4cGCBP/VyN/Vbthaa2LOsncr81dBqrtyrjBugTi6nmy4Ri2TckzTekN9gZ+XO8E
4vHgDghaKtiBHYR6insGzie9JbGSoziiUCq/2qe49DJy4cZEqzuaZe/5+n5uAlRc
UE062bgBwWjE+SdAJu7UDtu0peiGhxeuoBdqfL92vBQYpP75UtuyRymRCdbX1FBB
r5Quq9lfXjLHNd2nAfkSU7ghrjNfGUSwR+1vr4vPni43nOjoJlm5OEihPU8ZhwIF
dq6fZAzG0RhYbOmWIAjt3KLqg+EgNptIkLerram9fBoPg4+C2BOC/0E0Dt2qheWa
B1fFkdLK/M3Q86b2UsevyXq/Wrsbj0g8KlzNDz86Zu9adIzKplu5cOUUEeG+WPau
Dh9K7+6BZ9HoOov4ckSU7F1P+OkIY/B4MNJpLw7Uy9gLFfL5vAPHnTbuNOlXz0PJ
vvXQfUiTjVs38wg6Fph2UU8+WHGjBONFfsWyQMF9un8xHoRWo1xbLoMqllAguAjZ
Nahn+jWuW25D3o6cXbaeoSoarY6lFs8EKgUgSqMVve0yaXud45YlEXGa03vY6gAS
d5EaryoyYoQ=
=OOIg
-----END PGP SIGNATURE-----
--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Christopher Baines <mail@HIDDEN>
Subject: bug#71038: Acknowledgement ([PATCH 0/2] Enable specifying the
 available builtin builders.)
Message-ID: <handler.71038.B.171603793412673.ack <at> debbugs.gnu.org>
References: <87y187b6xv.fsf@HIDDEN>
X-Gnu-PR-Message: ack 71038
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 71038 <at> debbugs.gnu.org
Date: Sat, 18 May 2024 13:13:01 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 71038 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
71038: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71038
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 1/2] guix: store: Enable specifying the available builtin builders.
References: <87y187b6xv.fsf@HIDDEN>
In-Reply-To: <87y187b6xv.fsf@HIDDEN>
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Sat, 18 May 2024 13:20:02 +0000
Resent-Message-ID: <handler.71038.B71038.171603838423679 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.171603838423679
          (code B ref 71038); Sat, 18 May 2024 13:20:02 +0000
Received: (at 71038) by debbugs.gnu.org; 18 May 2024 13:19:44 +0000
Received: from localhost ([127.0.0.1]:33447 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s8JyR-00069r-IK
	for submit <at> debbugs.gnu.org; Sat, 18 May 2024 09:19:43 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43556)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1s8JyQ-00069f-6r
 for 71038 <at> debbugs.gnu.org; Sat, 18 May 2024 09:19:42 -0400
Received: from localhost (unknown [89.207.171.92])
 by mira.cbaines.net (Postfix) with ESMTPSA id 490D227BBE2
 for <71038 <at> debbugs.gnu.org>; Sat, 18 May 2024 14:19:36 +0100 (BST)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id c02c102f
 for <71038 <at> debbugs.gnu.org>; Sat, 18 May 2024 13:19:35 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
Date: Sat, 18 May 2024 14:19:34 +0100
Message-ID: <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

To open-connection and port->connection.  This overrides the discovered
builtin builders that the daemon says it provides.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

* guix/store.scm (open-connection, port->connection): Accept
 #:assume-available-builtin-builders and use this instead of
%built-in-builders.

Fixes: <https://issues.guix.gnu.org/67250>.

Change-Id: I45d58ab93b6d276d280552858fc81ebc2b58828a
---
 guix/store.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index 58ddaa8d15..0c734cdca7 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -571,7 +571,7 @@ (define* (connect-to-daemon uri #:key non-blocking?)
 
 (define* (open-connection #:optional (uri (%daemon-socket-uri))
                           #:key port (reserve-space? #t) cpu-affinity
-                          non-blocking?)
+                          non-blocking? assume-available-builtin-builders)
   "Connect to the daemon at URI (a string), or, if PORT is not #f, use it as
 the I/O port over which to communicate to a build daemon.
 
@@ -616,7 +616,9 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
           (when (>= (protocol-minor v) 11)
             (write-int (if reserve-space? 1 0) port))
           (letrec* ((built-in-builders
-                     (delay (%built-in-builders conn)))
+                     (if assume-available-builtin-builders
+                         (delay assume-available-builtin-builders)
+                         (delay (%built-in-builders conn))))
                     (caches
                      (make-vector
                       (atomic-box-ref %store-connection-caches)
@@ -635,7 +637,8 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
             conn))))))
 
 (define* (port->connection port
-                           #:key (version %protocol-version))
+                           #:key (version %protocol-version)
+                           assume-available-builtin-builders)
   "Assimilate PORT, an input/output port, and return a connection to the
 daemon, assuming the given protocol VERSION.
 
@@ -654,7 +657,9 @@ (define* (port->connection port
                               (make-vector
                                (atomic-box-ref %store-connection-caches)
                                vlist-null)
-                              (delay (%built-in-builders connection))))
+                              (if assume-available-builtin-builders
+                                  (delay assume-available-builtin-builders)
+                                  (delay (%built-in-builders connection)))))
 
     connection))
 

base-commit: 0846eaecd45783bf40e8dc67b0c16f71068524b7
-- 
2.41.0





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 2/2] guix: channels: Enable specifiying available builtin builders.
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Sat, 18 May 2024 13:20:02 +0000
Resent-Message-ID: <handler.71038.B71038.171603838823686 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.171603838823686
          (code B ref 71038); Sat, 18 May 2024 13:20:02 +0000
Received: (at 71038) by debbugs.gnu.org; 18 May 2024 13:19:48 +0000
Received: from localhost ([127.0.0.1]:33449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s8JyV-00069y-Um
	for submit <at> debbugs.gnu.org; Sat, 18 May 2024 09:19:48 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43558)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1s8JyQ-00069g-OB
 for 71038 <at> debbugs.gnu.org; Sat, 18 May 2024 09:19:43 -0400
Received: from localhost (unknown [89.207.171.92])
 by mira.cbaines.net (Postfix) with ESMTPSA id 7257B27BBE9
 for <71038 <at> debbugs.gnu.org>; Sat, 18 May 2024 14:19:38 +0100 (BST)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id ba9ae70a
 for <71038 <at> debbugs.gnu.org>; Sat, 18 May 2024 13:19:36 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
Date: Sat, 18 May 2024 14:19:35 +0100
Message-ID: <3724435f5b2e86be53ffba5bffcbfdf493b48e5c.1716038375.git.mail@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
References: <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

When computing channel instance derivations.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

Fixes: <https://issues.guix.gnu.org/67250>.

* build-aux/build-self.scm (build-program): Accept
 #:assume-available-builtin-builders and pass along to port->connection or
open-connection as approriate.
(build): Accept and pass on #:assume-available-builtin-builders.
* guix/channels.scm (build-from-source, build-channel-instance,
channel-instance-derivations, channel-instances->manifest,
channel-instances->derivation): Accept and pass on
 #:assume-available-builtin-builders.

Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea
---
 build-aux/build-self.scm | 28 ++++++++++++++++++--------
 guix/channels.scm        | 43 +++++++++++++++++++++++++++++-----------
 2 files changed, 51 insertions(+), 20 deletions(-)

diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index 02822a2ee8..7afb13c1e4 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -241,7 +241,8 @@ (define guile-gcrypt
 
 (define* (build-program source version
                         #:optional (guile-version (effective-version))
-                        #:key (pull-version 0) (channel-metadata #f))
+                        #:key (pull-version 0) (channel-metadata #f)
+                        assume-available-builtin-builders)
   "Return a program that computes the derivation to build Guix from SOURCE."
   (define select?
     ;; Select every module but (guix config) and non-Guix modules.
@@ -331,11 +332,20 @@ (define* (build-program source version
                          ;; case, attempt to open a new connection.
                          (let* ((proto (string->number protocol-version))
                                 (store (if (integer? proto)
-                                           (port->connection (duplicate-port
-                                                              (current-input-port)
-                                                              "w+0")
-                                                             #:version proto)
-                                           (open-connection)))
+                                           (port->connection
+                                            (duplicate-port
+                                             (current-input-port)
+                                             "w+0")
+                                            #:version proto
+                                            #$@(if assume-available-builtin-builders
+                                                   #~(#:assume-available-builtin-builders
+                                                      '(#$@assume-available-builtin-builders))
+                                                   '()))
+                                           (open-connection
+                                            #$@(if assume-available-builtin-builders
+                                                   #~(#:assume-available-builtin-builders
+                                                      '(#$@assume-available-builtin-builders))
+                                                   '()))))
                                 (sock  (socket AF_UNIX SOCK_STREAM 0)))
                            ;; Connect to BUILD-OUTPUT and send it the raw
                            ;; build output.
@@ -406,7 +416,7 @@ (define* (build source
                 (guile-version (if (> pull-version 0)
                                    "3.0"
                                    (effective-version)))
-
+                assume-available-builtin-builders
                 #:allow-other-keys
                 #:rest rest)
   "Return a derivation that unpacks SOURCE into STORE and compiles Scheme
@@ -415,7 +425,9 @@ (define* (build source
   ;; SOURCE.
   (mlet %store-monad ((build  (build-program source version guile-version
                                              #:channel-metadata channel-metadata
-                                             #:pull-version pull-version))
+                                             #:pull-version pull-version
+                                             #:assume-available-builtin-builders
+                                             assume-available-builtin-builders))
                       (system (if system (return system) (current-system)))
                       (home -> (getenv "HOME"))
 
diff --git a/guix/channels.scm b/guix/channels.scm
index 0d7bc541cc..6469d08bb9 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -704,7 +704,8 @@ (define (with-trivial-build-handler mvalue)
               store))))
 
 (define* (build-from-source instance
-                            #:key core verbose? (dependencies '()) system)
+                            #:key core verbose? (dependencies '()) system
+                            assume-available-builtin-builders)
   "Return a derivation to build Guix from INSTANCE, using the self-build
 script contained therein.  When CORE is true, build package modules under
 SOURCE using CORE, an instance of Guix.  By default, build for the current
@@ -750,20 +751,25 @@ (define* (build-from-source instance
                   #:verbose? verbose? #:version commit
                   #:system system
                   #:channel-metadata (channel-instance->sexp instance)
-                  #:pull-version %pull-version))))
+                  #:pull-version %pull-version
+                  #:assume-available-builtin-builders
+                  assume-available-builtin-builders))))
 
       ;; Build a set of modules that extend Guix using the standard method.
       (standard-module-derivation name source core dependencies)))
 
 (define* (build-channel-instance instance system
-                                 #:optional core (dependencies '()))
+                                 #:optional core (dependencies '())
+                                 #:key assume-available-builtin-builders)
   "Return, as a monadic value, the derivation for INSTANCE, a channel
 instance, for SYSTEM.  DEPENDENCIES is a list of extensions providing Guile
 modules that INSTANCE depends on."
   (build-from-source instance
                      #:core core
                      #:dependencies dependencies
-                     #:system system))
+                     #:system system
+                     #:assume-available-builtin-builders
+                     assume-available-builtin-builders))
 
 (define (resolve-dependencies instances)
   "Return a procedure that, given one of the elements of INSTANCES, returns
@@ -793,7 +799,8 @@ (define (resolve-dependencies instances)
   (lambda (instance)
     (vhash-foldq* cons '() instance edges)))
 
-(define* (channel-instance-derivations instances #:key system)
+(define* (channel-instance-derivations instances #:key system
+                                       assume-available-builtin-builders)
   "Return the list of derivations to build INSTANCES, in the same order as
 INSTANCES.  Build for the current system by default, or SYSTEM if specified."
   (define core-instance
@@ -809,11 +816,15 @@ (define* (channel-instance-derivations instances #:key system)
   (define (instance->derivation instance)
     (mlet %store-monad ((system (if system (return system) (current-system))))
       (mcached (if (eq? instance core-instance)
-                   (build-channel-instance instance system)
+                   (build-channel-instance instance system
+                                           #:assume-available-builtin-builders
+                                           assume-available-builtin-builders)
                    (mlet %store-monad ((core (instance->derivation core-instance))
                                        (deps (mapm %store-monad instance->derivation
                                                    (edges instance))))
-                     (build-channel-instance instance system core deps)))
+                     (build-channel-instance instance system core deps
+                                             #:assume-available-builtin-builders
+                                             assume-available-builtin-builders)))
                instance
                system)))
 
@@ -915,7 +926,8 @@ (define (channel-instance->sexp instance)
                     intro))))))
             '()))))
 
-(define* (channel-instances->manifest instances #:key system)
+(define* (channel-instances->manifest instances #:key system
+                                      assume-available-builtin-builders)
   "Return a profile manifest with entries for all of INSTANCES, a list of
 channel instances.  By default, build for the current system, or SYSTEM if
 specified."
@@ -934,8 +946,11 @@ (define* (channel-instances->manifest instances #:key system)
         (properties
          `((source ,(channel-instance->sexp instance)))))))
 
-  (mlet* %store-monad ((derivations (channel-instance-derivations instances
-                                                                  #:system system))
+  (mlet* %store-monad ((derivations (channel-instance-derivations
+                                     instances
+                                     #:system system
+                                     #:assume-available-builtin-builders
+                                     assume-available-builtin-builders))
                        (entries ->  (map instance->entry instances derivations)))
     (return (manifest entries))))
 
@@ -990,10 +1005,14 @@ (define %channel-profile-hooks
   ;; The default channel profile hooks.
   (cons package-cache-file %default-profile-hooks))
 
-(define (channel-instances->derivation instances)
+(define* (channel-instances->derivation instances
+                                        #:key assume-available-builtin-builders)
   "Return the derivation of the profile containing INSTANCES, a list of
 channel instances."
-  (mlet %store-monad ((manifest (channel-instances->manifest instances)))
+  (mlet %store-monad ((manifest (channel-instances->manifest
+                                 instances
+                                 #:assume-available-builtin-builders
+                                 assume-available-builtin-builders)))
     ;; Emit a profile in format version so that, if INSTANCES denotes an old
     ;; Guix, it can still read that profile, for instance for the purposes of
     ;; 'guix describe'.
-- 
2.41.0





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 1/2] guix: store: Enable specifying the available builtin builders.
Resent-From: Simon Tournier <zimon.toutoune@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 22 May 2024 15:21:02 +0000
Resent-Message-ID: <handler.71038.B71038.171639125716431 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Christopher Baines <mail@HIDDEN>, 71038 <at> debbugs.gnu.org
Cc: Josselin Poiret <dev@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.171639125716431
          (code B ref 71038); Wed, 22 May 2024 15:21:02 +0000
Received: (at 71038) by debbugs.gnu.org; 22 May 2024 15:20:57 +0000
Received: from localhost ([127.0.0.1]:56597 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s9nlx-0004Gt-76
	for submit <at> debbugs.gnu.org; Wed, 22 May 2024 11:20:57 -0400
Received: from mail-wr1-f46.google.com ([209.85.221.46]:38745)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1s9nls-0004Gi-Nb
 for 71038 <at> debbugs.gnu.org; Wed, 22 May 2024 11:20:56 -0400
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-354ba9ae540so149420f8f.3
 for <71038 <at> debbugs.gnu.org>; Wed, 22 May 2024 08:20:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716391181; x=1716995981; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=Xjol8P6vZruFFv8LI2MpmiRQjXr1t6SpeMeCykPNSzY=;
 b=dVthGkHrdxjdunrgD83D7yXncbIcPDaxw3GEPwnQk92Iox+JNITG7ge19XnpdAF7rt
 kLYJ6aeV7qVCunHPdfPupxzzbpgUQQpgdLOKfEpZ9r7uKdB9N9yJbmZO7dJoZZKbPAbI
 /Ckn/+YCfTb8FCmM5jy/ZytVkxqodWH1xpTU8qUkvZCsl3bUbvmTBQeKZnMUqN05YMM0
 /toDQw+zrtK0L7dePcrrAOjsvUGzDVxemuRzf0Qo893V0ZsKw4CDDWeflNg2hwlVYUxh
 4cOlzuKl7rzXwYWXMi9OF7UmXKolxlwEPmFaJYs7MUM0PkV36r7g5lYTt5ECSdsAK7/t
 3k+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716391181; x=1716995981;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=Xjol8P6vZruFFv8LI2MpmiRQjXr1t6SpeMeCykPNSzY=;
 b=rZlwV342mQE4KCqZkmXaXFaY2mZYumQEXVxBj/XEmvgyLKf/1SA+npzrU3DdCepMqu
 fnvsCG6hGhf8ajgXjjcMWJdSMbBC588yVriMsqM8+cSz56tr8I+kj7HmVMa/+xMlscL1
 RYnLLeVJfz+7o+ILywwJe7rLuhuAocQY942kOXdxtdDtadvGRu3h+C/Kdzr3WHCmf/5M
 xhhfqNvdJ10I46gAjZu9mehP30page5Wvc+ITg51230JsAEdV24NJ59I2ubmBijeuSPc
 BFuaZTXgmCzHxGPVINbgPKXibVQGmzGR/jdHCYA0GwKf2fGAaFfh9gq7uLoGnDLDC91p
 Us+A==
X-Forwarded-Encrypted: i=1;
 AJvYcCW4VQP7f79CQ6GcB0N1gZ5Qqn2ELrg7/styPFtlWIt0T86pIJMqNWMYUn6Q0Fmt5LBQDBPkLXVKNx+kJIl5HCef7ar3Ilk=
X-Gm-Message-State: AOJu0YyZ9lnOVIoCV+RQEWLYyK6bGg7hCbGQpVam6zMHBi4rO43YX/Cj
 n/d9oAaJR7ptK1No69h4EyMl0a4doz8aITATmadELLf9JLLU1UDc
X-Google-Smtp-Source: AGHT+IE0eoTAtu38wzsqei4bfE2bhlcOLMFg7Yi8ZjPglX+bRJakIWFJ0sxcxAIjnCyr4Cazd/BkkQ==
X-Received: by 2002:a05:600c:3544:b0:41b:e83e:8bb with SMTP id
 5b1f17b1804b1-420fd376c84mr17464795e9.3.1716391181116; 
 Wed, 22 May 2024 08:19:41 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:c865:f7ad:a866:6eca])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-420149b1c24sm394437145e9.41.2024.05.22.08.19.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 May 2024 08:19:40 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
In-Reply-To: <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
References: <87y187b6xv.fsf@HIDDEN>
 <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
Date: Wed, 22 May 2024 12:58:12 +0200
Message-ID: <87a5ki3ygr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.1 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi Chris, On sam., 18 mai 2024 at 14:19, Christopher Baines
 wrote: > diff --git a/guix/store.scm b/guix/store.scm > index
 58ddaa8d15..0c734cdca7
 100644 > --- a/guix/store.scm > +++ b/guix/store.scm > @@ -571,7 +571,7 @@
 (define* (connect-to-daemon uri #:key non-block [...] 
 Content analysis details:   (1.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (zimon.toutoune[at]gmail.com)
 1.1 DATE_IN_PAST_03_06     Date: is 3 to 6 hours before Received: date
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.221.46 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.221.46 listed in list.dnswl.org]
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.1 (/)

Hi Chris,

On sam., 18 mai 2024 at 14:19, Christopher Baines <mail@HIDDEN> wrote:

> diff --git a/guix/store.scm b/guix/store.scm
> index 58ddaa8d15..0c734cdca7 100644
> --- a/guix/store.scm
> +++ b/guix/store.scm
> @@ -571,7 +571,7 @@ (define* (connect-to-daemon uri #:key non-blocking?)
>
>  (define* (open-connection #:optional (uri (%daemon-socket-uri))
>                            #:key port (reserve-space? #t) cpu-affinity
> -                          non-blocking?)
> +                          non-blocking? assume-available-builtin-builders)

Why add the variable %assume-available-builtin-builders and default to
it?

Something like:

--8<---------------cut here---------------start------------->8---
(define %assume-available-builtin-builders
  "List of builtin builders supported by the builder Guix daemon."
  (list "download" "git-download"))

(define* (open-connection #:optional (uri (%daemon-socket-uri))
                          #:key port (reserve-space? #t) cpu-affinity
                          non-blocking?)
                          non-blocking?
                          (assume-available-builtin-builders %assume-available-builtin-builders))
--8<---------------cut here---------------end--------------->8---

And then default to this %assume-available-builtin-builders elsewhere in
[PATCH 2/2].  IMHO, it changes almost nothing but it would help to know
(document) what to pass as argument.

Cheers,
simon




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 1/2] guix: store: Enable specifying the available builtin builders.
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sun, 26 May 2024 08:12:02 +0000
Resent-Message-ID: <handler.71038.B71038.171671108229719 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Simon Tournier <zimon.toutoune@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>, 71038 <at> debbugs.gnu.org
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.171671108229719
          (code B ref 71038); Sun, 26 May 2024 08:12:02 +0000
Received: (at 71038) by debbugs.gnu.org; 26 May 2024 08:11:22 +0000
Received: from localhost ([127.0.0.1]:38288 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sB8yQ-0007jH-EA
	for submit <at> debbugs.gnu.org; Sun, 26 May 2024 04:11:22 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43580)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1sB8yO-0007j9-Ox
 for 71038 <at> debbugs.gnu.org; Sun, 26 May 2024 04:11:21 -0400
Received: from localhost (unknown [212.132.255.10])
 by mira.cbaines.net (Postfix) with ESMTPSA id 8B5DD27BBE2;
 Sun, 26 May 2024 09:10:41 +0100 (BST)
Received: from felis (localhost.lan [127.0.0.1])
 by localhost (OpenSMTPD) with ESMTP id badc66fd;
 Sun, 26 May 2024 08:10:40 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
In-Reply-To: <87a5ki3ygr.fsf@HIDDEN> (Simon Tournier's message of "Wed, 22
 May 2024 12:58:12 +0200")
References: <87y187b6xv.fsf@HIDDEN>
 <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
 <87a5ki3ygr.fsf@HIDDEN>
User-Agent: mu4e 1.12.2; emacs 29.3
Date: Sun, 26 May 2024 09:10:40 +0100
Message-ID: <87sey5f0xr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Simon Tournier <zimon.toutoune@HIDDEN> writes:

> On sam., 18 mai 2024 at 14:19, Christopher Baines <mail@HIDDEN> wrote:
>
>> diff --git a/guix/store.scm b/guix/store.scm
>> index 58ddaa8d15..0c734cdca7 100644
>> --- a/guix/store.scm
>> +++ b/guix/store.scm
>> @@ -571,7 +571,7 @@ (define* (connect-to-daemon uri #:key non-blocking?)
>>
>>  (define* (open-connection #:optional (uri (%daemon-socket-uri))
>>                            #:key port (reserve-space? #t) cpu-affinity
>> -                          non-blocking?)
>> +                          non-blocking? assume-available-builtin-builders)
>
> Why add the variable %assume-available-builtin-builders and default to
> it?
>
> Something like:
>
> --8<---------------cut here---------------start------------->8---
> (define %assume-available-builtin-builders
>   "List of builtin builders supported by the builder Guix daemon."
>   (list "download" "git-download"))
>
> (define* (open-connection #:optional (uri (%daemon-socket-uri))
>                           #:key port (reserve-space? #t) cpu-affinity
>                           non-blocking?)
>                           non-blocking?
>                           (assume-available-builtin-builders %assume-available-builtin-builders))
> --8<---------------cut here---------------end--------------->8---
>
> And then default to this %assume-available-builtin-builders elsewhere in
> [PATCH 2/2].  IMHO, it changes almost nothing but it would help to know
> (document) what to pass as argument.

I think it's sensible to not use a fixed list by default, but check what
the daemon supports.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZS7oBfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xf++A/+MLo6Soaxrz5sb8pCizVsRG9iCNpHwOZx
pFyDWiOhN2QnbFY5GBn/duq3+a4oDvEhRz15u430jWFw0yolHhv+r/ylydYKvyGF
qyJ1MZ+oACzk7wHF7JcER5TsAoJHrOqhgAUfXwdwFJNxCeKlsTTuF+al3Deyko5G
/nxk/DkXSsTPLA2U7blalytkyICdj9Gu4LOOzRphXNNiw5u1+DDN++ZkrQ+ngGyl
WprBhBnvRxHu9Rk/SQftFXLlpMmoRMLuYC2IWwpwqGB1/BeDv91GhcOHyiuGbajS
tV+10kYigehOknNJhA5V0amtjWTZ61bZ9nzeNdpKBth1gg+phSuGi431s1fz29+A
P3oHQgh3o94Mw5gVkaoIGe9rzChc5PFyAASh/5/1JaPFnAEn7ce3oYyBsNPFBmWs
wvUG1kOt3AQ0r8Eb15k2ROx5rmLxMVVSP9xk2JcN8uA/bpwaXUhNv3IJkQoKpWqd
YwiQ153TV6FvsIdL3gfafOnwNm9ut+6SCD3wwZdcVz6oXn29FDOHoqb3ZWgigs1F
JcRJr7VnSiSSHTmpttw0aJViQUuackrEkQpEFtL7JFYX50z30Q+ezkC0EtH5F1Cv
VbxVZFwH0TyImSVVRd+4rZdJh07uZlv+ZTPaSFyv48HkPsVX6p3IP5sL2xUwWbVK
9XLcduTy2Eg=
=K8Wp
-----END PGP SIGNATURE-----
--=-=-=--




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 1/2] guix: store: Enable specifying the available builtin builders.
Resent-From: Simon Tournier <zimon.toutoune@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 31 May 2024 16:38:03 +0000
Resent-Message-ID: <handler.71038.B71038.17171734223905 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Christopher Baines <mail@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>, 71038 <at> debbugs.gnu.org
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.17171734223905
          (code B ref 71038); Fri, 31 May 2024 16:38:03 +0000
Received: (at 71038) by debbugs.gnu.org; 31 May 2024 16:37:02 +0000
Received: from localhost ([127.0.0.1]:55242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sD5FV-00010k-MI
	for submit <at> debbugs.gnu.org; Fri, 31 May 2024 12:37:02 -0400
Received: from mail-wm1-f44.google.com ([209.85.128.44]:38349)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1sD5FT-00010P-Tf
 for 71038 <at> debbugs.gnu.org; Fri, 31 May 2024 12:37:01 -0400
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-42129d4e7bdso1461785e9.1
 for <71038 <at> debbugs.gnu.org>; Fri, 31 May 2024 09:36:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717173343; x=1717778143; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=2s8RGNclctcIBtWJLPB7LaxAbO9RbJk2pOFDn2shwjE=;
 b=auVVr8ucHPWjd5atrh2wbGW+ft3+DJQnmCxdqYOxCGxpMI1ZJN9WhxGqmgSr0hmspy
 NwMoCmIORB9uN1IGFW81k3tOeuticIicHpngddPVat+4RyEul5XMIfJdIfyB7IuHok4h
 rM53dpk0wEkG6+xtn51gWhuIPSSP+S1fLzfOCgoAwLWZzmTh3BMC/k7UZGDQ8GvUFXoN
 4UgMSdNORsHKax1eq4JN8BCBwY5AVIXjPS/NNdRxK5BKM3AVv8Jti9rdgHm8tpK9Dxry
 OTTAJmy5O0UZ9aY9mBDB7rcLA9W94dLW9Og1tGNLiqsg4LFllJlXETIORGUXWdWnrUXe
 YQ7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717173343; x=1717778143;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=2s8RGNclctcIBtWJLPB7LaxAbO9RbJk2pOFDn2shwjE=;
 b=ZuVtdARrENEFnj3q8KBEWFGTagNjYhzO2QPcrP1JWW5ob4kdDeAtXPH/1XRkjodATS
 ousuJnanu7umB8IGZKsosW3q13fbFXio5QAf9j/m6Gn5rEfR835MJluG2ZsGy/GwbT/h
 OGo5j3OV2GVyp3KUlwP1OBysX2c8WuvT65aUyEp6w/R7oRziginYCxIswSVVSegPuq8O
 xwQQP/h7s6Og0lKombEUCxjcc2mSvFWFl18HywcJcJNeVqtUSwRIv26xkuM9/Usy4cM7
 ZqcmBAblGzYCtmM0xR06/uzCldYxJF8EvJ5CkDTjSUUY+HdA/wXaBmanH2clC2/1HvBU
 CRkA==
X-Forwarded-Encrypted: i=1;
 AJvYcCXpgzmV5wl+SpiXet2wWScnA/sik6jzts4o+gZMT6Yp8K5sSXESMh287MYRFCksdaRap7y8gD8427b68MyF8fO6rCczUR4=
X-Gm-Message-State: AOJu0YzSCDZ/AfrqnrhRn/fF4PKdjEpLxgY8mbhHSkXZUtSWvdOG8dnH
 RUdB2VDGgG4z3yEbhsrKdGxdio2KVlcIjo/6grxmxXbsDaB9o2aoDMq7ww==
X-Google-Smtp-Source: AGHT+IEuafFuhtukyUz1PKmxYS8I1MVoDxghEadm976b8JUpu4yDl9KiZ0SH2GPPbc8Xhdkf/6POnA==
X-Received: by 2002:adf:f387:0:b0:354:f46f:a5b5 with SMTP id
 ffacd0b85a97d-35e0f2e0062mr1763568f8f.3.1717173342586; 
 Fri, 31 May 2024 09:35:42 -0700 (PDT)
Received: from lili ([81.185.168.12]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-35dd064b5e9sm2194234f8f.96.2024.05.31.09.35.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 31 May 2024 09:35:41 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
In-Reply-To: <87sey5f0xr.fsf@HIDDEN>
References: <87y187b6xv.fsf@HIDDEN>
 <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
 <87a5ki3ygr.fsf@HIDDEN> <87sey5f0xr.fsf@HIDDEN>
Date: Mon, 27 May 2024 19:19:07 +0200
Message-ID: <875xuz18c4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Chris,

On Sun, 26 May 2024 at 09:10, Christopher Baines <mail@HIDDEN> wrote:

>>>  (define* (open-connection #:optional (uri (%daemon-socket-uri))
>>>                            #:key port (reserve-space? #t) cpu-affinity
>>> -                          non-blocking?)
>>> +                          non-blocking? assume-available-builtin-build=
ers)
>>
>> Why add the variable %assume-available-builtin-builders and default to
>> it?
>>
>> Something like:
>>
>> --8<---------------cut here---------------start------------->8---
>> (define %assume-available-builtin-builders
>>   "List of builtin builders supported by the builder Guix daemon."
>>   (list "download" "git-download"))
>>
>> (define* (open-connection #:optional (uri (%daemon-socket-uri))
>>                           #:key port (reserve-space? #t) cpu-affinity
>>                           non-blocking?)
>>                           non-blocking?
>>                           (assume-available-builtin-builders %assume-ava=
ilable-builtin-builders))
>> --8<---------------cut here---------------end--------------->8---
>>
>> And then default to this %assume-available-builtin-builders elsewhere in
>> [PATCH 2/2].  IMHO, it changes almost nothing but it would help to know
>> (document) what to pass as argument.
>
> I think it's sensible to not use a fixed list by default, but check what
> the daemon supports.

Do you mean dynamically construct the proposal of
%assume-available-builtin-builders?  Why not.

Aside, my point is to provide a default value for the new argument and
not let it free.  Because when reading the source code, not knowing its
type, neither any meaningful value make it hard to remember what it use
or how to use it, IMHO.  That=E2=80=99s why I am suggesting something like
%assume-available-builtin-builders that collects the acceptable values
=E2=80=93 for the most recent daemon, indeed; well it would simplify the
documentation of this new parameter / argument.

Considering your patch, how do I know that I could used it, as [1]:

--8<---------------cut here---------------start------------->8---
As in:

  (open-connection
    #:assume-available-builtin-builders '("download"))
--8<---------------cut here---------------end--------------->8---

Because it is not clear from the docstring.  And there is many
procedures that would require some docstring update with this new
procedure argument. :-)


1: bug#67250: builtin:git-download capability detection not working for the=
 bordeaux build farm
Ludovic Court=C3=A8s <ludo@HIDDEN>
Wed, 22 Nov 2023 11:19:42 +0100
id:87bkbmm6o1.fsf@HIDDEN
https://issues.guix.gnu.org/67250
https://issues.guix.gnu.org/msgid/87bkbmm6o1.fsf@HIDDEN
https://yhetil.org/guix/87bkbmm6o1.fsf@HIDDEN

Cheers,
simon




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH 1/2] guix: store: Enable specifying the available builtin builders.
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 11 Jun 2024 19:27:02 +0000
Resent-Message-ID: <handler.71038.B71038.17181340174393 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Simon Tournier <zimon.toutoune@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>, 71038 <at> debbugs.gnu.org
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.17181340174393
          (code B ref 71038); Tue, 11 Jun 2024 19:27:02 +0000
Received: (at 71038) by debbugs.gnu.org; 11 Jun 2024 19:26:57 +0000
Received: from localhost ([127.0.0.1]:36256 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sH78z-00018n-BX
	for submit <at> debbugs.gnu.org; Tue, 11 Jun 2024 15:26:57 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1sH78x-00018c-Pl
 for 71038 <at> debbugs.gnu.org; Tue, 11 Jun 2024 15:26:56 -0400
Received: from localhost (unknown [212.132.255.10])
 by mira.cbaines.net (Postfix) with ESMTPSA id 1E3DF27BBE2;
 Tue, 11 Jun 2024 20:26:26 +0100 (BST)
Received: from felis (localhost.lan [127.0.0.1])
 by localhost (OpenSMTPD) with ESMTP id bd40b795;
 Tue, 11 Jun 2024 19:26:25 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
In-Reply-To: <875xuz18c4.fsf@HIDDEN> (Simon Tournier's message of "Mon, 27
 May 2024 19:19:07 +0200")
References: <87y187b6xv.fsf@HIDDEN>
 <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@HIDDEN>
 <87a5ki3ygr.fsf@HIDDEN> <87sey5f0xr.fsf@HIDDEN>
 <875xuz18c4.fsf@HIDDEN>
User-Agent: mu4e 1.12.4; emacs 29.3
Date: Tue, 11 Jun 2024 20:26:22 +0100
Message-ID: <87a5jr8en5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Simon Tournier <zimon.toutoune@HIDDEN> writes:

> On Sun, 26 May 2024 at 09:10, Christopher Baines <mail@HIDDEN> wrote:
>
>>>>  (define* (open-connection #:optional (uri (%daemon-socket-uri))
>>>>                            #:key port (reserve-space? #t) cpu-affinity
>>>> -                          non-blocking?)
>>>> +                          non-blocking? assume-available-builtin-buil=
ders)
>>>
>>> Why add the variable %assume-available-builtin-builders and default to
>>> it?
>>>
>>> Something like:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> (define %assume-available-builtin-builders
>>>   "List of builtin builders supported by the builder Guix daemon."
>>>   (list "download" "git-download"))
>>>
>>> (define* (open-connection #:optional (uri (%daemon-socket-uri))
>>>                           #:key port (reserve-space? #t) cpu-affinity
>>>                           non-blocking?)
>>>                           non-blocking?
>>>                           (assume-available-builtin-builders %assume-av=
ailable-builtin-builders))
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> And then default to this %assume-available-builtin-builders elsewhere in
>>> [PATCH 2/2].  IMHO, it changes almost nothing but it would help to know
>>> (document) what to pass as argument.
>>
>> I think it's sensible to not use a fixed list by default, but check what
>> the daemon supports.
>
> Do you mean dynamically construct the proposal of
> %assume-available-builtin-builders?  Why not.
>
> Aside, my point is to provide a default value for the new argument and
> not let it free.  Because when reading the source code, not knowing its
> type, neither any meaningful value make it hard to remember what it use
> or how to use it, IMHO.  That=E2=80=99s why I am suggesting something like
> %assume-available-builtin-builders that collects the acceptable values
> =E2=80=93 for the most recent daemon, indeed; well it would simplify the
> documentation of this new parameter / argument.

I'm not sure I follow. I guess open-connection could have a
#:build-in-builders argument that expects a procedure that takes the
store connection, and returns the list of strings. That would allow it
to have the default of %built-in-builders from (guix store).

While this adds the flexibility for users to provide their own way of
setting the builtin builders enabled on a connection, I'm not sure
there's a need for it currently and I don't think it addresses your
concern about not knowing what value to provide.

It sounds easier just to make it clear from the docstrings that you
provide a list of strings, and have it default to #f to indicate to the
daemon's buildin builders.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZopN5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xd4QA//UI6mRApXQdXUzR/9JiF5yeilQ7TKjIlJ
/eajba3vSyzchjKnKiOPhJgpgzSQ3vvppsSJHiXXy3wyhv1z5vNF55GmZtNY720m
VGvF6imjom1TUnIZw2bKsBSA0Pj0ctRbsMDb3U1D1XLPpZHa/om4jclXbpIYzVT5
UJgLatZyayd/3OjVuQ78shmgaeOdV6BLRZPe118mJI8uJI7Kfxdb+MyWMmp/wN3E
bH3P+ajJjWoSv6qClJdrChJ+UlWnCki11EK4UWtJzrA93FAU5iMl7MEYYOwrgL3i
VbsdqXPkgWMypvnzsxhZNKprSXkz2PVcRFVg3MvJSEc8JlLAngTQqnkGGJsyvcBk
4qaannuRp0WS7psZmVH9FCNQGaT189pBUdgrFlb20gJjFJlOLQsCgJaH0YA4BqQQ
nskeVbFj8S4EyvsLobmUXNSNVb89hm9+GisrT7K4qQ8MboKx/WEZtTqchRZO89nX
dmx9jSgAeDhJq/RS7hdzh7SZsTmEt+rcsMgRsFZRiZnrEBEghJi2xb6AjhWozxvA
LPIVAgEnmyMgQrLm1KIkyWhEwXh5hLMx8d6yUFsWjy0ZSe905hF6vKU0dcKactKP
xbGP+OHGP4V4jRGy5KhpYshYNH6cNY/7KEED8PR6o/CvRyOlefopMgTz8g3QSHQX
X1gV4+qnmbI=
=dKYM
-----END PGP SIGNATURE-----
--=-=-=--




Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v2 2/2] guix: channels: Enable specifiying available builtin builders.
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Mon, 24 Jun 2024 13:44:02 +0000
Resent-Message-ID: <handler.71038.B71038.171923663316770 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.171923663316770
          (code B ref 71038); Mon, 24 Jun 2024 13:44:02 +0000
Received: (at 71038) by debbugs.gnu.org; 24 Jun 2024 13:43:53 +0000
Received: from localhost ([127.0.0.1]:58539 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sLjz6-0004MO-97
	for submit <at> debbugs.gnu.org; Mon, 24 Jun 2024 09:43:53 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43886)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1sLjz3-0004M7-OJ
 for 71038 <at> debbugs.gnu.org; Mon, 24 Jun 2024 09:43:50 -0400
Received: from localhost (unknown [212.132.255.81])
 by mira.cbaines.net (Postfix) with ESMTPSA id 5C07D27BBE9
 for <71038 <at> debbugs.gnu.org>; Mon, 24 Jun 2024 14:43:47 +0100 (BST)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 35e69eb5
 for <71038 <at> debbugs.gnu.org>; Mon, 24 Jun 2024 13:43:46 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
Date: Mon, 24 Jun 2024 14:43:46 +0100
Message-ID: <319c7822ef542dc412d55af616ecbeb86b005c8b.1719236626.git.mail@HIDDEN>
X-Mailer: git-send-email 2.45.1
In-Reply-To: <d854d02c05c91c4e5558b0785f4b0a77e3b781f4.1719236626.git.mail@HIDDEN>
References: <d854d02c05c91c4e5558b0785f4b0a77e3b781f4.1719236626.git.mail@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

When computing channel instance derivations.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

Fixes: <https://issues.guix.gnu.org/67250>.

* build-aux/build-self.scm (build-program): Accept
 #:assume-available-builtin-builders and pass along to port->connection or
open-connection as approriate.
(build): Accept and pass on #:assume-available-builtin-builders.
* guix/channels.scm (build-from-source, build-channel-instance,
channel-instance-derivations, channel-instances->manifest,
channel-instances->derivation): Accept and pass on
 #:assume-available-builtin-builders.

Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea
---
 build-aux/build-self.scm | 33 ++++++++++++++------
 guix/channels.scm        | 67 ++++++++++++++++++++++++++++++----------
 2 files changed, 74 insertions(+), 26 deletions(-)

diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index 02822a2ee8..c14bebd0b1 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -241,8 +241,12 @@ (define guile-gcrypt
 
 (define* (build-program source version
                         #:optional (guile-version (effective-version))
-                        #:key (pull-version 0) (channel-metadata #f))
-  "Return a program that computes the derivation to build Guix from SOURCE."
+                        #:key (pull-version 0) (channel-metadata #f)
+                        assume-available-builtin-builders)
+  "Return a program that computes the derivation to build Guix from SOURCE.
+If ASSUME-AVAILABLE-BUILTIN-BUILDERS is provided, it should be a list of
+strings and this will be used instead of the builtin builders provided by the
+build daemon, from within the generated build program."
   (define select?
     ;; Select every module but (guix config) and non-Guix modules.
     ;; Also exclude (guix channels): it is autoloaded by (guix describe), but
@@ -331,11 +335,20 @@ (define* (build-program source version
                          ;; case, attempt to open a new connection.
                          (let* ((proto (string->number protocol-version))
                                 (store (if (integer? proto)
-                                           (port->connection (duplicate-port
-                                                              (current-input-port)
-                                                              "w+0")
-                                                             #:version proto)
-                                           (open-connection)))
+                                           (port->connection
+                                            (duplicate-port
+                                             (current-input-port)
+                                             "w+0")
+                                            #:version proto
+                                            #$@(if assume-available-builtin-builders
+                                                   #~(#:assume-available-builtin-builders
+                                                      '(#$@assume-available-builtin-builders))
+                                                   '()))
+                                           (open-connection
+                                            #$@(if assume-available-builtin-builders
+                                                   #~(#:assume-available-builtin-builders
+                                                      '(#$@assume-available-builtin-builders))
+                                                   '()))))
                                 (sock  (socket AF_UNIX SOCK_STREAM 0)))
                            ;; Connect to BUILD-OUTPUT and send it the raw
                            ;; build output.
@@ -406,7 +419,7 @@ (define* (build source
                 (guile-version (if (> pull-version 0)
                                    "3.0"
                                    (effective-version)))
-
+                assume-available-builtin-builders
                 #:allow-other-keys
                 #:rest rest)
   "Return a derivation that unpacks SOURCE into STORE and compiles Scheme
@@ -415,7 +428,9 @@ (define* (build source
   ;; SOURCE.
   (mlet %store-monad ((build  (build-program source version guile-version
                                              #:channel-metadata channel-metadata
-                                             #:pull-version pull-version))
+                                             #:pull-version pull-version
+                                             #:assume-available-builtin-builders
+                                             assume-available-builtin-builders))
                       (system (if system (return system) (current-system)))
                       (home -> (getenv "HOME"))
 
diff --git a/guix/channels.scm b/guix/channels.scm
index 0d7bc541cc..dfdf6cfe3f 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -704,11 +704,15 @@ (define (with-trivial-build-handler mvalue)
               store))))
 
 (define* (build-from-source instance
-                            #:key core verbose? (dependencies '()) system)
+                            #:key core verbose? (dependencies '()) system
+                            assume-available-builtin-builders)
   "Return a derivation to build Guix from INSTANCE, using the self-build
 script contained therein.  When CORE is true, build package modules under
 SOURCE using CORE, an instance of Guix.  By default, build for the current
-system, or SYSTEM if specified."
+system, or SYSTEM if specified.  If ASSUME-AVAILABLE-BUILTIN-BUILDERS is
+provided, it should be a list of strings and this will be used instead of the
+builtin builders provided by the build daemon for store connections used
+during this process."
   (define name
     (symbol->string
      (channel-name (channel-instance-channel instance))))
@@ -750,20 +754,28 @@ (define* (build-from-source instance
                   #:verbose? verbose? #:version commit
                   #:system system
                   #:channel-metadata (channel-instance->sexp instance)
-                  #:pull-version %pull-version))))
+                  #:pull-version %pull-version
+                  #:assume-available-builtin-builders
+                  assume-available-builtin-builders))))
 
       ;; Build a set of modules that extend Guix using the standard method.
       (standard-module-derivation name source core dependencies)))
 
 (define* (build-channel-instance instance system
-                                 #:optional core (dependencies '()))
+                                 #:optional core (dependencies '())
+                                 #:key assume-available-builtin-builders)
   "Return, as a monadic value, the derivation for INSTANCE, a channel
 instance, for SYSTEM.  DEPENDENCIES is a list of extensions providing Guile
-modules that INSTANCE depends on."
+modules that INSTANCE depends on.  If ASSUME-AVAILABLE-BUILTIN-BUILDERS is
+provided, it should be a list of strings and this will be used instead of the
+builtin builders provided by the build daemon for store connections used
+during this process."
   (build-from-source instance
                      #:core core
                      #:dependencies dependencies
-                     #:system system))
+                     #:system system
+                     #:assume-available-builtin-builders
+                     assume-available-builtin-builders))
 
 (define (resolve-dependencies instances)
   "Return a procedure that, given one of the elements of INSTANCES, returns
@@ -793,9 +805,13 @@ (define (resolve-dependencies instances)
   (lambda (instance)
     (vhash-foldq* cons '() instance edges)))
 
-(define* (channel-instance-derivations instances #:key system)
+(define* (channel-instance-derivations instances #:key system
+                                       assume-available-builtin-builders)
   "Return the list of derivations to build INSTANCES, in the same order as
-INSTANCES.  Build for the current system by default, or SYSTEM if specified."
+INSTANCES.  Build for the current system by default, or SYSTEM if specified.
+If ASSUME-AVAILABLE-BUILTIN-BUILDERS is provided, it should be a list of
+strings and this will be used instead of the builtin builders provided by the
+build daemon for store connections used during this process."
   (define core-instance
     ;; The 'guix' channel is treated specially: it's an implicit dependency of
     ;; all the other channels.
@@ -809,11 +825,15 @@ (define* (channel-instance-derivations instances #:key system)
   (define (instance->derivation instance)
     (mlet %store-monad ((system (if system (return system) (current-system))))
       (mcached (if (eq? instance core-instance)
-                   (build-channel-instance instance system)
+                   (build-channel-instance instance system
+                                           #:assume-available-builtin-builders
+                                           assume-available-builtin-builders)
                    (mlet %store-monad ((core (instance->derivation core-instance))
                                        (deps (mapm %store-monad instance->derivation
                                                    (edges instance))))
-                     (build-channel-instance instance system core deps)))
+                     (build-channel-instance instance system core deps
+                                             #:assume-available-builtin-builders
+                                             assume-available-builtin-builders)))
                instance
                system)))
 
@@ -915,10 +935,13 @@ (define (channel-instance->sexp instance)
                     intro))))))
             '()))))
 
-(define* (channel-instances->manifest instances #:key system)
+(define* (channel-instances->manifest instances #:key system
+                                      assume-available-builtin-builders)
   "Return a profile manifest with entries for all of INSTANCES, a list of
 channel instances.  By default, build for the current system, or SYSTEM if
-specified."
+specified.  If ASSUME-AVAILABLE-BUILTIN-BUILDERS is provided, it should be a
+list of strings and this will be used instead of the builtin builders provided
+by the build daemon for store connections used during this process."
   (define (instance->entry instance drv)
     (let ((commit  (channel-instance-commit instance))
           (channel (channel-instance-channel instance)))
@@ -934,8 +957,11 @@ (define* (channel-instances->manifest instances #:key system)
         (properties
          `((source ,(channel-instance->sexp instance)))))))
 
-  (mlet* %store-monad ((derivations (channel-instance-derivations instances
-                                                                  #:system system))
+  (mlet* %store-monad ((derivations (channel-instance-derivations
+                                     instances
+                                     #:system system
+                                     #:assume-available-builtin-builders
+                                     assume-available-builtin-builders))
                        (entries ->  (map instance->entry instances derivations)))
     (return (manifest entries))))
 
@@ -990,10 +1016,17 @@ (define %channel-profile-hooks
   ;; The default channel profile hooks.
   (cons package-cache-file %default-profile-hooks))
 
-(define (channel-instances->derivation instances)
+(define* (channel-instances->derivation instances
+                                        #:key assume-available-builtin-builders)
   "Return the derivation of the profile containing INSTANCES, a list of
-channel instances."
-  (mlet %store-monad ((manifest (channel-instances->manifest instances)))
+channel instances.  If ASSUME-AVAILABLE-BUILTIN-BUILDERS is provided, it
+should be a list of strings and this will be used instead of the builtin
+builders provided by the build daemon for store connections used during this
+process."
+  (mlet %store-monad ((manifest (channel-instances->manifest
+                                 instances
+                                 #:assume-available-builtin-builders
+                                 assume-available-builtin-builders)))
     ;; Emit a profile in format version so that, if INSTANCES denotes an old
     ;; Guix, it can still read that profile, for instance for the purposes of
     ;; 'guix describe'.
-- 
2.45.1





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v2 1/2] guix: store: Enable specifying the available builtin builders.
References: <87y187b6xv.fsf@HIDDEN>
In-Reply-To: <87y187b6xv.fsf@HIDDEN>
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Mon, 24 Jun 2024 13:44:02 +0000
Resent-Message-ID: <handler.71038.B71038.171923663316778 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.171923663316778
          (code B ref 71038); Mon, 24 Jun 2024 13:44:02 +0000
Received: (at 71038) by debbugs.gnu.org; 24 Jun 2024 13:43:53 +0000
Received: from localhost ([127.0.0.1]:58542 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sLjz7-0004MR-6O
	for submit <at> debbugs.gnu.org; Mon, 24 Jun 2024 09:43:53 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43884)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1sLjz3-0004M4-Ku
 for 71038 <at> debbugs.gnu.org; Mon, 24 Jun 2024 09:43:50 -0400
Received: from localhost (unknown [212.132.255.81])
 by mira.cbaines.net (Postfix) with ESMTPSA id 4B42B27BBE2
 for <71038 <at> debbugs.gnu.org>; Mon, 24 Jun 2024 14:43:47 +0100 (BST)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 265b217b
 for <71038 <at> debbugs.gnu.org>; Mon, 24 Jun 2024 13:43:46 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
Date: Mon, 24 Jun 2024 14:43:45 +0100
Message-ID: <d854d02c05c91c4e5558b0785f4b0a77e3b781f4.1719236626.git.mail@HIDDEN>
X-Mailer: git-send-email 2.45.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

To open-connection and port->connection.  This overrides the discovered
builtin builders that the daemon says it provides.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

* guix/store.scm (open-connection, port->connection): Accept
 #:assume-available-builtin-builders and use this instead of
%built-in-builders.

Fixes: <https://issues.guix.gnu.org/67250>.

Change-Id: I45d58ab93b6d276d280552858fc81ebc2b58828a
---
 guix/store.scm | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index 58ddaa8d15..8c823a2185 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -571,7 +571,7 @@ (define* (connect-to-daemon uri #:key non-blocking?)
 
 (define* (open-connection #:optional (uri (%daemon-socket-uri))
                           #:key port (reserve-space? #t) cpu-affinity
-                          non-blocking?)
+                          non-blocking? assume-available-builtin-builders)
   "Connect to the daemon at URI (a string), or, if PORT is not #f, use it as
 the I/O port over which to communicate to a build daemon.
 
@@ -580,8 +580,10 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
 should the disk become full.  When CPU-AFFINITY is true, it must be an integer
 corresponding to an OS-level CPU number to which the daemon's worker process
 for this connection will be pinned.  If NON-BLOCKING?, use a non-blocking
-socket when using the file, unix or guix URI schemes.  Return a server
-object."
+socket when using the file, unix or guix URI schemes.  If
+ASSUME-AVAILABLE-BUILTIN-BUILDERS is provided, it should be a list of strings
+and this will be used instead of the builtin builders provided by the build
+daemon.  Return a server object."
   (define (handshake-error)
     (raise (condition
             (&store-connection-error (file (or port uri))
@@ -616,7 +618,9 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
           (when (>= (protocol-minor v) 11)
             (write-int (if reserve-space? 1 0) port))
           (letrec* ((built-in-builders
-                     (delay (%built-in-builders conn)))
+                     (if assume-available-builtin-builders
+                         (delay assume-available-builtin-builders)
+                         (delay (%built-in-builders conn))))
                     (caches
                      (make-vector
                       (atomic-box-ref %store-connection-caches)
@@ -635,9 +639,13 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
             conn))))))
 
 (define* (port->connection port
-                           #:key (version %protocol-version))
+                           #:key (version %protocol-version)
+                           assume-available-builtin-builders)
   "Assimilate PORT, an input/output port, and return a connection to the
-daemon, assuming the given protocol VERSION.
+daemon, assuming the given protocol VERSION.  If
+ASSUME-AVAILABLE-BUILTIN-BUILDERS is provided, it should be a list of strings
+and this will be used instead of the builtin builders provided by the build
+daemon.
 
 Warning: this procedure assumes that the initial handshake with the daemon has
 already taken place on PORT and that we're just continuing on this established
@@ -654,7 +662,9 @@ (define* (port->connection port
                               (make-vector
                                (atomic-box-ref %store-connection-caches)
                                vlist-null)
-                              (delay (%built-in-builders connection))))
+                              (if assume-available-builtin-builders
+                                  (delay assume-available-builtin-builders)
+                                  (delay (%built-in-builders connection)))))
 
     connection))
 

base-commit: 018f2781d5aa301c156c81981f1fd3df56e438b9
-- 
2.45.1





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v2 1/2] guix: store: Enable specifying the available builtin builders.
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 04 Jul 2024 09:15:02 +0000
Resent-Message-ID: <handler.71038.B71038.172008446530574 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Christopher Baines <mail@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Christopher Baines <guix@HIDDEN>, 71038 <at> debbugs.gnu.org
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.172008446530574
          (code B ref 71038); Thu, 04 Jul 2024 09:15:02 +0000
Received: (at 71038) by debbugs.gnu.org; 4 Jul 2024 09:14:25 +0000
Received: from localhost ([127.0.0.1]:41486 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPIXp-0007x4-Dr
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 05:14:25 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54328)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1sPIXn-0007wq-Bf
 for 71038 <at> debbugs.gnu.org; Thu, 04 Jul 2024 05:14:23 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1sPIXe-0005LY-3a; Thu, 04 Jul 2024 05:14:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=dxVaHYSLbvyFn+dlcLi1h+zvkXwUr2BdtNaQe+TqEhA=; b=GYNKWc8ctXRzin3ltMsk
 M+goNgJEL0wmGRDrwaMlJ+yDZMZsQ8T667SSzNp3J0v3/np7ZFaCLtJfpOdqYrLdRhpMOVeOd0bo1
 7uSoI3l3ci0SUPqc8mZ+oyRZWyrWlcVQC4GhKw+ZSh+GbUS7LB9XxoLViZMWBB4y7hVhmFfSVDkSv
 TtiDzOTiudNqYJhk1h8u8UYuvZ28kss3G94tPtfecs2garX1Pr9/AibpH/PFCV7mQMkaUGoG5J185
 9zffp2giCuK1iE2AJjIZkPEK0hQCPw/XSPfr7kAjsEWIfit9bOUd8ogBHOAr4XPNcHWchhC1HGxjJ
 Y8l15TCRauDXDQ==;
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
In-Reply-To: <d854d02c05c91c4e5558b0785f4b0a77e3b781f4.1719236626.git.mail@HIDDEN>
 (Christopher Baines's message of "Mon, 24 Jun 2024 14:43:45 +0100")
References: <87y187b6xv.fsf@HIDDEN>
 <d854d02c05c91c4e5558b0785f4b0a77e3b781f4.1719236626.git.mail@HIDDEN>
Date: Thu, 04 Jul 2024 11:14:07 +0200
Message-ID: <87msmx7c4g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

Summarizing our live review session here=E2=80=A6

Christopher Baines <mail@HIDDEN> skribis:

> To open-connection and port->connection.  This overrides the discovered
> builtin builders that the daemon says it provides.
>
> This is useful when you want to generate compatible derivations that can =
be
> run with a daemon that potentially doesn't support builtin builders that =
the
> daemon you're using to generate the derivations has.
>
> I'm looking at this in particular because I want to use this in the data
> service, since it provides substitutes for derivations, and since these c=
an be
> built on other machines, it's useful to control which builtin builders th=
ey
> depend on.
>
> * guix/store.scm (open-connection, port->connection): Accept
>  #:assume-available-builtin-builders and use this instead of
> %built-in-builders.
>
> Fixes: <https://issues.guix.gnu.org/67250>.
>
> Change-Id: I45d58ab93b6d276d280552858fc81ebc2b58828a

This is nice.  Nitpick: you can drop =E2=80=9Cguix:=E2=80=9D from the commi=
t message subject.

>  (define* (open-connection #:optional (uri (%daemon-socket-uri))
>                            #:key port (reserve-space? #t) cpu-affinity
> -                          non-blocking?)
> +                          non-blocking? assume-available-builtin-builder=
s)

My only suggestion here is to rename =E2=80=98assume-available-builtin-buil=
ders=E2=80=99
to just =E2=80=98built-in-builders=E2=80=99 (so that it=E2=80=99s a noun ra=
ther than a phrase).

Ludo=E2=80=99.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v2 2/2] guix: channels: Enable specifiying available builtin builders.
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 04 Jul 2024 09:18:01 +0000
Resent-Message-ID: <handler.71038.B71038.172008464230903 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Christopher Baines <mail@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Christopher Baines <guix@HIDDEN>, 71038 <at> debbugs.gnu.org
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.172008464230903
          (code B ref 71038); Thu, 04 Jul 2024 09:18:01 +0000
Received: (at 71038) by debbugs.gnu.org; 4 Jul 2024 09:17:22 +0000
Received: from localhost ([127.0.0.1]:41491 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPIag-00082M-0P
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 05:17:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57850)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1sPIae-00082A-E7
 for 71038 <at> debbugs.gnu.org; Thu, 04 Jul 2024 05:17:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1sPIaW-0008Kk-P7; Thu, 04 Jul 2024 05:17:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=/6aayhsTyT5/nQNxstbffirMx2e9cq+ACHxm3MrAMTg=; b=GhEt8QwHyoGb99cb0QOJ
 HvJWUg2R7wUES8pG2D63+WTioYOrfeAUmKV2TI//nNyog43CNCVOJrNEk3wpzHWyU5wFGFBzmVUM4
 V9kDux1gNS5oeBRT3/1jPXjDIg6nxYPgyFVd/i1B6liwIVsl1M1fIabLIIeCZuSSKWRy6meDoowSz
 SFwz+zcm7HATrluLruS9tcAAB9rZm4i3LL3OdtTni6Mjf8A2udykjwyy+5XQ2byLQy1ad+CATUeNh
 BgKNVLpiio8h92+zAPqvB+6E3I1dOigYjHHlYwLq2NDzQN0rSf2wenkLxVtH7aUcBQ0CFMX0FVn9s
 eSSdrBomC1YoBw==;
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
In-Reply-To: <319c7822ef542dc412d55af616ecbeb86b005c8b.1719236626.git.mail@HIDDEN>
 (Christopher Baines's message of "Mon, 24 Jun 2024 14:43:46 +0100")
References: <d854d02c05c91c4e5558b0785f4b0a77e3b781f4.1719236626.git.mail@HIDDEN>
 <319c7822ef542dc412d55af616ecbeb86b005c8b.1719236626.git.mail@HIDDEN>
Date: Thu, 04 Jul 2024 11:17:05 +0200
Message-ID: <87ikxl7bzi.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Christopher Baines <mail@HIDDEN> skribis:

> When computing channel instance derivations.
>
> This is useful when you want to generate compatible derivations that can =
be
> run with a daemon that potentially doesn't support builtin builders that =
the
> daemon you're using to generate the derivations has.
>
> I'm looking at this in particular because I want to use this in the data
> service, since it provides substitutes for derivations, and since these c=
an be
> built on other machines, it's useful to control which builtin builders th=
ey
> depend on.
>
> Fixes: <https://issues.guix.gnu.org/67250>.
>
> * build-aux/build-self.scm (build-program): Accept
>  #:assume-available-builtin-builders and pass along to port->connection or
> open-connection as approriate.
> (build): Accept and pass on #:assume-available-builtin-builders.
> * guix/channels.scm (build-from-source, build-channel-instance,
> channel-instance-derivations, channel-instances->manifest,
> channel-instances->derivation): Accept and pass on
>  #:assume-available-builtin-builders.
>
> Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea

I would have hoped we could avoid this, because it=E2=80=99s make tricky co=
de a
bit harder to read, but as you said, it=E2=80=99s a real issue that needs
fixing: on build farms or for anyone using offloading and potentially
not upgrading all the machines in lockstep.

> +                                            #:version proto
> +                                            #$@(if assume-available-buil=
tin-builders
> +                                                   #~(#:assume-available=
-builtin-builders
> +                                                      '(#$@assume-availa=
ble-builtin-builders))
> +                                                   '()))

Here (in =E2=80=98build-program=E2=80=99), we can assume we=E2=80=99re usin=
g the current (guix
store) module, so we can safely pass #:built-in-builders unconditionally.

That=E2=80=99s it!

The series LGTM with these changes.

Thank you! :-)




Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v3 2/2] guix: channels: Enable specifiying available builtin builders.
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 04 Jul 2024 11:51:02 +0000
Resent-Message-ID: <handler.71038.B71038.172009382826278 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.172009382826278
          (code B ref 71038); Thu, 04 Jul 2024 11:51:02 +0000
Received: (at 71038) by debbugs.gnu.org; 4 Jul 2024 11:50:28 +0000
Received: from localhost ([127.0.0.1]:41684 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPKyq-0006pl-0i
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 07:50:28 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43900)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1sPKye-0006pT-Bg
 for 71038 <at> debbugs.gnu.org; Thu, 04 Jul 2024 07:50:26 -0400
Received: from localhost (nat-inria-guest-32-gw-01-bso.bordeaux.inria.fr
 [194.199.1.32])
 by mira.cbaines.net (Postfix) with ESMTPSA id EB72927BBE9
 for <71038 <at> debbugs.gnu.org>; Thu,  4 Jul 2024 12:50:11 +0100 (BST)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id e6d59174
 for <71038 <at> debbugs.gnu.org>; Thu, 4 Jul 2024 11:50:10 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
Date: Thu,  4 Jul 2024 13:50:09 +0200
Message-ID: <0d2d50291d3c0c7be10c8a535bf64dec49a4f1eb.1720093809.git.mail@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <14fc15bdb8b5fd615fb93e025e86ccf70cf81814.1720093809.git.mail@HIDDEN>
References: <14fc15bdb8b5fd615fb93e025e86ccf70cf81814.1720093809.git.mail@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

When computing channel instance derivations.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

Fixes: <https://issues.guix.gnu.org/67250>.

* build-aux/build-self.scm (build-program): Accept
 #:built-in-builders and pass along to port->connection or
open-connection as approriate.
(build): Accept and pass on #:built-in-builders.
* guix/channels.scm (build-from-source, build-channel-instance,
channel-instance-derivations, channel-instances->manifest,
channel-instances->derivation): Accept and pass on
 #:built-in-builders.

Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea
---
 build-aux/build-self.scm | 29 +++++++++++------
 guix/channels.scm        | 67 ++++++++++++++++++++++++++++++----------
 2 files changed, 70 insertions(+), 26 deletions(-)

diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index 02822a2ee8..d9299b9af2 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -241,8 +241,12 @@ (define guile-gcrypt
 
 (define* (build-program source version
                         #:optional (guile-version (effective-version))
-                        #:key (pull-version 0) (channel-metadata #f))
-  "Return a program that computes the derivation to build Guix from SOURCE."
+                        #:key (pull-version 0) (channel-metadata #f)
+                        built-in-builders)
+  "Return a program that computes the derivation to build Guix from SOURCE.
+If BUILT-IN-BUILDERS is provided, it should be a list of
+strings and this will be used instead of the builtin builders provided by the
+build daemon, from within the generated build program."
   (define select?
     ;; Select every module but (guix config) and non-Guix modules.
     ;; Also exclude (guix channels): it is autoloaded by (guix describe), but
@@ -331,11 +335,16 @@ (define* (build-program source version
                          ;; case, attempt to open a new connection.
                          (let* ((proto (string->number protocol-version))
                                 (store (if (integer? proto)
-                                           (port->connection (duplicate-port
-                                                              (current-input-port)
-                                                              "w+0")
-                                                             #:version proto)
-                                           (open-connection)))
+                                           (port->connection
+                                            (duplicate-port
+                                             (current-input-port)
+                                             "w+0")
+                                            #:version proto
+                                            #:built-in-builders
+                                            '#$built-in-builders)
+                                           (open-connection
+                                            #:built-in-builders
+                                            '#$built-in-builders)))
                                 (sock  (socket AF_UNIX SOCK_STREAM 0)))
                            ;; Connect to BUILD-OUTPUT and send it the raw
                            ;; build output.
@@ -406,7 +415,7 @@ (define* (build source
                 (guile-version (if (> pull-version 0)
                                    "3.0"
                                    (effective-version)))
-
+                built-in-builders
                 #:allow-other-keys
                 #:rest rest)
   "Return a derivation that unpacks SOURCE into STORE and compiles Scheme
@@ -415,7 +424,9 @@ (define* (build source
   ;; SOURCE.
   (mlet %store-monad ((build  (build-program source version guile-version
                                              #:channel-metadata channel-metadata
-                                             #:pull-version pull-version))
+                                             #:pull-version pull-version
+                                             #:built-in-builders
+                                             built-in-builders))
                       (system (if system (return system) (current-system)))
                       (home -> (getenv "HOME"))
 
diff --git a/guix/channels.scm b/guix/channels.scm
index 0d7bc541cc..34f63eb833 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -704,11 +704,15 @@ (define (with-trivial-build-handler mvalue)
               store))))
 
 (define* (build-from-source instance
-                            #:key core verbose? (dependencies '()) system)
+                            #:key core verbose? (dependencies '()) system
+                            built-in-builders)
   "Return a derivation to build Guix from INSTANCE, using the self-build
 script contained therein.  When CORE is true, build package modules under
 SOURCE using CORE, an instance of Guix.  By default, build for the current
-system, or SYSTEM if specified."
+system, or SYSTEM if specified.  If BUILT-IN-BUILDERS is
+provided, it should be a list of strings and this will be used instead of the
+builtin builders provided by the build daemon for store connections used
+during this process."
   (define name
     (symbol->string
      (channel-name (channel-instance-channel instance))))
@@ -750,20 +754,28 @@ (define* (build-from-source instance
                   #:verbose? verbose? #:version commit
                   #:system system
                   #:channel-metadata (channel-instance->sexp instance)
-                  #:pull-version %pull-version))))
+                  #:pull-version %pull-version
+                  #:built-in-builders
+                  built-in-builders))))
 
       ;; Build a set of modules that extend Guix using the standard method.
       (standard-module-derivation name source core dependencies)))
 
 (define* (build-channel-instance instance system
-                                 #:optional core (dependencies '()))
+                                 #:optional core (dependencies '())
+                                 #:key built-in-builders)
   "Return, as a monadic value, the derivation for INSTANCE, a channel
 instance, for SYSTEM.  DEPENDENCIES is a list of extensions providing Guile
-modules that INSTANCE depends on."
+modules that INSTANCE depends on.  If BUILT-IN-BUILDERS is
+provided, it should be a list of strings and this will be used instead of the
+builtin builders provided by the build daemon for store connections used
+during this process."
   (build-from-source instance
                      #:core core
                      #:dependencies dependencies
-                     #:system system))
+                     #:system system
+                     #:built-in-builders
+                     built-in-builders))
 
 (define (resolve-dependencies instances)
   "Return a procedure that, given one of the elements of INSTANCES, returns
@@ -793,9 +805,13 @@ (define (resolve-dependencies instances)
   (lambda (instance)
     (vhash-foldq* cons '() instance edges)))
 
-(define* (channel-instance-derivations instances #:key system)
+(define* (channel-instance-derivations instances #:key system
+                                       built-in-builders)
   "Return the list of derivations to build INSTANCES, in the same order as
-INSTANCES.  Build for the current system by default, or SYSTEM if specified."
+INSTANCES.  Build for the current system by default, or SYSTEM if specified.
+If BUILT-IN-BUILDERS is provided, it should be a list of
+strings and this will be used instead of the builtin builders provided by the
+build daemon for store connections used during this process."
   (define core-instance
     ;; The 'guix' channel is treated specially: it's an implicit dependency of
     ;; all the other channels.
@@ -809,11 +825,15 @@ (define* (channel-instance-derivations instances #:key system)
   (define (instance->derivation instance)
     (mlet %store-monad ((system (if system (return system) (current-system))))
       (mcached (if (eq? instance core-instance)
-                   (build-channel-instance instance system)
+                   (build-channel-instance instance system
+                                           #:built-in-builders
+                                           built-in-builders)
                    (mlet %store-monad ((core (instance->derivation core-instance))
                                        (deps (mapm %store-monad instance->derivation
                                                    (edges instance))))
-                     (build-channel-instance instance system core deps)))
+                     (build-channel-instance instance system core deps
+                                             #:built-in-builders
+                                             built-in-builders)))
                instance
                system)))
 
@@ -915,10 +935,13 @@ (define (channel-instance->sexp instance)
                     intro))))))
             '()))))
 
-(define* (channel-instances->manifest instances #:key system)
+(define* (channel-instances->manifest instances #:key system
+                                      built-in-builders)
   "Return a profile manifest with entries for all of INSTANCES, a list of
 channel instances.  By default, build for the current system, or SYSTEM if
-specified."
+specified.  If BUILT-IN-BUILDERS is provided, it should be a
+list of strings and this will be used instead of the builtin builders provided
+by the build daemon for store connections used during this process."
   (define (instance->entry instance drv)
     (let ((commit  (channel-instance-commit instance))
           (channel (channel-instance-channel instance)))
@@ -934,8 +957,11 @@ (define* (channel-instances->manifest instances #:key system)
         (properties
          `((source ,(channel-instance->sexp instance)))))))
 
-  (mlet* %store-monad ((derivations (channel-instance-derivations instances
-                                                                  #:system system))
+  (mlet* %store-monad ((derivations (channel-instance-derivations
+                                     instances
+                                     #:system system
+                                     #:built-in-builders
+                                     built-in-builders))
                        (entries ->  (map instance->entry instances derivations)))
     (return (manifest entries))))
 
@@ -990,10 +1016,17 @@ (define %channel-profile-hooks
   ;; The default channel profile hooks.
   (cons package-cache-file %default-profile-hooks))
 
-(define (channel-instances->derivation instances)
+(define* (channel-instances->derivation instances
+                                        #:key built-in-builders)
   "Return the derivation of the profile containing INSTANCES, a list of
-channel instances."
-  (mlet %store-monad ((manifest (channel-instances->manifest instances)))
+channel instances.  If BUILT-IN-BUILDERS is provided, it
+should be a list of strings and this will be used instead of the builtin
+builders provided by the build daemon for store connections used during this
+process."
+  (mlet %store-monad ((manifest (channel-instances->manifest
+                                 instances
+                                 #:built-in-builders
+                                 built-in-builders)))
     ;; Emit a profile in format version so that, if INSTANCES denotes an old
     ;; Guix, it can still read that profile, for instance for the purposes of
     ;; 'guix describe'.
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v3 1/2] guix: store: Enable specifying the builtin builders.
References: <87y187b6xv.fsf@HIDDEN>
In-Reply-To: <87y187b6xv.fsf@HIDDEN>
Resent-From: Christopher Baines <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 04 Jul 2024 11:51:02 +0000
Resent-Message-ID: <handler.71038.B71038.172009384826310 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 71038 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.172009384826310
          (code B ref 71038); Thu, 04 Jul 2024 11:51:02 +0000
Received: (at 71038) by debbugs.gnu.org; 4 Jul 2024 11:50:48 +0000
Received: from localhost ([127.0.0.1]:41687 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPKz9-0006qI-P2
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 07:50:48 -0400
Received: from mira.cbaines.net ([212.71.252.8]:43904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1sPKz7-0006qA-KQ
 for 71038 <at> debbugs.gnu.org; Thu, 04 Jul 2024 07:50:46 -0400
Received: from localhost (nat-inria-guest-32-gw-01-bso.bordeaux.inria.fr
 [194.199.1.32])
 by mira.cbaines.net (Postfix) with ESMTPSA id A8F7D27BBE2
 for <71038 <at> debbugs.gnu.org>; Thu,  4 Jul 2024 12:50:11 +0100 (BST)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 9a747b75
 for <71038 <at> debbugs.gnu.org>; Thu, 4 Jul 2024 11:50:10 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
Date: Thu,  4 Jul 2024 13:50:08 +0200
Message-ID: <14fc15bdb8b5fd615fb93e025e86ccf70cf81814.1720093809.git.mail@HIDDEN>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

To open-connection and port->connection.  This overrides the discovered
builtin builders that the daemon says it provides.

This is useful when you want to generate compatible derivations that can be
run with a daemon that potentially doesn't support builtin builders that the
daemon you're using to generate the derivations has.

I'm looking at this in particular because I want to use this in the data
service, since it provides substitutes for derivations, and since these can be
built on other machines, it's useful to control which builtin builders they
depend on.

* guix/store.scm (open-connection, port->connection): Accept
 #:built-in-builders and use this instead of %built-in-builders.

Fixes: <https://issues.guix.gnu.org/67250>.

Change-Id: I45d58ab93b6d276d280552858fc81ebc2b58828a
---
 guix/store.scm | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index 4070b686cb..cf5848e580 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -566,7 +566,7 @@ (define* (connect-to-daemon uri-or-filename #:key non-blocking?)
 
 (define* (open-connection #:optional (uri (%daemon-socket-uri))
                           #:key port (reserve-space? #t) cpu-affinity
-                          non-blocking?)
+                          non-blocking? built-in-builders)
   "Connect to the daemon at URI (a string), or, if PORT is not #f, use it as
 the I/O port over which to communicate to a build daemon.
 
@@ -575,8 +575,10 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
 should the disk become full.  When CPU-AFFINITY is true, it must be an integer
 corresponding to an OS-level CPU number to which the daemon's worker process
 for this connection will be pinned.  If NON-BLOCKING?, use a non-blocking
-socket when using the file, unix or guix URI schemes.  Return a server
-object."
+socket when using the file, unix or guix URI schemes.  If
+BUILT-IN-BUILDERS is provided, it should be a list of strings
+and this will be used instead of the builtin builders provided by the build
+daemon.  Return a server object."
   (define (handshake-error)
     (raise (condition
             (&store-connection-error (file (or port uri))
@@ -610,8 +612,10 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
               (write-int cpu-affinity port)))
           (when (>= (protocol-minor v) 11)
             (write-int (if reserve-space? 1 0) port))
-          (letrec* ((built-in-builders
-                     (delay (%built-in-builders conn)))
+          (letrec* ((actual-built-in-builders
+                     (if built-in-builders
+                         (delay built-in-builders)
+                         (delay (%built-in-builders conn))))
                     (caches
                      (make-vector
                       (atomic-box-ref %store-connection-caches)
@@ -624,15 +628,19 @@ (define* (open-connection #:optional (uri (%daemon-socket-uri))
                                              (make-hash-table 100)
                                              (make-hash-table 100)
                                              caches
-                                             built-in-builders)))
+                                             actual-built-in-builders)))
             (let loop ((done? (process-stderr conn)))
               (or done? (process-stderr conn)))
             conn))))))
 
 (define* (port->connection port
-                           #:key (version %protocol-version))
+                           #:key (version %protocol-version)
+                           built-in-builders)
   "Assimilate PORT, an input/output port, and return a connection to the
-daemon, assuming the given protocol VERSION.
+daemon, assuming the given protocol VERSION.  If
+BUILT-IN-BUILDERS is provided, it should be a list of strings
+and this will be used instead of the builtin builders provided by the build
+daemon.
 
 Warning: this procedure assumes that the initial handshake with the daemon has
 already taken place on PORT and that we're just continuing on this established
@@ -649,7 +657,9 @@ (define* (port->connection port
                               (make-vector
                                (atomic-box-ref %store-connection-caches)
                                vlist-null)
-                              (delay (%built-in-builders connection))))
+                              (if built-in-builders
+                                  (delay built-in-builders)
+                                  (delay (%built-in-builders connection)))))
 
     connection))
 

base-commit: 5f1e4e4c0242af6bcba656aedf8b49afbe7247b7
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#71038] [PATCH v3 2/2] guix: channels: Enable specifiying available builtin builders.
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 16 Jul 2024 10:07:02 +0000
Resent-Message-ID: <handler.71038.B71038.172112437224458 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71038
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Christopher Baines <mail@HIDDEN>
Cc: Josselin Poiret <dev@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Christopher Baines <guix@HIDDEN>, 71038 <at> debbugs.gnu.org
Received: via spool by 71038-submit <at> debbugs.gnu.org id=B71038.172112437224458
          (code B ref 71038); Tue, 16 Jul 2024 10:07:02 +0000
Received: (at 71038) by debbugs.gnu.org; 16 Jul 2024 10:06:12 +0000
Received: from localhost ([127.0.0.1]:32791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTf4W-0006MP-0t
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 06:06:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1sTf4T-0006MA-Cx
 for 71038 <at> debbugs.gnu.org; Tue, 16 Jul 2024 06:06:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1sTf4K-0004Gg-IU; Tue, 16 Jul 2024 06:06:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=WYQyu0ieBWIpcqxqhvLazULbX49tDiP3tO+gDacGoD4=; b=CYwGiVMRmvYqxAl8SE3z
 L4dVOXSnWPpHBbyMv1i6RhtfPvLd7EMR9fC6/1wuFr65h1D2o+N5dnnxbJbslBrE++V/QAjCH+d/n
 aMQN/MFCmbcKgrp0L/IZ6MNnfUDcIVSPJzv8I89QlNDZ5p9ttKGHAaU/FY4V3yX+Ray68k7hTpfis
 3UNodxl7cRzH9bwTyU9HXhXJinRdfSmsmOia6+9ZHxnazpl/6XBZlo1WU+Vx0sLDGqpyazoFF8hr7
 Iy49IktM4oZzBGz0hJhSDgvAT62nSITBLQu4WKmRBXzFTNPXq9+1tA4M71j95OE67wH1gzfIUxstM
 Ws2y/Zs58pCVdA==;
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
In-Reply-To: <0d2d50291d3c0c7be10c8a535bf64dec49a4f1eb.1720093809.git.mail@HIDDEN>
 (Christopher Baines's message of "Thu, 4 Jul 2024 13:50:09 +0200")
References: <14fc15bdb8b5fd615fb93e025e86ccf70cf81814.1720093809.git.mail@HIDDEN>
 <0d2d50291d3c0c7be10c8a535bf64dec49a4f1eb.1720093809.git.mail@HIDDEN>
Date: Tue, 16 Jul 2024 12:05:56 +0200
Message-ID: <87wmllzm63.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

v3 LGTM, thanks!

Ludo=E2=80=99.





Last modified: Tue, 16 Jul 2024 10:15:02 UTC

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