aboutsummaryrefslogtreecommitdiff
path: root/tests/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-10-29 00:26:05 +0100
committerLudovic Courtès <ludo@gnu.org>2014-10-29 00:31:23 +0100
commitd2d0514b58bfddd061cd7f692bcc2075fdc33711 (patch)
treeaa189f4e1fbeb267e8c560ca996a096ac0798433 /tests/derivations.scm
parente6740741d188e01cb1a0b9c7db597a25128889d5 (diff)
downloadpatches-d2d0514b58bfddd061cd7f692bcc2075fdc33711.tar
patches-d2d0514b58bfddd061cd7f692bcc2075fdc33711.tar.gz
derivations: Fix 'derivation-prerequisites-to-build' when #:local-build?.
* guix/derivations.scm (derivation-prerequisites-to-build)[derivation-substitutable?]: Call 'substitutable-derivation?'. <body>: When 'substitutable-derivation?' returns #f, add DRV to BUILD.
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r--tests/derivations.scm25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 9073867793..29b341e2bb 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -562,7 +562,6 @@
;; prerequisite to build because DRV itself is already built.
(null? (derivation-prerequisites-to-build %store drv)))))
-(test-skip (if (getenv "GUIX_BINARY_SUBSTITUTE_URL") 0 1))
(test-assert "derivation-prerequisites-to-build and substitutes"
(let* ((store (open-connection))
(drv (build-expression->derivation store "prereq-subst"
@@ -583,6 +582,30 @@
(null? download*)
(null? build*))))))
+(test-assert "derivation-prerequisites-to-build and substitutes, local build"
+ (let* ((store (open-connection))
+ (drv (build-expression->derivation store "prereq-subst-local"
+ (random 1000)
+ ;; XXX: Adjust once
+ ;; <http://bugs.gnu.org/18747>
+ ;; is fixed.
+ #:local-build? #t))
+ (output (derivation->output-path drv)))
+
+ ;; Make sure substitutes are usable.
+ (set-build-options store #:use-substitutes? #t)
+
+ (with-derivation-narinfo drv
+ (let-values (((build download)
+ (derivation-prerequisites-to-build store drv)))
+ ;; Despite being available as a substitute, DRV will be built locally
+ ;; due to #:local-build?.
+ (and (null? download)
+ (match build
+ (((? derivation-input? input))
+ (string=? (derivation-input-path input)
+ (derivation-file-name drv)))))))))
+
(test-assert "build-expression->derivation with expression returning #f"
(let* ((builder '(begin
(mkdir %output)