-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object file in /tmp produces non-deterministic builds on Windows for crate-type=bin #112587
Labels
A-reproducibility
Area: Reproducible / deterministic builds
C-bug
Category: This is a bug.
O-windows-msvc
Toolchain: MSVC, Operating system: Windows
Comments
One option would be to move the object file(s) that currently end up in |
Would you have any pointers to the code that does this for codegen units? |
and the code that emits the object file in rust/compiler/rustc_codegen_ssa/src/back/link.rs Line 1919 in 4bd4e2e
|
rustbot
added
A-reproducibility
Area: Reproducible / deterministic builds
O-windows-msvc
Toolchain: MSVC, Operating system: Windows
labels
Jun 13, 2023
aarongable
pushed a commit
to chromium/chromium
that referenced
this issue
Jun 16, 2023
This is done with a TODO while we work upstream to fix Rust-link-driven Windows exe non-determinism issues. Upstream does intend to have Rust able to produce deterministic results and there were already tests for this that were disabled on Windows due to the reasons being unclear which have now become clear thanks to our determinism bots! Upstream issues: rust-lang/rust#112586 rust-lang/rust#112587 Bug: 1453509 Change-Id: I582e46792934d44866a45d9b57b2c7b64b52a2e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4618949 Reviewed-by: Erik Chen <[email protected]> Commit-Queue: danakj <[email protected]> Cr-Commit-Position: refs/heads/main@{#1158781}
cc #71714 which has the same cause. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-reproducibility
Area: Reproducible / deterministic builds
C-bug
Category: This is a bug.
O-windows-msvc
Toolchain: MSVC, Operating system: Windows
When building a
--crate-type=bin
target with rustc, an object file is produced in/tmp/<randomname>
and that absolute path is then passed to the linker.Windows puts paths to all object files in the PDB file, so this results in non-deterministic Windows builds (see #88982 (comment)). To be deterministic all paths must be relative paths, or fixed paths.
To resolve this, we could:
/tmp
or similar when specified), allowing it to be specified relative to the CWD. Then ensure-Zremap-cwd-prefix
gets applied to it in order to produce a relative path.(FWIW I am cross-compiling Linux to Windows here which is why you see
/tmp
in the path :) But same things occur building on Windows.)The text was updated successfully, but these errors were encountered: