This is an automated email from the git hooks/post-receive script.
guix_mirror_bot pushed a commit to branch rust-team
in repository guix.
The following commit(s) were added to refs/heads/rust-team by this push:
new 15ca2942da build-system/cargo: Work around "cargo package" weirdness.
15ca2942da is described below
commit 15ca2942da20891f578cc99dc97863b5336e98b4
Author: Danny Milosavljevic <[email protected]>
AuthorDate: Fri Mar 6 22:01:43 2026 +0100
build-system/cargo: Work around "cargo package" weirdness.
* guix/build/cargo-build-system.scm (package): Modify.
Closes: guix/guix#6825
Change-Id: I0ab97662e52d53ca1558c40bd9c1cbd28eae0197
---
guix/build/cargo-build-system.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/guix/build/cargo-build-system.scm
b/guix/build/cargo-build-system.scm
index 584dc282bc..4bae1ea35a 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -376,10 +376,20 @@ directory = '" vendor-dir "'") port)
(for-each
(lambda (crate)
(invoke "tar" "xzf" crate "-C" vendor-dir))
- (find-files "target/package" "\\.crate$"))
+ (map (lambda (f) (string-append "target/package/" f))
+ (scandir "target/package"
+ (lambda (f) (string-suffix? ".crate" f)))))
(patch-cargo-checksums #:vendor-dir vendor-dir))
cargo-package-crates))
+ ;; Cargo creates target/package/tmp-crate/ as scratch space during
+ ;; packaging and leaves .crate file copies there after uplifting them
+ ;; to target/package/. Delete it so the repacking scandir does not
+ ;; pick the tmp-crate directory instead of the extracted crate
+ ;; directory when crate names sort after "tmp-crate" alphabetically.
+ (when (file-exists? "target/package/tmp-crate")
+ (delete-file-recursively "target/package/tmp-crate"))
+
;; Then unpack the crate, reset the timestamp of all contained files,
and
;; repack them. This is necessary to ensure that they are
reproducible.
(with-directory-excursion "target/package"