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:
Ludovic Courtès 2019-06-23 12:39:39 +02:00
parent fd951cd543
commit 7c690a4738
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 10 additions and 2 deletions

View File

@ -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)

View File

@ -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)))