Description
Describe the problem you are trying to solve
When compiling a binary with the following RUSTFLAGS
environment variable:
RUSTFLAGS='--remap-path-prefix=/Users/blixt/src/my-project=. --remap-path-prefix=/Users/blixt=~'
it successfully removes all references to my local computer's directory structure in the debug information within the compiled output for Cargo dependencies and the project's binary.
However, some references to my computer's directory remains in the binary build product, and that is anything already compiled by rustup
, for example:
/Users/blixt/.rustup/toolchains/1.52.0-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/alloc/layout.rs
This makes the build output dependent on the folder structure of the computer it's compiled on, which makes it a lot harder to create reproducible builds across developers' machines (in my case, the build output is turned into WASM, and these strings create differences in the build output).
Describe the solution you'd like
If rustup
compiled using the configuration option remap-debuginfo = true
or the flag --remap-path-prefix=FROM=TO
then it would be easier to create reproducible builds.
Notes