tests: Add the builder as an input to raw derivations.

* tests/derivations.scm ("build derivation with 1 source",
  "derivation with local file as input",
  "derivation with a fixed-output input",
  "multiple-output derivation",
  "multiple-output derivation, non-alphabetic order",
  "user of multiple-output derivation"): Add %BASH as an input, needed
  in chroot builds.
This commit is contained in:
Ludovic Courtès 2013-11-04 23:06:13 +01:00
parent b8c3527828
commit bde2d9cf8d

View file

@ -125,7 +125,7 @@ (define prefix-len (string-length dir))
#:env-vars '(("HOME" . "/homeless") #:env-vars '(("HOME" . "/homeless")
("zzz" . "Z!") ("zzz" . "Z!")
("AAA" . "A!")) ("AAA" . "A!"))
#:inputs `((,builder)))) #:inputs `((,%bash) (,builder))))
(succeeded? (succeeded?
(build-derivations %store (list drv)))) (build-derivations %store (list drv))))
(and succeeded? (and succeeded?
@ -149,7 +149,8 @@ (define prefix-len (string-length dir))
;; builder. ;; builder.
#:env-vars `(("in" . ,input*)) #:env-vars `(("in" . ,input*))
#:inputs `((,builder) #:inputs `((,%bash)
(,builder)
(,input))))) ; ← local file name (,input))))) ; ← local file name
(and (build-derivations %store (list drv)) (and (build-derivations %store (list drv))
;; Note: we can't compare the files because the above trick alters ;; Note: we can't compare the files because the above trick alters
@ -211,11 +212,11 @@ (define prefix-len (string-length dir))
(final1 (derivation %store "final" (final1 (derivation %store "final"
%bash `(,builder3) %bash `(,builder3)
#:env-vars `(("in" . ,fixed-out)) #:env-vars `(("in" . ,fixed-out))
#:inputs `((,builder3) (,fixed1)))) #:inputs `((,%bash) (,builder3) (,fixed1))))
(final2 (derivation %store "final" (final2 (derivation %store "final"
%bash `(,builder3) %bash `(,builder3)
#:env-vars `(("in" . ,fixed-out)) #:env-vars `(("in" . ,fixed-out))
#:inputs `((,builder3) (,fixed2)))) #:inputs `((,%bash) (,builder3) (,fixed2))))
(succeeded? (build-derivations %store (succeeded? (build-derivations %store
(list final1 final2)))) (list final1 final2))))
(and succeeded? (and succeeded?
@ -231,7 +232,7 @@ (define prefix-len (string-length dir))
#:env-vars '(("HOME" . "/homeless") #:env-vars '(("HOME" . "/homeless")
("zzz" . "Z!") ("zzz" . "Z!")
("AAA" . "A!")) ("AAA" . "A!"))
#:inputs `((,builder)) #:inputs `((,%bash) (,builder))
#:outputs '("out" "second"))) #:outputs '("out" "second")))
(succeeded? (build-derivations %store (list drv)))) (succeeded? (build-derivations %store (list drv))))
(and succeeded? (and succeeded?
@ -251,7 +252,7 @@ (define prefix-len (string-length dir))
'())) '()))
(drv (derivation %store "fixed" (drv (derivation %store "fixed"
%bash `(,builder) %bash `(,builder)
#:inputs `((,builder)) #:inputs `((,%bash) (,builder))
#:outputs '("out" "AAA"))) #:outputs '("out" "AAA")))
(succeeded? (build-derivations %store (list drv)))) (succeeded? (build-derivations %store (list drv))))
(and succeeded? (and succeeded?
@ -285,7 +286,7 @@ (define prefix-len (string-length dir))
'())) '()))
(mdrv (derivation %store "multiple-output" (mdrv (derivation %store "multiple-output"
%bash `(,builder1) %bash `(,builder1)
#:inputs `((,builder1)) #:inputs `((,%bash) (,builder1))
#:outputs '("out" "two"))) #:outputs '("out" "two")))
(builder2 (add-text-to-store %store "my-mo-user-builder.sh" (builder2 (add-text-to-store %store "my-mo-user-builder.sh"
"read x < $one; "read x < $one;
@ -300,7 +301,8 @@ (define prefix-len (string-length dir))
("two" ("two"
. ,(derivation->output-path . ,(derivation->output-path
mdrv "two"))) mdrv "two")))
#:inputs `((,builder2) #:inputs `((,%bash)
(,builder2)
;; two occurrences of MDRV: ;; two occurrences of MDRV:
(,mdrv) (,mdrv)
(,mdrv "two"))))) (,mdrv "two")))))