From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GBznJVdslmb7HgEA62LTzQ:P1 (envelope-from ) for ; Tue, 16 Jul 2024 12:49:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GBznJVdslmb7HgEA62LTzQ (envelope-from ) for ; Tue, 16 Jul 2024 14:49:27 +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=1721134167; 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=aAFuq32RTIlhnCcI21jRoT5aXxenlO5CeAKOzkw/h0w=; b=di9jzGSQq1RANK4wj2zxfb7xkBXfXijqv1zeSC39nNDd5Z3FF+LlZqdzTFce7sDXviyrNU tQtI8O8BcCzbp6Fw2pYlzXAL9/sOREkzktxjSmQnX6wWAEf/3NqXnB+L99LxqE+sceb2U6 qB59xIO+KL184Mww6NAbByXjs7spvs2dHVukcUS3Jza2BFRQE3nYlscHIuDG+VdFk5gfH6 Klg5BcL+5MuCNvVgWHUzjg9eLM9iWeJO/UGHvVP0geNBtEL8QJfuyo/k6C1QXlxs8edAEX +VmitAnDW7ag0XAZxJolbWO1eE+RtLXJ8UO7TesecfF5pPGiYstIuIQwtLu5jA== 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=1721134167; a=rsa-sha256; cv=none; b=pZPVZIB8TfsNeINnCdTcJblKUArIwOrYxBPWkQqyF+NUOFhFgnn3E3bz5HGHPV9Tb61xJT G/n6i8czqNb3EUJppNXs2cjNAeQCERVla4OHvVm8UfSIeG1yyW8sRVBLOSJV3ORaV5cGss nfv0D4BFSR+gWc99Akvflu1wJllWNrzl5jsYv7xPPQHI9GjkP/0GY1ZxTuyjGwzSLw0wna j+v2R1mYx/FgO0QxYYR9DojcfI5OhRb4bn0dqAYPOzaV5D8xTgs+uY91E7hYJJa3qzJPWd ofw59/4KcA/446JN6SGZOJGzvbvTjSt3YghrkeQxN5GHpKfqAe0fqMUVbnZyeA== 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 68A7D62BD5 for ; Tue, 16 Jul 2024 14:49:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sThc7-0001vL-Tv; Tue, 16 Jul 2024 08:49:03 -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 1sThc6-0001un-Rx for guix-patches@gnu.org; Tue, 16 Jul 2024 08:49:02 -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 1sThc6-0004Pl-Eh; Tue, 16 Jul 2024 08:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sThc6-0007nZ-K6; Tue, 16 Jul 2024 08:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71038] [PATCH v4 3/3] inferior: Use the host built-in-builders with inferior. 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: Tue, 16 Jul 2024 12:49: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.172113413729954 (code B ref 71038); Tue, 16 Jul 2024 12:49:02 +0000 Received: (at 71038) by debbugs.gnu.org; 16 Jul 2024 12:48:57 +0000 Received: from localhost ([127.0.0.1]:32917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sThc0-0007n2-Jo for submit@debbugs.gnu.org; Tue, 16 Jul 2024 08:48:56 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sThbv-0007mV-LD for 71038@debbugs.gnu.org; Tue, 16 Jul 2024 08:48:53 -0400 Received: from localhost (82-132-219-126.dab.02.net [82.132.219.126]) by mira.cbaines.net (Postfix) with ESMTPSA id 37EBF27BBEA for <71038@debbugs.gnu.org>; Tue, 16 Jul 2024 13:48:48 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id a6cb30a3 for <71038@debbugs.gnu.org>; Tue, 16 Jul 2024 12:48:37 +0000 (UTC) From: Christopher Baines Date: Tue, 16 Jul 2024 13:48:36 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <8075bccd0026e76f16f91d51c5b9203b5693b03e.1721134116.git.mail@cbaines.net> References: <8075bccd0026e76f16f91d51c5b9203b5693b03e.1721134116.git.mail@cbaines.net> 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-Migadu-Queue-Id: 68A7D62BD5 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.40 X-Spam-Score: -3.40 X-TUID: QFc4jeCnNusD Rather than querying the built-in-builders from the inferior, as using the host value allows specifying it when opening the connection. * guix/inferior.scm (port->inferior): Have cached-store-connection take the built-in-builders. (inferior-eval-with-store): Call cached-store-connection with the store connection built-in-builders. Change-Id: I27c20732355c0c6aa646748a02df39db302cd568 --- guix/inferior.scm | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/guix/inferior.scm b/guix/inferior.scm index 190ba01b3c..b60bf1ab01 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -253,7 +253,8 @@ (define* (port->inferior pipe #:optional (close close-port)) result) (inferior-eval '(begin (define %store-table (make-hash-table)) - (define (cached-store-connection store-id version) + (define (cached-store-connection store-id version + built-in-builders) ;; Cache connections to store ID. This ensures that ;; the caches within (in ;; particular the object cache) are reused across @@ -268,9 +269,19 @@ (define* (port->inferior pipe #:optional (close close-port)) ;; risk of talking to the wrong daemon or having ;; our build result reclaimed (XXX). (let ((store (if (defined? 'port->connection) - (port->connection %bridge-socket - #:version - version) + ;; #:built-in-builders was + ;; added in 2024 + (catch 'keyword-argument-error + (lambda () + (port->connection %bridge-socket + #:version + version + #:built-in-builders + built-in-builders)) + (lambda _ + (port->connection %bridge-socket + #:version + version))) (open-connection)))) (hashv-set! %store-table store-id store) store)))) @@ -690,11 +701,13 @@ (define (inferior-eval-with-store inferior store code) ;; The address of STORE itself is not a good identifier because it ;; keeps changing through the use of "functional caches". The ;; address of its socket port makes more sense. - (store-id (object-address (store-connection-socket store)))) + (store-id (object-address (store-connection-socket store))) + (store-built-in-builders (built-in-builders store))) (ensure-store-bridge! inferior) (send-inferior-request `(let ((proc ,code) - (store (cached-store-connection ,store-id ,proto))) + (store (cached-store-connection ,store-id ,proto + ',store-built-in-builders))) ;; Serialize '&store-protocol-error' conditions. The exception ;; serialization mechanism that 'read-repl-response' expects is ;; unsuitable for SRFI-35 error conditions, hence this special case. -- 2.45.2