Subject: [bug#71076] [PATCH 01/81] build-system: cargo: Accept unlabeled #:cargo-inputs.

From: Herman Rimm <[email-masked]>
Date: Mon, 20 May 2024 10:58:06 +0200

* guix/build-system/cargo.scm (crate-closure): Match unlabeled inputs.

Change-Id: Iae421281fa08d09ddd1e5d2da2864f0093d97cd1
---
 guix/build-system/cargo.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index c029cc1dda..a918e25e7a 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -234,7 +234,17 @@ (define (crate-closure inputs)
        (if (null? propagated)
            (reverse result)
            (loop (reverse (concatenate propagated)) result '() #f seen)))
-      (((and input (label (? package? package))) rest ...)
+      (((? package? package) rest ...)
+       (if (and (not first?) (seen? seen package))
+           (loop rest result propagated first? seen)
+           (loop rest
+                 (cons (list (package-name package) package) result)
+                 (cons (package-cargo-inputs package)
+                       propagated)
+                 first?
+                 (vhash-consq package package seen))))
+      ;; Match inputs with explicit labels for backward compatibility.
+      (((and input (_ (? package? package))) rest ...)
        (if (and (not first?) (seen? seen package))
            (loop rest result propagated first? seen)
            (loop rest
-- 
2.41.0