From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cCmpDTl4eWZJJgAAe85BDQ:P1 (envelope-from ) for ; Mon, 24 Jun 2024 13:44:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cCmpDTl4eWZJJgAAe85BDQ (envelope-from ) for ; Mon, 24 Jun 2024 15:44:25 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719236665; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=3ExsTNz5aOCJrzmaVQFmaqyJasMBIA/vIhP2VXELnoc=; b=tGm/YZ2/bucN1HsLuSN00CoFsgcVLuEzP9EznyMJ7emlRleh4a4CfwEXI+KKex8TKfemGh +aEUC/MunYWIoPKd/DrDFr7Epm6j7zM/tuO+Dv25VdkNVVtalFe46JVvhl9NqWnf7iJPjD BzRpF092SGJM5n8SBMNxfW1pl37OvIZG9vsIHhdIMCNKDDN1QFYM+hSDebPuIsTE6hnyDq POwh8/ghyvG9mnmTHQiOeAkArok+whcYIxbmRedoasOkN25uhx9ts7kZjPnYQgWKbkyyOU 2ax8wdN2J/CHvmrVdwEyJs37Uc5axE/j56WVDtM3O4sbvNdYAO0nSrJARs4t4g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719236665; a=rsa-sha256; cv=none; b=XrQK6RzZX5WARRwnY0LReOfkYiWOTFBxTIGI0v+8OmCL1QreTe8vAA5NmaLqZANzHjKdfp TBlmo8t4TdFESqceTYqe/I0Hx1Y2DnQrS6fkEOtK00cDp4mSlc5TWZyrTcBkZiCffvvNNj D6sTA30OGmycHt4n+OJz8JV9seporxhhdLlHCMuUioAHPkSTCQ5xH/p4njMmMP1/VooMTk r+crJiH7HWoBFiqlou76LMTdRbNIWTocUCOUWj7inb9ajwns3upvf4++VgYcd+lYlecGez goSAJ+jAB26E4X6SePr7gDpxgxhZSiqrQdQbewfjTGbHm4vrW1aLZxWnlO3Few== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 031CA3777B for ; Mon, 24 Jun 2024 15:44:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLjzM-0001uk-7M; Mon, 24 Jun 2024 09:44:08 -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 ) id 1sLjzI-0001to-Im for guix-patches@gnu.org; Mon, 24 Jun 2024 09:44:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLjzH-0003nk-U3; Mon, 24 Jun 2024 09:44:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLjzG-0004NC-OZ; Mon, 24 Jun 2024 09:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71038] [PATCH v2 1/2] guix: store: Enable specifying the available builtin builders. References: <87y187b6xv.fsf@cbaines.net> In-Reply-To: <87y187b6xv.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 24 Jun 2024 13:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71038 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71038@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 71038-submit@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 ) id 1sLjz7-0004MR-6O for submit@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 ) id 1sLjz3-0004M4-Ku for 71038@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@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@debbugs.gnu.org>; Mon, 24 Jun 2024 13:43:46 +0000 (UTC) From: Christopher Baines Date: Mon, 24 Jun 2024 14:43:45 +0100 Message-ID: X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 031CA3777B X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -3.36 X-Spam-Score: -3.36 X-TUID: bTj6bNPmOmHT 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: . 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