From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48613) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfO03-0002w6-K6 for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfO01-0001Tc-OY for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfO00-0001RX-UF for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfO00-0003nm-Oq for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:04 -0400 Subject: [bug#36351] [PATCH 07/10] derivations: 'build-derivations' can be passed derivation inputs. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 24 Jun 2019 14:22:09 +0200 Message-Id: <20190624122212.5932-7-ludo@gnu.org> In-Reply-To: <20190624122212.5932-1-ludo@gnu.org> References: <20190624122212.5932-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36351@debbugs.gnu.org * guix/derivations.scm (build-derivations): Accept 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 403e86749b..433b4551a5 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 54fa588969..d173a78906 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))) -- 2.22.0