guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: packages: rust: Memoize make-rust-sysroot results.


From: guix-commits
Subject: 02/02: packages: rust: Memoize make-rust-sysroot results.
Date: Fri, 12 Jan 2024 07:07:44 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit d162bd0e724864ef1fcf8327c7dc3d2e9fd76665
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Jan 5 16:40:49 2024 +0000

    packages: rust: Memoize make-rust-sysroot results.
    
    To ensure that it just returns a single package record for some given
    arguments, as this helps to avoid poor performance of the store connection
    object cache.
    
    Performance with computing the cross derivations is important for the data
    service, as it's currently very slow to process revisions.
    
    * gnu/packages/rust.scm (make-rust-sysroot): Move code to
    make-rust-sysroot/implementation.
    (make-rust-sysroot/implementation): New variable.
    
    Change-Id: Ibb30c7398328c87c032bb8828635a34ada935167
---
 gnu/packages/rust.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index ea95d27476..64cde7ea14 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -60,6 +60,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix download)
+  #:use-module (guix memoization)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -1057,7 +1058,10 @@ exec -a \"$0\" \"~a\" \"$@\""
                             (package-native-inputs base-rust))))))
 
 (define*-public (make-rust-sysroot target)
-  (let ((base-rust rust))
+  (make-rust-sysroot/implementation target rust))
+
+(define make-rust-sysroot/implementation
+  (mlambda (target base-rust)
     (package
       (inherit base-rust)
       (name (string-append "rust-sysroot-for-" target))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]