guix-commits
[Top][All Lists]
Advanced

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

13/15: ui: 'show-what-to-build' accepts derivation inputs.


From: guix-commits
Subject: 13/15: ui: 'show-what-to-build' accepts derivation inputs.
Date: Thu, 27 Jun 2019 05:15:46 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit d38d4ffa10d74e361e15e18d04898eb5af3fb2eb
Author: Ludovic Court├Ęs <address@hidden>
Date:   Sun Jun 23 18:35:26 2019 +0200

    ui: 'show-what-to-build' accepts derivation inputs.
    
    This is a followup to f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb.
    
    * guix/ui.scm (show-what-to-build)[inputs]: New variables.
    [substitutable-info]: Build the derivation list from INPUTS.
    Pass INPUTS to 'derivation-build-plan'.
---
 guix/ui.scm | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 9748471..630afa4 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -812,20 +812,28 @@ warning."
                              #:key dry-run? (use-substitutes? #t)
                              (mode (build-mode normal)))
   "Show what will or would (depending on DRY-RUN?) be built in realizing the
-derivations listed in DRV using MODE, a 'build-mode' value.  Return #t if
-there's something to build, #f otherwise.  When USE-SUBSTITUTES?, check and
-report what is prerequisites are available for download."
+derivations listed in DRV using MODE, a 'build-mode' value.  The elements of
+DRV can be either derivations or derivation inputs.
+
+Return #t if there's something to build, #f otherwise.  When USE-SUBSTITUTES?,
+check and report what is prerequisites are available for download."
+  (define inputs
+    (map (match-lambda
+           ((? derivation? drv) (derivation-input drv))
+           ((? derivation-input? input) input))
+         drv))
+
   (define substitutable-info
     ;; Call 'substitutation-oracle' upfront so we don't end up launching the
     ;; substituter many times.  This makes a big difference, especially when
     ;; DRV is a long list as is the case with 'guix environment'.
     (if use-substitutes?
-        (substitution-oracle store drv #:mode mode)
+        (substitution-oracle store (map derivation-input-derivation inputs)
+                             #:mode mode)
         (const #f)))
 
   (let*-values (((build download)
-                 (derivation-build-plan store
-                                        (map derivation-input drv)
+                 (derivation-build-plan store inputs
                                         #:mode mode
                                         #:substitutable-info
                                         substitutable-info))



reply via email to

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