Why is the binary created by local `cargo build --release` different from the one that was created by GitHub CI?

⚓ Rust    📅 2025-10-28    👤 surdeus    👁️ 7      

surdeus

Warning

This post was published 34 days ago. The information described in this article may have changed.

Recently, I wanted to test the reproducibility of my Rust project.

git clone https://github.com/KSXGitHub/parallel-disk-usage.git /tmp/pdu
cd /tmp/pdu
cargo build --release --bin=pdu
sha256sum target/release/pdu

And it returned this hash:

8d834537d0baaab6eda92c3c91af599003bee5e55f8dff2d5b48338e52dd8d16  target/release/pdu

Which is different from the CI:

b8a573a6bb0eb6585b525e80ac15356ca0ddd17c8e0af2c5ab6dc48e234c2552  pdu-x86_64-unknown-linux-gnu

What might have caused such difference? It can't be the difference in rustc version because it is pinned by the rust-toolchain file.

2 posts - 2 participants

Read full topic

🏷️ Rust_feed