From: Christopher Baines <mail@cbaines.net>
To: 71038@debbugs.gnu.org
Cc: "Christopher Baines" <guix@cbaines.net>,
"Josselin Poiret" <dev@jpoiret.xyz>,
"Ludovic Courtès" <ludo@gnu.org>,
"Mathieu Othacehe" <othacehe@gnu.org>,
"Simon Tournier" <zimon.toutoune@gmail.com>,
"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#71038] [PATCH v4 3/3] inferior: Use the host built-in-builders with inferior.
Date: Tue, 16 Jul 2024 13:48:36 +0100 [thread overview]
Message-ID: <a85396e292cdbbc044742004c449b52fe59d5362.1721134116.git.mail@cbaines.net> (raw)
In-Reply-To: <8075bccd0026e76f16f91d51c5b9203b5693b03e.1721134116.git.mail@cbaines.net>
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 <store-connection> (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
next prev parent reply other threads:[~2024-07-16 12:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-18 13:11 [bug#71038] [PATCH 0/2] Enable specifying the available builtin builders Christopher Baines
2024-05-18 13:19 ` [bug#71038] [PATCH 1/2] guix: store: " Christopher Baines
2024-05-18 13:19 ` [bug#71038] [PATCH 2/2] guix: channels: Enable specifiying " Christopher Baines
2024-05-22 10:58 ` [bug#71038] [PATCH 1/2] guix: store: Enable specifying the " Simon Tournier
2024-05-26 8:10 ` Christopher Baines
2024-05-27 17:19 ` Simon Tournier
2024-06-11 19:26 ` Christopher Baines
2024-06-24 13:43 ` [bug#71038] [PATCH v2 " Christopher Baines
2024-06-24 13:43 ` [bug#71038] [PATCH v2 2/2] guix: channels: Enable specifiying " Christopher Baines
2024-07-04 9:17 ` Ludovic Courtès
2024-07-04 9:14 ` [bug#71038] [PATCH v2 1/2] guix: store: Enable specifying the " Ludovic Courtès via Guix-patches
2024-07-04 11:50 ` [bug#71038] [PATCH v3 1/2] guix: store: Enable specifying the " Christopher Baines
2024-07-04 11:50 ` [bug#71038] [PATCH v3 2/2] guix: channels: Enable specifiying available " Christopher Baines
2024-07-16 10:05 ` Ludovic Courtès
2024-07-16 13:13 ` Christopher Baines
2024-07-16 12:48 ` [bug#71038] [PATCH v4 1/3] guix: store: Enable specifying the " Christopher Baines
2024-07-16 12:48 ` [bug#71038] [PATCH v4 2/3] guix: channels: Enable specifiying available " Christopher Baines
2024-07-16 12:48 ` Christopher Baines [this message]
2024-07-18 9:35 ` [bug#71038] [PATCH v4 3/3] inferior: Use the host built-in-builders with inferior Ludovic Courtès
2024-07-18 13:08 ` bug#71038: " Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a85396e292cdbbc044742004c449b52fe59d5362.1721134116.git.mail@cbaines.net \
--to=mail@cbaines.net \
--cc=71038@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=ludo@gnu.org \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).