guix-commits
[Top][All Lists]
Advanced

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

07/15: ui: 'show-what-to-build' uses 'derivation-build-plan'.


From: guix-commits
Subject: 07/15: ui: 'show-what-to-build' uses 'derivation-build-plan'.
Date: Thu, 27 Jun 2019 05:15:45 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 9844d0091ec533ee6de2d051ef12a077de98cf42
Author: Ludovic Court├Ęs <address@hidden>
Date:   Wed Jun 19 22:21:28 2019 +0200

    ui: 'show-what-to-build' uses 'derivation-build-plan'.
    
    * guix/ui.scm (show-what-to-build)[build-or-substitutable?]: Remove.
    Use 'derivation-build-plan' instead of
    'derivation-prerequisites-to-build', passing it all of DRV at once, and
    remove 'fold2' shenanigans and postprocessing of BUILD.
---
 guix/ui.scm | 32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 363ef36..9748471 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -41,7 +41,6 @@
   #:use-module (guix packages)
   #:use-module (guix profiles)
   #:use-module (guix derivations)
-  #:use-module (guix combinators)
   #:use-module (guix build-system)
   #:use-module (guix serialization)
   #:use-module ((guix licenses) #:select (license? license-name))
@@ -824,29 +823,12 @@ report what is prerequisites are available for download."
         (substitution-oracle store drv #:mode mode)
         (const #f)))
 
-  (define (built-or-substitutable? drv)
-    (or (null? (derivation-outputs drv))
-        (let ((out (derivation->output-path drv))) ;XXX: assume "out" exists
-          (or (valid-path? store out)
-              (substitutable-info out)))))
-
   (let*-values (((build download)
-                 (fold2 (lambda (drv build download)
-                          (let-values (((b d)
-                                        (derivation-prerequisites-to-build
-                                         store drv
-                                         #:mode mode
-                                         #:substitutable-info
-                                         substitutable-info)))
-                            (values (append b build)
-                                    (append d download))))
-                        '() '()
-                        drv))
-                ((build)                          ; add the DRV themselves
-                 (delete-duplicates
-                  (append (map derivation-file-name
-                               (remove built-or-substitutable? drv))
-                          (map derivation-input-path build))))
+                 (derivation-build-plan store
+                                        (map derivation-input drv)
+                                        #:mode mode
+                                        #:substitutable-info
+                                        substitutable-info))
                 ((download)                   ; add the references of DOWNLOAD
                  (if use-substitutes?
                      (delete-duplicates
@@ -860,8 +842,8 @@ report what is prerequisites are available for download."
                                            download))))
                      download))
                 ((graft hook build)
-                 (match (fold (lambda (file acc)
-                                (let ((drv (read-derivation-from-file file)))
+                 (match (fold (lambda (drv acc)
+                                (let ((file (derivation-file-name drv)))
                                   (match acc
                                     ((#:graft graft #:hook hook #:build build)
                                      (cond



reply via email to

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