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>master
parent
c18052f5d0
commit
4b0aa65c0a
|
@ -6,6 +6,7 @@
|
||||||
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
||||||
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
|
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
|
||||||
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
|
||||||
|
;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -328,15 +329,17 @@ look up the development dependencs for the given crate."
|
||||||
(values #f '())))
|
(values #f '())))
|
||||||
|
|
||||||
(define* (crate-recursive-import crate-name #:key version)
|
(define* (crate-recursive-import crate-name #:key version)
|
||||||
(recursive-import crate-name
|
(recursive-import
|
||||||
#:repo->guix-package (lambda* params
|
crate-name
|
||||||
;; download development dependencies only for the top level package
|
#:repo->guix-package
|
||||||
(let ((include-dev-deps? (equal? (car params) crate-name))
|
(let ((crate->guix-package* (memoize crate->guix-package)))
|
||||||
(crate->guix-package* (memoize crate->guix-package)))
|
(lambda* params
|
||||||
(apply crate->guix-package*
|
;; download development dependencies only for the top level package
|
||||||
(append params `(#:include-dev-deps? ,include-dev-deps?)))))
|
(let ((include-dev-deps? (equal? (car params) crate-name)))
|
||||||
#:version version
|
(apply crate->guix-package*
|
||||||
#:guix-name crate-name->package-name))
|
(append params `(#:include-dev-deps? ,include-dev-deps?))))))
|
||||||
|
#:version version
|
||||||
|
#:guix-name crate-name->package-name))
|
||||||
|
|
||||||
(define (guix-package->crate-name package)
|
(define (guix-package->crate-name package)
|
||||||
"Return the crate name of PACKAGE."
|
"Return the crate name of PACKAGE."
|
||||||
|
|
Reference in New Issue