guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/15: derivations: 'build-derivations' can be passed derivation inputs.


From: guix-commits
Subject: 11/15: derivations: 'build-derivations' can be passed derivation inputs.
Date: Thu, 27 Jun 2019 05:15:46 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 7c690a47381f645ec5ec0a1fd6ffc34dba1b69c2
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jun 23 12:39:39 2019 +0200

    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.
---
 guix/derivations.scm  | 5 +++++
 tests/derivations.scm | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index 403e867..433b455 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -1016,6 +1016,11 @@ derivation/output pairs, using the specified MODE."
   (build-things store (map (match-lambda
                             ((? derivation? drv)
                              (derivation-file-name drv))
+                            ((? derivation-input? input)
+                             (cons (derivation-input-path input)
+                                   (string-join
+                                    (derivation-input-sub-derivations input)
+                                    ",")))
                             ((? string? file) file)
                             (((? derivation? drv) . output)
                              (cons (derivation-file-name drv)
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 54fa588..d173a78 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -807,9 +807,12 @@
              ;; Ask for nothing but the "out" output of DRV.
              (build-derivations store `((,drv . "out")))
 
+             ;; Synonymous:
+             (build-derivations store (list (derivation-input drv '("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"
   (let ((drv (build-expression->derivation %store "fail" #f)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]