From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48571) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfO01-0002tw-Ph for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfNzz-0001OA-LE for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfNzy-0001Ki-Ti for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfNzy-0003nI-ON for guix-patches@gnu.org; Mon, 24 Jun 2019 08:23:02 -0400 Subject: [bug#36351] [PATCH 03/10] ui: 'show-what-to-build' uses 'derivation-build-plan'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 24 Jun 2019 14:22:05 +0200 Message-Id: <20190624122212.5932-3-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/ui.scm (show-what-to-build)[build-or-substitutable?]: Remove. Use 'derivation-build-plan' instead of 'derivation-prerequisites-to-build', passing it all of DRV at once, and remove 'fold2' shenanigans and postprocessing of BUILD. --- guix/ui.scm | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 0b4fe144b6..3c67fbaa24 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -41,7 +41,6 @@ #:use-module (guix packages) #:use-module (guix profiles) #:use-module (guix derivations) - #:use-module (guix combinators) #:use-module (guix build-system) #:use-module (guix serialization) #:use-module ((guix licenses) #:select (license? license-name)) @@ -820,29 +819,12 @@ report what is prerequisites are available for download." (substitution-oracle store drv #:mode mode) (const #f))) - (define (built-or-substitutable? drv) - (or (null? (derivation-outputs drv)) - (let ((out (derivation->output-path drv))) ;XXX: assume "out" exists - (or (valid-path? store out) - (substitutable-info out))))) - (let*-values (((build download) - (fold2 (lambda (drv build download) - (let-values (((b d) - (derivation-prerequisites-to-build - store drv - #:mode mode - #:substitutable-info - substitutable-info))) - (values (append b build) - (append d download)))) - '() '() - drv)) - ((build) ; add the DRV themselves - (delete-duplicates - (append (map derivation-file-name - (remove built-or-substitutable? drv)) - (map derivation-input-path build)))) + (derivation-build-plan store + (map derivation-input drv) + #:mode mode + #:substitutable-info + substitutable-info)) ((download) ; add the references of DOWNLOAD (if use-substitutes? (delete-duplicates @@ -856,8 +838,8 @@ report what is prerequisites are available for download." download)))) download)) ((graft hook build) - (match (fold (lambda (file acc) - (let ((drv (read-derivation-from-file file))) + (match (fold (lambda (drv acc) + (let ((file (derivation-file-name drv))) (match acc ((#:graft graft #:hook hook #:build build) (cond -- 2.22.0