gexp: 'lower-inputs' uses 'mapm/accumulate-builds'.
authorLudovic Courtès <ludo@gnu.org>
Wed, 25 Mar 2020 11:43:49 +0000 (12:43 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 29 Mar 2020 13:32:17 +0000 (15:32 +0200)
This doesn't have an noticeable impact on the run time of
'guix system build desktop.tmp --no-grafts -d'.

* guix/gexp.scm (lower-inputs): Use 'mapm/accumulate-builds' instead of 'mapm'.

guix/gexp.scm

index 133e0f5..3d21685 100644 (file)
@@ -683,22 +683,22 @@ When TARGET is true, use it as the cross-compilation target triplet."
     (and (string? obj) (store-path? obj)))
 
   (with-monad %store-monad
-    (mapm %store-monad
-          (match-lambda
-            (((? struct? thing) sub-drv ...)
-             (mlet %store-monad ((obj (lower-object
-                                       thing system #:target target)))
-               (return (match obj
-                         ((? derivation? drv)
-                          (let ((outputs (if (null? sub-drv)
-                                             '("out")
-                                             sub-drv)))
-                            (derivation-input drv outputs)))
-                         ((? store-item? item)
-                          item)))))
-            (((? store-item? item))
-             (return item)))
-          inputs)))
+    (mapm/accumulate-builds
+     (match-lambda
+       (((? struct? thing) sub-drv ...)
+        (mlet %store-monad ((obj (lower-object
+                                  thing system #:target target)))
+          (return (match obj
+                    ((? derivation? drv)
+                     (let ((outputs (if (null? sub-drv)
+                                        '("out")
+                                        sub-drv)))
+                       (derivation-input drv outputs)))
+                    ((? store-item? item)
+                     item)))))
+       (((? store-item? item))
+        (return item)))
+     inputs)))
 
 (define* (lower-reference-graphs graphs #:key system target)
   "Given GRAPHS, a list of (FILE-NAME INPUT ...) lists for use as a