summaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-09 10:30:03 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-09 14:29:41 +0100
commit58c08df0544bc39b3b5a8f6638f776159b6b8d8e (patch)
tree5f172e8bd62b708822babe11944585616c0e06be /guix/ui.scm
parentcc9553562c0b719c40083503795845aa0cc3a6f8 (diff)
downloadgnu-guix-58c08df0544bc39b3b5a8f6638f776159b6b8d8e.tar
gnu-guix-58c08df0544bc39b3b5a8f6638f776159b6b8d8e.tar.gz
derivations: Determine what's built in 'check' mode.
* guix/derivations.scm (substitution-oracle): Add #:mode parameter and honor it. (derivation-prerequisites-to-build): Likewise. [derivation-built?]: Take it into account. * guix/ui.scm (show-what-to-build): Add #:mode parameter. Pass it to 'substitute-oracle' and 'derivations-prerequisites-to-build'. * tests/derivations.scm ("derivation-prerequisites-to-build in 'check' mode"): New test.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 581fb941f5..35a6671a07 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -531,17 +531,18 @@ error."
(derivation-outputs derivation))))
(define* (show-what-to-build store drv
- #:key dry-run? (use-substitutes? #t))
+ #: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. 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. Return #t if
+there's something to build, #f otherwise. When USE-SUBSTITUTES?, check and
+report what is prerequisites are available for download."
(define substitutable?
;; 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)
+ (substitution-oracle store drv #:mode mode)
(const #f)))
(define (built-or-substitutable? drv)
@@ -555,6 +556,7 @@ available for download."
(let-values (((b d)
(derivation-prerequisites-to-build
store drv
+ #:mode mode
#:substitutable? substitutable?)))
(values (append b build)
(append d download))))