`--crate-type=rlib` + `-Cdebuginfo=2` + `-Zremap-cwd-prefix=.` is not reproducible on Windows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
In https://github.com/rust-lang/rust/pull/128456#issuecomment-2289562440 we noticed that:
--crate-type=rlib + -C debuginfo=2 + -Z remap-cwd-prefix=. on Windows caused the rlib to be unreproducible.
Two source files:
- https://github.com/rust-lang/rust/blob/0ba9db87e61adcfd9a978188f61c20d9b423a099/tests/run-make/reproducible-build/reproducible-build-aux.rs
- https://github.com/rust-lang/rust/blob/0ba9db87e61adcfd9a978188f61c20d9b423a099/tests/run-make/reproducible-build/reproducible-build.rs
Steps:
- Let "root" test directory be called
$base_dir. rustc reproducible-build-aux.rsmkdir testcp reproducible-build.rs test/reproducible-build.rs- compiler 1:
rustc --crate-type=rlib -C debuginfo=2 -Zremap-cwd-prefix=. -L $cwd reproducible-build.rs mv libreproducible_build.rlib libfoo.rlibcd test- compiler 2:
rustc --crate-type=rlib -C debuginfo=2 -Zremap-cwd-prefix=. -L $base_dir --out-dir=$base_dir reproducible-build.rs cd $base_dir- check if
libreproducible_build.rlibandlibfoo.rlibare different
Marking as S-needs-repro as I'm not sure of the root cause or exact reproduction environment; the test case failed on x86_64-msvc ci job. I'm also not exactly sure of the intended semantics of -Z remap-cwd-prefix=..
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/run-make/reproducible-build/Makefile and the two mentioned sources, reproducible-build-aux.rs and reproducible-build.rs. Reproduce the differing rlibs on the x86_64-msvc CI environment using the listed rustc commands, then investigate the intended semantics of -Z remap-cwd-prefix=.. Done means the Windows case has a confirmed root cause and an agreed reproducibility result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, compilers, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100