[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/13: store: 'map/accumulate-builds' preserves caches.
From: |
guix-commits |
Subject: |
01/13: store: 'map/accumulate-builds' preserves caches. |
Date: |
Mon, 30 May 2022 10:37:09 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 1ae0e1dc29109cef20dbe9d26eb1c855694716b5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon May 30 15:58:05 2022 +0200
store: 'map/accumulate-builds' preserves caches.
Fixes <https://issues.guix.gnu.org/55721>.
Starting from the switch to functional object caches ca.
9e5812ac59b01ff011ec0c5b0f437dfe85d6fcc7, we would be losing accumulated
caches when aborting to the build handler. This patch fixes that.
In particular, by preserving '%reference-cache-id', we avoid redundant
'query-references' RPCs, which accounted for a large part of the extra
processing time.
* guix/store.scm (build-accumulator): When returning an <unresolved>
node, call 'set-store-connection-caches!' before and after to preserve
caches.
(map/accumulate-builds): Pass STORE as the first argument to
the <unresolved> continuation.
---
guix/store.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/guix/store.scm b/guix/store.scm
index efba07bdcd..6bdd071b48 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1337,7 +1337,17 @@ object, only for build requests on EXPECTED-STORE."
(if (and (eq? (store-connection-socket store)
(store-connection-socket expected-store))
(= mode (build-mode normal)))
- (unresolved things continue)
+ (begin
+ ;; Preserve caches accumulated up to this handler invocation.
+ (set-store-connection-caches! expected-store
+ (store-connection-caches store))
+
+ (unresolved things
+ (lambda (new-store value)
+ ;; Borrow caches from NEW-STORE.
+ (set-store-connection-caches!
+ store (store-connection-caches new-store))
+ (continue value))))
(continue #t))))
(define default-cutoff
@@ -1397,7 +1407,8 @@ CUTOFF is the threshold above which we stop accumulating
unresolved nodes."
(if (unresolved? obj)
;; Pass #f because 'build-things' is
now
;; unnecessary.
- ((unresolved-continuation obj) #f)
+ ((unresolved-continuation obj)
+ store #f)
obj))
result #:cutoff cutoff)
(map/accumulate-builds store proc rest #:cutoff cutoff)))))
- 05/13: gnu: GCC: Add cross environment variables patch to GCC 12., (continued)
- 05/13: gnu: GCC: Add cross environment variables patch to GCC 12., guix-commits, 2022/05/30
- 06/13: gnu: rsync: Update to 3.2.4., guix-commits, 2022/05/30
- 04/13: gnu: emacs-w3m: Update to 20220508.2259., guix-commits, 2022/05/30
- 08/13: gnu: xpad: Update to 5.8.0., guix-commits, 2022/05/30
- 03/13: gnu: tor: Record the file name of 'torsocks' in 'torify'., guix-commits, 2022/05/30
- 10/13: gnu: rspamd: Update to 3.2, guix-commits, 2022/05/30
- 11/13: gnu: emacs-vterm: Update to 0.0.1-1.b447235., guix-commits, 2022/05/30
- 07/13: gnu: casync: Update to 99559cd1., guix-commits, 2022/05/30
- 09/13: gnu: pre-commit: Update to 2.19.0., guix-commits, 2022/05/30
- 13/13: gnu: calceph: Add 'release-monitoring-url' property., guix-commits, 2022/05/30
- 01/13: store: 'map/accumulate-builds' preserves caches.,
guix-commits <=
- 12/13: gnu: Add calceph., guix-commits, 2022/05/30