[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14/16: download: 'built-in-builders*' relies on the functional cache.
From: |
Ludovic Courtès |
Subject: |
14/16: download: 'built-in-builders*' relies on the functional cache. |
Date: |
Wed, 28 Jun 2017 17:48:56 -0400 (EDT) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 33913a04880e553740d55e1692b8d2939596f245
Author: Ludovic Courtès <address@hidden>
Date: Mon Jun 26 23:09:39 2017 +0200
download: 'built-in-builders*' relies on the functional cache.
The previous caching strategy, which used STORE as an 'eq?' key, would
no longer work when the functional cache is used because subsequent
store values are not 'eq?'.
* guix/download.scm (built-in-builders*): Rewrite in terms of
'mcached'.
---
guix/download.scm | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/guix/download.scm b/guix/download.scm
index bed1f50..8d94eee 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <address@hidden>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès
<address@hidden>
;;; Copyright © 2013, 2014, 2015 Andreas Enge <address@hidden>
;;; Copyright © 2015 Federico Beffa <address@hidden>
;;; Copyright © 2016 Alex Griffin <address@hidden>
@@ -314,17 +314,11 @@
(module-ref module 'gnutls)))
(define built-in-builders*
- (let ((cache (make-weak-key-hash-table)))
+ (let ((proc (store-lift built-in-builders)))
(lambda ()
"Return, as a monadic value, the list of built-in builders supported by
-the daemon."
- (lambda (store)
- ;; Memoize the result to avoid repeated RPCs.
- (values (or (hashq-ref cache store)
- (let ((result (built-in-builders store)))
- (hashq-set! cache store result)
- result))
- store)))))
+the daemon; cache the return value."
+ (mcached (proc) built-in-builders))))
(define* (built-in-download file-name url
#:key system hash-algo hash
- branch wip-build-systems-gexp created (now 6ce5f33), Ludovic Courtès, 2017/06/28
- 08/16: packages: Simplify patch instantiation., Ludovic Courtès, 2017/06/28
- 03/16: gexp: Micro-optimize sexp serialization., Ludovic Courtès, 2017/06/28
- 04/16: tests: Add 'test-assertm' to (guix tests)., Ludovic Courtès, 2017/06/28
- 13/16: utils: Memoize 'absolute-dirname'., Ludovic Courtès, 2017/06/28
- 12/16: gexp: 'local-file' calls 'canonicalize-path' only in rare cases., Ludovic Courtès, 2017/06/28
- 14/16: download: 'built-in-builders*' relies on the functional cache.,
Ludovic Courtès <=
- 01/16: gnu: bootstrap: Move 'use-modules' forms to the beginning of build expressions., Ludovic Courtès, 2017/06/28
- 15/16: store: Add 'GUIX_PROFILING' support for the object cache., Ludovic Courtès, 2017/06/28
- 09/16: Use 'mapm' instead of 'sequence' + 'map'., Ludovic Courtès, 2017/06/28
- 05/16: packages: Turn 'bag->derivation' into a monadic procedure., Ludovic Courtès, 2017/06/28
- 11/16: packages: Turn 'cache!' into a single-value-return cache., Ludovic Courtès, 2017/06/28
- 06/16: store: Add a functional object cache and use it in 'lower-object'., Ludovic Courtès, 2017/06/28
- 10/16: gexp: 'imported-files' takes file-like objects., Ludovic Courtès, 2017/06/28
- 07/16: DRAFT gexp: Handle list conversion to <gexp-input> in the expanded code., Ludovic Courtès, 2017/06/28
- 16/16: packages: Core procedures are written in monadic style., Ludovic Courtès, 2017/06/28
- 02/16: build-system: Rewrite using gexps., Ludovic Courtès, 2017/06/28