From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id oPYiKBirSGZ9lwAAe85BDQ:P1 (envelope-from ) for ; Sat, 18 May 2024 15:20:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oPYiKBirSGZ9lwAAe85BDQ (envelope-from ) for ; Sat, 18 May 2024 15:20:24 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716038424; 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=Sovgqsuls6qBSpBpAdynlX+PTUouUrePYN1nXXO4RlM=; b=FXp8ucEbBKbSKwUBoJCglNe0crQYi2jWmWSGliVsijnwyyF/QVxjHM14peKgl9M0TLlUEo 2gmwx5LeERNA7uEIwmVbpbYss3oLjynJ/ZPokiNQ4K/PO6RWaCnsMNzf0s0tpGnRa03vno +w3innn0K9kNtHEjf5FegbeOSkzErW2D5dpbZN9duR9/05fOxMnPhg+0WnrjqE2Y1fShV8 STuilf0veJYkl1LWEircWdoqWUQIQfNxLrftwjp1880Hi+Fg9E5ALroHvmkeIatXlzIeBw RCWVl1ZoUENie74mv21A2pGG2zb8ybNRbFdUdp8NOvJNi1R0Rab/sTC7XjWYTA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716038424; a=rsa-sha256; cv=none; b=mesdChtpCIEWMG6RpyoJd3OtPHjn0fXYPpO2bWhUJThrgLJtw/gU7u0CY6xhRpxiPCDN97 gDdJEHStaNu4PC1x9ZmZ2wFYfw+R5hRrVd+ETXxJuBPd36Y3xrDHtCHv+3PrRWe9fPtOTA Az5kyp1zad9hv8++zyxyIHBT1IbuI4KeSzGJ0C5XHvd0A7zX0LAeXRiI6VqE5kt7Jgxzd4 X9T1BuUKCMa8xOIdRStvlmWJ1lqKmutlsLGmQCHD9aGdLlLtRZlKljiAiuoTS5EmPgeAJb 4Hmx7c880t2y+S5QKYO5tGLrNOHgHh+P2UoYrpf/70XRJJvNyVfejew99qpMTQ== 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 7C7EE20FF9 for ; Sat, 18 May 2024 15:20:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8Jyp-0002Hu-62; Sat, 18 May 2024 09:20:07 -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 1s8Jym-0002Hb-23 for guix-patches@gnu.org; Sat, 18 May 2024 09:20: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 1s8Jyj-0005Mb-OA; Sat, 18 May 2024 09:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s8Jyk-0006AM-95; Sat, 18 May 2024 09:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71038] [PATCH 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, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 18 May 2024 13:20: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 , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 71038-submit@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 ) id 1s8JyR-00069r-IK for submit@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 ) id 1s8JyQ-00069f-6r for 71038@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@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@debbugs.gnu.org>; Sat, 18 May 2024 13:19:35 +0000 (UTC) From: Christopher Baines Date: Sat, 18 May 2024 14:19:34 +0100 Message-ID: <6b9c634c024b6fd7a50d3b82edc244676a8ca8e8.1716038375.git.mail@cbaines.net> X-Mailer: git-send-email 2.41.0 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -3.36 X-Migadu-Queue-Id: 7C7EE20FF9 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -3.36 X-TUID: 1K2+08ctWD7X 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 | 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