aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-11-11 17:39:46 +0000
committerChristopher Baines <mail@cbaines.net>2023-11-11 17:39:46 +0000
commit4eefc28cd3194ae8d607ba939d4b9735bb4bda61 (patch)
tree048f0503e6c0f9c1a51417908e7805f45f046f46
parent198a198130ecd3e2174f54276c1dc43e510d097c (diff)
downloadbuild-coordinator-4eefc28cd3194ae8d607ba939d4b9735bb4bda61.tar
build-coordinator-4eefc28cd3194ae8d607ba939d4b9735bb4bda61.tar.gz
Remove some caching from reading derivations
As I'm not sure this is helpful.
-rw-r--r--guix-build-coordinator/utils.scm45
1 files changed, 17 insertions, 28 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm
index 69cd743..dd27012 100644
--- a/guix-build-coordinator/utils.scm
+++ b/guix-build-coordinator/utils.scm
@@ -482,9 +482,6 @@ context."
(hash-set! %derivation-cache file drv)
drv)))))
-(define %derivation-cache
- (make-doubly-weak-hash-table))
-
(define (read-derivation-through-substitutes derivation-name
substitute-urls)
(define %fetch-timeout
@@ -571,31 +568,23 @@ context."
#f))
(error "could not fetch narinfo"))))
- (with-store/non-blocking store
- (define (read-derivation-from-file/custom derivation-name)
- (or (hash-ref %derivation-cache derivation-name)
-
- ;; Try the local store
- (and (file-exists? derivation-name)
- (valid-path? store derivation-name)
- (read-derivation-from-file* derivation-name))
-
- ;; Otherwise try the network
- (let ((drv
- (call-with-input-bytevector
- (derivation-name->bytevector derivation-name)
- (lambda (port)
- (set-port-filename! port derivation-name)
- (read-derivation port
- read-derivation-from-file/custom)))))
-
- (hash-set! %derivation-cache
- derivation-name
- drv)
-
- drv)))
-
- (read-derivation-from-file/custom derivation-name)))
+ (define (read-derivation-from-file/custom derivation-name)
+ ;; Try the local store
+ (or (and (file-exists? derivation-name)
+ (with-store/non-blocking
+ store
+ (valid-path? store derivation-name))
+ (read-derivation-from-file* derivation-name))
+
+ ;; Otherwise try the network
+ (call-with-input-bytevector
+ (derivation-name->bytevector derivation-name)
+ (lambda (port)
+ (set-port-filename! port derivation-name)
+ (read-derivation port
+ read-derivation-from-file/custom)))))
+
+ (read-derivation-from-file/custom derivation-name))
(define* (narinfo-string store-path hash size references
compressed-files