There is a fun footgun related to compile-time code generation using procedural macros in Rust: if the macro has non-deterministic behavior, then the build process of any crate using it is not reproducible.

Here's a little write-up explaining how I uncovered such an issue in the hashify crate while trying to package Rust software for Guix: https://notes.8pit.net/notes/iqfs.html

#Guix #Rust #reproducibility #ReproducibleBuilds

Debugging Reproducibility Issues in Rust Software

@nmeum we need to have Go packages review on reproducibility, if you'd like to assist

https://codeberg.org/guix/guix/issues/3263

#guixgoteam

go-build-system: Not reproducible build when using CGO

Reported by: @daym Continuation of: #2368 > cgo passes -frandom-seed > > Why this flag exists: > > If you compile the same C code twice, GCC might produce slightly different > object files due to internal randomness (like hash seeds for internal tables). > > To fix this, the cgo t...

Codeberg.org

@sharlatan @nmeum as far as I know it's a bug in gcc's LTO streamer, the #line macro is causing a temporary path to be included in a way that isn't normalized by prefix-strip (Foxboron did research/work on this):

https://gcc.gnu.org/pipermail/gcc-patches/2024-March/647303.html
https://github.com/golang/go/pull/53528

[PATCH] lto-streamer: Ensure src_pwd is remapped

@sharlatan @nmeum And _this_ is how poor @nmeum became the community "voted" expert on reproducibility 🤣

I already tagged them on a different Rust reproducibility bug muhahahaha!

... don't try and steal rust-team's new shiny expert @sharlatan 😉