From patchwork Wed Jul 10 17:11:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 14566 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5080E171E2; Wed, 10 Jul 2019 18:13:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0A3BA171DD for ; Wed, 10 Jul 2019 18:13:22 +0100 (BST) Received: from localhost ([::1]:35548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlG9h-00087n-Ld for patchwork@mira.cbaines.net; Wed, 10 Jul 2019 13:13:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45441) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlG9U-0007n8-Ky for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlG9S-0003G9-MM for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlG9R-0003E2-Kw for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlG9R-0001Dt-EV for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36578] [PATCH 8/9] gexp: 'lowered-gexp-guile' now returns a . Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 10 Jul 2019 17:13:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36578 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36578@debbugs.gnu.org Received: via spool by 36578-submit@debbugs.gnu.org id=B36578.15627787344590 (code B ref 36578); Wed, 10 Jul 2019 17:13:05 +0000 Received: (at 36578) by debbugs.gnu.org; 10 Jul 2019 17:12:14 +0000 Received: from localhost ([127.0.0.1]:36543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG8c-0001By-E6 for submit@debbugs.gnu.org; Wed, 10 Jul 2019 13:12:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG8Z-0001B6-PH for 36578@debbugs.gnu.org; Wed, 10 Jul 2019 13:12:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hlG8U-00029n-Lf; Wed, 10 Jul 2019 13:12:06 -0400 Received: from [81.18.188.212] (port=57592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hlG8T-0005OT-K8; Wed, 10 Jul 2019 13:12:06 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 10 Jul 2019 19:11:27 +0200 Message-Id: <20190710171128.21568-8-ludo@gnu.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190710171128.21568-1-ludo@gnu.org> References: <20190710171128.21568-1-ludo@gnu.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/derivations.scm (derivation-input-output-path): New procedure. * guix/gexp.scm (lower-gexp): Wrap GUILE in a . (gexp->derivation): Adjust accordingly. * guix/remote.scm (remote-pipe-for-gexp, remote-eval): Adjust accordingly. * tests/gexp.scm ("lower-gexp"): Adjust accordingly. --- guix/derivations.scm | 8 ++++++++ guix/gexp.scm | 8 ++++---- guix/remote.scm | 4 ++-- tests/gexp.scm | 3 ++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/guix/derivations.scm b/guix/derivations.scm index 23d058e832..92d50503ce 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -71,6 +71,7 @@ derivation-input-derivation derivation-input-sub-derivations derivation-input-output-paths + derivation-input-output-path valid-derivation-input? &derivation-error @@ -221,6 +222,13 @@ download with a fixed hash (aka. `fetchurl')." (map (cut derivation->output-path drv <>) sub-drvs)))) +(define (derivation-input-output-path input) + "Return the output file name of INPUT. If INPUT has more than one outputs, +an error is raised." + (match input + (($ drv (output)) + (derivation->output-path drv output)))) + (define (valid-derivation-input? store input) "Return true if INPUT is valid--i.e., if all the outputs it requests are in the store." diff --git a/guix/gexp.scm b/guix/gexp.scm index 52643bd684..eef308b000 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -648,7 +648,7 @@ names and file names suitable for the #:allowed-references argument to (sexp lowered-gexp-sexp) ;sexp (inputs lowered-gexp-inputs) ;list of (sources lowered-gexp-sources) ;list of store items - (guile lowered-gexp-guile) ; | #f + (guile lowered-gexp-guile) ; | #f (load-path lowered-gexp-load-path) ;list of store items (load-compiled-path lowered-gexp-load-compiled-path)) ;list of store items @@ -755,7 +755,7 @@ derivations--e.g., code evaluated for its side effects." ,@(map derivation-input exts) ,@(filter derivation-input? inputs)) (filter string? (cons modules inputs)) - guile + (derivation-input guile '("out")) load-path load-compiled-path))))) @@ -889,7 +889,7 @@ The other arguments are as for 'derivation'." (mbegin %store-monad (set-grafting graft?) ;restore the initial setting (raw-derivation name - (string-append (derivation->output-path guile) + (string-append (derivation-input-output-path guile) "/bin/guile") `("--no-auto-compile" ,@(append-map (lambda (directory) @@ -902,7 +902,7 @@ The other arguments are as for 'derivation'." #:outputs outputs #:env-vars env-vars #:system system - #:inputs `(,(derivation-input guile '("out")) + #:inputs `(,guile ,@(lowered-gexp-inputs lowered) ,@(match graphs (((_ . inputs) ...) diff --git a/guix/remote.scm b/guix/remote.scm index 52ced16871..d49ee91b38 100644 --- a/guix/remote.scm +++ b/guix/remote.scm @@ -46,7 +46,7 @@ (compose object->string object->string)) (apply open-remote-pipe* session OPEN_READ - (string-append (derivation->output-path + (string-append (derivation-input-output-path (lowered-gexp-guile lowered)) "/bin/guile") "--no-auto-compile" @@ -95,7 +95,7 @@ remote store." (remote -> (connect-to-remote-daemon session socket-name))) (define inputs - (cons (derivation-input (lowered-gexp-guile lowered)) + (cons (lowered-gexp-guile lowered) (lowered-gexp-inputs lowered))) (define sources diff --git a/tests/gexp.scm b/tests/gexp.scm index a1f79e3435..460afe7f59 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -868,7 +868,8 @@ "/lib/guile/2.0/site-ccache") (lowered-gexp-load-compiled-path lexp)) (= 2 (length (lowered-gexp-load-compiled-path lexp))) - (eq? (lowered-gexp-guile lexp) (%guile-for-build))))))) + (eq? (derivation-input-derivation (lowered-gexp-guile lexp)) + (%guile-for-build))))))) (test-assertm "gexp->derivation #:references-graphs" (mlet* %store-monad