| Crates.io | cargo-reproduce |
| lib.rs | cargo-reproduce |
| version | 0.1.0 |
| created_at | 2025-09-28 15:10:00.575162+00 |
| updated_at | 2025-09-28 15:10:00.575162+00 |
| description | A Cargo subcommand for reproducible Rust builds. Normalizes the build environment, strips nondeterministic metadata, and verifies bit-for-bit reproducibility. |
| homepage | |
| repository | https://github.com/tommantonclery/cargo-reproduce |
| max_upload_size | |
| id | 1858417 |
| size | 35,364 |
cargo-reproduce is a Cargo subcommand that helps you check if your Rust builds are really reproducible.
It sets up a consistent build environment, strips out things like timestamps and user paths, and then gives you a stable hash of the final binary.
By default, Cargo builds are usually deterministic on the same machine, but not always reproducible across different machines or even different directories.
That means:
This tool is an experiment to close that gap.
Install from source:
cargo install --path cargo-reproduce
Build with reproducibility checks:
cargo repro build --strict
Later, verify the binary still matches:
cargo repro verify
Two copies of the same crate in different directories:
# In hello-repro/
cargo repro build --strict
# → Reproducible build hash: ca6c0316891aafd83ec99d245d9e7268246a628beda789e4cc0ba1ea75388bb2
# In hello-repro-copy/
cargo repro build --strict
# → Reproducible build hash: ca6c0316891aafd83ec99d245d9e7268246a628beda789e4cc0ba1ea75388bb2
Both builds give the exact same hash ✅. That’s reproducibility.
Sets SOURCE_DATE_EPOCH to remove nondeterministic timestamps
Remaps absolute paths (crate root, Cargo home, target, home directory, etc.)
Clears out env vars like USERNAME and HOSTNAME
In --strict mode:
-C debuginfo=0)/Brepro on MSVC, --no-insert-timestamp on GNU/LLD)llvm-strip to get rid of leftover metadataThis is an early prototype. It’s not production-ready, but it shows that reproducible Rust builds are possible today with the right flags. The hope is that this kind of work can help inform Cargo itself if/when reproducible builds become a first-class feature.
MIT © 2025 tommantonclery