1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

build-system/cargo: Work around "cargo package" weirdness.

* guix/build/cargo-build-system.scm (package): Modify.

Closes: guix/guix#6825
Change-Id: I0ab97662e52d53ca1558c40bd9c1cbd28eae0197
This commit is contained in:
Danny Milosavljevic
2026-03-06 22:01:43 +01:00
committed by Efraim Flashner
parent cd22c1ad8f
commit 42ed3aa37a

View File

@@ -390,10 +390,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"