aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Elsing <david.elsing@posteo.net>2023-12-21 22:01:49 +0000
committerEfraim Flashner <efraim@flashner.co.il>2024-01-09 09:38:38 +0200
commit4b0aa65c0a9301a70c798ea76a493f67ef8371f4 (patch)
tree5050556e0a9546473cf14fe0ef3a3667d7b25f0c
parentc18052f5d07daa16c7adeba580015f428f9a02be (diff)
downloadguix-4b0aa65c0a9301a70c798ea76a493f67ef8371f4.tar.gz
guix-4b0aa65c0a9301a70c798ea76a493f67ef8371f4.zip
gnu: import: Fix memoization in crate-recursive-import.
* guix/import/crate.scm (crate-recursive-import): Apply memoize outside the lambda passed to recursive-import in order to actually use the memoization. Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
-rw-r--r--guix/import/crate.scm21
1 files changed, 12 insertions, 9 deletions
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 43823d006e..07874bdb26 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -328,15 +329,17 @@ look up the development dependencs for the given crate."
(values #f '())))
(define* (crate-recursive-import crate-name #:key version)
- (recursive-import crate-name
- #:repo->guix-package (lambda* params
- ;; download development dependencies only for the top level package
- (let ((include-dev-deps? (equal? (car params) crate-name))
- (crate->guix-package* (memoize crate->guix-package)))
- (apply crate->guix-package*
- (append params `(#:include-dev-deps? ,include-dev-deps?)))))
- #:version version
- #:guix-name crate-name->package-name))
+ (recursive-import
+ crate-name
+ #:repo->guix-package
+ (let ((crate->guix-package* (memoize crate->guix-package)))
+ (lambda* params
+ ;; download development dependencies only for the top level package
+ (let ((include-dev-deps? (equal? (car params) crate-name)))
+ (apply crate->guix-package*
+ (append params `(#:include-dev-deps? ,include-dev-deps?))))))
+ #:version version
+ #:guix-name crate-name->package-name))
(define (guix-package->crate-name package)
"Return the crate name of PACKAGE."