Skip to content

Instantly share code, notes, and snippets.

Created September 22, 2020 04:05
What would you like to do?
Rust - reproduible Windows exe builds - removing PE timestamps

For improved reproduciblity, you can build windows executables without the PE timestamps via mingw-w64 by setting:


You may use something like this to conditionally set these flags for Windows builds only:

RUSTFLAGS="$RUSTFLAGS $([[ $platform != *"-windows-"* ]] || echo '-Clink-arg=-Wl,--no-insert-timestamp')" \
  cargo build --target $platform


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment