diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2023-10-28 18:09:05 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2023-11-28 07:59:07 +0200 |
commit | 63ccceb976fd14b6934fb95e1ef100642d31b89e (patch) | |
tree | 15d0aaedc33a373e8b97020a06eae5a7d49f9a43 /guix/build | |
parent | aed41597ec60675c662e3fda6dadf89fc2695724 (diff) |
build: cargo-build-system: Pack crates reproducibly.
This fixes reproducibility in rust crates from the package phase, again,
see <https://issues.guix.gnu.org/50015>.
Reported by: Christopher Baines (in person).
* guix/build/cargo-build-system.scm (package): When repacking the crate
tarball use standard reproducibility flags.
Change-Id: Ifb1440a023226bf0718e99ce9f95ef981e510cbc
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/cargo-build-system.scm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 505c0b4b01..1694ab973c 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -264,7 +264,11 @@ directory = '" port) (unless (eq? (stat:type s) 'symlink) (utime file 0 0 0 0)))) (find-files dir #:directories? #t)) + (apply invoke "tar" "czf" (string-append dir ".crate") + ;; avoid non-determinism in the archive + "--sort=name" "--mtime=@0" + "--owner=root:0" "--group=root:0" (find-files dir #:directories? #t)) (delete-file-recursively dir))) (find-files "." "\\.crate$"))))) |