Description
We are building Rust for a custom target in the Yocto framework. Here we run a test called reproducibility to ensure the rust binaries are identical between the builds.
We do that by building and comparing the rust binaries & libs in two different build directories -
- reproducibleA &
- reproducibleB-extended
With every rust release we've seen a several issues which makes the rust binaries are not reproducible. The issues seen are with several reasons like -
-
Regressions caused by rust updates (absolute path in proc-macro)
a9a9798 -
Incorrect/missing Rust config settings (remap-debuginfo is not set by default)
https://lists.openembedded.org/g/openembedded-core/message/188940 -
Compiler options and settings - rustdoc failed with codegen-units option setting
https://lists.openembedded.org/g/openembedded-core/message/202540 -
Regressions with Crate updates - CC crate appending a unique hash to the object files
Fix for different hashes between different build paths cc-rs#1277
Use relative directory for obj files hash cc-rs#1270
There are a few other failure cases we've analyzed and fixed. This issue is happening for multiple reasons and these failure are resulting in lot of debug efforts and project delays.
This can be avoided by having such a reproducibility test on rust itself.
Any comments or inputs on detecting and fixing this issue during rust development itself? (via a test case or any other ways)