unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 74654@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Efraim Flashner" <efraim@flashner.co.il>
Subject: [bug#74654] [PATCH 3/5] build-system/cargo: Simplify ‘crate-closure’.
Date: Mon,  2 Dec 2024 17:53:28 +0100	[thread overview]
Message-ID: <c74974c8ffac0c9a33f4fd57535457bc8229dc71.1733158049.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1733158049.git.ludo@gnu.org>

* 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





  parent reply	other threads:[~2024-12-02 16:55 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 ` Ludovic Courtès [this message]
2024-12-02 19:11   ` [bug#74654] [PATCH 3/5] build-system/cargo: Simplify ‘crate-closure’ Efraim Flashner
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=c74974c8ffac0c9a33f4fd57535457bc8229dc71.1733158049.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=74654@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    /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).