derivations: 'build-derivations' can be passed derivation inputs.
* guix/derivations.scm (build-derivations): Accept <derivation-input> records among DERIVATIONS. * tests/derivations.scm ("build-derivations with specific output"): Test it.
This commit is contained in:
parent
fd951cd543
commit
7c690a4738
|
@ -1016,6 +1016,11 @@ derivation/output pairs, using the specified MODE."
|
||||||
(build-things store (map (match-lambda
|
(build-things store (map (match-lambda
|
||||||
((? derivation? drv)
|
((? derivation? drv)
|
||||||
(derivation-file-name drv))
|
(derivation-file-name drv))
|
||||||
|
((? derivation-input? input)
|
||||||
|
(cons (derivation-input-path input)
|
||||||
|
(string-join
|
||||||
|
(derivation-input-sub-derivations input)
|
||||||
|
",")))
|
||||||
((? string? file) file)
|
((? string? file) file)
|
||||||
(((? derivation? drv) . output)
|
(((? derivation? drv) . output)
|
||||||
(cons (derivation-file-name drv)
|
(cons (derivation-file-name drv)
|
||||||
|
|
|
@ -807,9 +807,12 @@
|
||||||
;; Ask for nothing but the "out" output of DRV.
|
;; Ask for nothing but the "out" output of DRV.
|
||||||
(build-derivations store `((,drv . "out")))
|
(build-derivations store `((,drv . "out")))
|
||||||
|
|
||||||
|
;; Synonymous:
|
||||||
|
(build-derivations store (list (derivation-input drv '("out"))))
|
||||||
|
|
||||||
(valid-path? store out)
|
(valid-path? store out)
|
||||||
(equal? (pk 'x content) (pk 'y (call-with-input-file out get-string-all)))
|
(equal? (pk 'x content)
|
||||||
)))))
|
(pk 'y (call-with-input-file out get-string-all))))))))
|
||||||
|
|
||||||
(test-assert "build-expression->derivation and derivation-build-plan"
|
(test-assert "build-expression->derivation and derivation-build-plan"
|
||||||
(let ((drv (build-expression->derivation %store "fail" #f)))
|
(let ((drv (build-expression->derivation %store "fail" #f)))
|
||||||
|
|
Loading…
Reference in New Issue