From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48666) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfO05-0002yJ-8n for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfO02-0001WC-JZ for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfO02-0001Vf-Db for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfO02-0003oA-5r for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:06 -0400 Subject: [bug#36351] [PATCH 09/10] ui: 'show-what-to-build' accepts derivation inputs. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 24 Jun 2019 14:22:11 +0200 Message-Id: <20190624122212.5932-9-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 This is a followup to f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb. * guix/ui.scm (show-what-to-build)[inputs]: New variables. [substitutable-info]: Build the derivation list from INPUTS. Pass INPUTS to 'derivation-build-plan'. --- guix/ui.scm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 3c67fbaa24..bdcae34ee2 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -808,20 +808,28 @@ warning." #:key dry-run? (use-substitutes? #t) (mode (build-mode normal))) "Show what will or would (depending on DRY-RUN?) be built in realizing the -derivations listed in DRV using MODE, a 'build-mode' value. Return #t if -there's something to build, #f otherwise. When USE-SUBSTITUTES?, check and -report what is prerequisites are available for download." +derivations listed in DRV using MODE, a 'build-mode' value. The elements of +DRV can be either derivations or derivation inputs. + +Return #t if there's something to build, #f otherwise. When USE-SUBSTITUTES?, +check and report what is prerequisites are available for download." + (define inputs + (map (match-lambda + ((? derivation? drv) (derivation-input drv)) + ((? derivation-input? input) input)) + drv)) + (define substitutable-info ;; Call 'substitutation-oracle' upfront so we don't end up launching the ;; substituter many times. This makes a big difference, especially when ;; DRV is a long list as is the case with 'guix environment'. (if use-substitutes? - (substitution-oracle store drv #:mode mode) + (substitution-oracle store (map derivation-input-derivation inputs) + #:mode mode) (const #f))) (let*-values (((build download) - (derivation-build-plan store - (map derivation-input drv) + (derivation-build-plan store inputs #:mode mode #:substitutable-info substitutable-info)) -- 2.22.0