efraim pushed a commit to branch rust-team
in repository guix.
commit 0b9a1f81ddb937b4ca978e9a882935cf38b372d8
Author: Herman Rimm <[email protected]>
AuthorDate: Mon Dec 9 20:58:05 2024 +0100
build-system: cargo: Accept unlabeled #:cargo-inputs.
* guix/build-system/cargo.scm (crate-closure): Match unlabeled inputs.
Change-Id: Iae421281fa08d09ddd1e5d2da2864f0093d97cd1
Signed-off-by: Efraim Flashner <[email protected]>
---
guix/build-system/cargo.scm | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index 4d4740300d..961a26cd35 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2019 Ivan Petkov <[email protected]>
;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
;;; Copyright © 2021, 2024 Efraim Flashner <[email protected]>
+;;; Copyright © 2024 Herman Rimm <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -242,11 +243,14 @@ do not extract the conventional inputs)."
(if (null? propagated)
(reverse result)
(loop (reverse (concatenate propagated)) result '() seen)))
- (((and input (label (? package? package))) rest ...)
+ ;; Match inputs with labels for backward compatibility.
+ (((or (_ (? package? package))
+ (? package? package))
+ rest ...)
(if (seen? seen package)
(loop rest result propagated seen)
(loop rest
- (cons input result)
+ (cons package result)
(cons (package-cargo-inputs package)
propagated)
(vhash-consq package package seen))))
@@ -303,8 +307,8 @@ any dependent crates. This can be a benefits:
something that can always be extended or reworked in the future)."
(filter-map
(match-lambda
- ((label (? package? p))
- (list label (package-source p)))
+ ((? package? p)
+ (list (package-name p) (package-source p)))
((label input)
(list label input)))
(crate-closure (append cargo-inputs cargo-development-inputs))))