From 43ee61b405b01038b3e7c84aba64521ab8a62236 Mon Sep 17 00:00:00 2001 From: Caleb Ristvedt Date: Wed, 6 May 2020 11:52:16 -0500 Subject: [PATCH 2/2] nar: 'with-temporary-store-file' uses a single connection Previously the 'with-store' form was entered every time a different temporary file was tried. This caused there to be as many simultaneous open connections as there were attempts, and prevented the (loop ...) call from being a tail call. This change fixes that. * guix/nar.scm (with-temporary-store-file): open connection once prior to entering the loop. --- guix/nar.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/nar.scm b/guix/nar.scm index f91af72879..404cef8b97 100644 --- a/guix/nar.scm +++ b/guix/nar.scm @@ -126,8 +126,8 @@ held." (define-syntax-rule (with-temporary-store-file name body ...) "Evaluate BODY with NAME bound to the file name of a temporary store item protected from GC." - (let loop ((name (temporary-store-file))) - (with-store store + (with-store store + (let loop ((name (temporary-store-file))) ;; Add NAME to the current process' roots. (Opening this connection to ;; the daemon allows us to reuse its code that deals with the ;; per-process roots file.) -- 2.26.2