From: Efraim Flashner <efraim@flashner.co.il>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 74654@debbugs.gnu.org
Subject: [bug#74654] [PATCH 3/5] build-system/cargo: Simplify ‘crate-closure’.
Date: Mon, 2 Dec 2024 21:11:56 +0200 [thread overview]
Message-ID: <Z04GfLn2_VtC6LPR@3900XT> (raw)
In-Reply-To: <c74974c8ffac0c9a33f4fd57535457bc8229dc71.1733158049.git.ludo@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2701 bytes --]
I test applied this on master and then went to build my rusty-packages
manifest. The time on './pre-inst-env guix build -m ... -n' went from 35
seconds to 20 seconds and the derivations didn't change.
On Mon, Dec 02, 2024 at 05:53:28PM +0100, Ludovic Courtès wrote:
> * guix/build-system/cargo.scm (crate-closure): Remove ‘first?’.
>
> Change-Id: Ica1a661eb422a882ae3a1a54819b2dd7d68449de
> ---
> guix/build-system/cargo.scm | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
> index 658a2e525e..0e9a4b1d23 100644
> --- a/guix/build-system/cargo.scm
> +++ b/guix/build-system/cargo.scm
> @@ -1,5 +1,5 @@
> ;;; GNU Guix --- Functional package management for GNU
> -;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2013-2016, 2019, 2021, 2024 Ludovic Courtès <ludo@gnu.org>
> ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
> ;;; Copyright © 2016 David Craven <david@craven.ch>
> @@ -227,24 +227,22 @@ (define (crate-closure inputs)
> (let loop ((inputs inputs)
> (result '())
> (propagated '())
> - (first? #t)
> (seen vlist-null))
> (match inputs
> (()
> (if (null? propagated)
> (reverse result)
> - (loop (reverse (concatenate propagated)) result '() #f seen)))
> + (loop (reverse (concatenate propagated)) result '() seen)))
> (((and input (label (? package? package))) rest ...)
> - (if (and (not first?) (seen? seen package))
> - (loop rest result propagated first? seen)
> + (if (seen? seen package)
> + (loop rest result propagated seen)
> (loop rest
> (cons input result)
> (cons (package-cargo-inputs package)
> propagated)
> - first?
> (vhash-consq package package seen))))
> ((input rest ...)
> - (loop rest (cons input result) propagated first? seen)))))
> + (loop rest (cons input result) propagated seen)))))
>
> (define (expand-crate-sources cargo-inputs cargo-development-inputs)
> "Extract all transitive sources for CARGO-INPUTS and CARGO-DEVELOPMENT-INPUTS
> --
> 2.46.0
>
>
>
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-12-02 19:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 16:51 [bug#74654] [PATCH 0/5] Optimize 'all-packages'; add ungrafting manifest Ludovic Courtès
2024-12-02 16:53 ` [bug#74654] [PATCH 1/5] etc: Move manifests to a separate directory Ludovic Courtès
2024-12-03 3:05 ` Z572
2024-12-04 16:32 ` Ludovic Courtès
2024-12-02 16:53 ` [bug#74654] [PATCH 2/5] packages: Optimize ‘all-packages’ Ludovic Courtès
2024-12-02 23:47 ` David Elsing
2024-12-04 16:34 ` Ludovic Courtès
2024-12-10 14:05 ` Simon Tournier
2024-12-02 16:53 ` [bug#74654] [PATCH 3/5] build-system/cargo: Simplify ‘crate-closure’ Ludovic Courtès
2024-12-02 19:11 ` Efraim Flashner [this message]
2024-12-02 22:24 ` Ludovic Courtès
2024-12-02 16:53 ` [bug#74654] [PATCH 4/5] guix build: Last argument of ‘dependents’ is optional Ludovic Courtès
2024-12-02 16:53 ` [bug#74654] [PATCH 5/5] maint: Add ungrafting manifest Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z04GfLn2_VtC6LPR@3900XT \
--to=efraim@flashner.co.il \
--cc=74654@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).