aboutsummaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-10 22:10:21 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-10 22:42:59 +0200
commitf8a9f99cd602ce1dc5307cb0c21ae718ad8796bb (patch)
treedca6c6f3b0b95083be5d37e636d3c338f109eeba /tests/store.scm
parent416a7c69f1d788670f0c4a7ffaed3e032eadc91d (diff)
downloadguix-f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb.tar
guix-f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb.tar.gz
store: 'build-things' accepts derivation/output pairs.
This allows callers to request the substitution of a single derivation output. * guix/store.scm (build-things): Accept derivation/output pairs among THINGS. * guix/derivations.scm (build-derivations): Likewise. * tests/store.scm ("substitute + build-things with specific output"): New test. * tests/derivations.scm ("build-derivations with specific output"): New test. * doc/guix.texi (The Store): Adjust accordingly.
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm
index df66feaebb..518750d26a 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -599,6 +599,26 @@
(valid-path? s o)
(equal? c (call-with-input-file o get-string-all)))))))
+(test-assert "substitute + build-things with specific output"
+ (with-store s
+ (let* ((c (random-text)) ;contents of the output
+ (d (build-expression->derivation
+ s "substitute-me" `(begin ,c (exit 1)) ;would fail
+ #:outputs '("out" "one" "two")
+ #:guile-for-build
+ (package-derivation s %bootstrap-guile (%current-system))))
+ (o (derivation->output-path d)))
+ (with-derivation-substitute d c
+ (set-build-options s #:use-substitutes? #t
+ #:substitute-urls (%test-substitute-urls))
+ (and (has-substitutes? s o)
+
+ ;; Ask for nothing but the "out" output of D.
+ (build-things s `((,(derivation-file-name d) . "out")))
+
+ (valid-path? s o)
+ (equal? c (call-with-input-file o get-string-all)))))))
+
(test-assert "substitute, corrupt output hash"
;; Tweak the substituter into installing a substitute whose hash doesn't
;; match the one announced in the narinfo. The daemon must notice this and