Skip to content
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

--crate-type=rlib + -Cdebuginfo=2 + -Zremap-cwd-prefix=. is not reproducible on Windows #129117

Open
jieyouxu opened this issue Aug 15, 2024 · 0 comments
Labels
A-reproducibility Area: Reproducible / deterministic builds A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows Operating system: Windows S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Aug 15, 2024

In #128456 (comment) we noticed that:

--crate-type=rlib + -C debuginfo=2 + -Z remap-cwd-prefix=. on Windows caused the rlib to be unreproducible.

# ignore-musl
# Objects are reproducible but their path is not.

Two source files:

  1. https://github.com/rust-lang/rust/blob/0ba9db87e61adcfd9a978188f61c20d9b423a099/tests/run-make/reproducible-build/reproducible-build-aux.rs
  2. 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.rs
  • mkdir test
  • cp 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.rlib
  • cd 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.rlib and libfoo.rlib are 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=..

@jieyouxu jieyouxu added O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-reproducibility Area: Reproducible / deterministic builds S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. labels Aug 15, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 15, 2024
@jieyouxu jieyouxu changed the title rlib + -Cdebuginfo=2 + -Zremap-cwd-prefix=. is not reproducible on Windows --crate-type=rlib + -Cdebuginfo=2 + -Zremap-cwd-prefix=. is not reproducible on Windows Aug 15, 2024
@jieyouxu jieyouxu changed the title --crate-type=rlib + -Cdebuginfo=2 + -Zremap-cwd-prefix=. is not reproducible on Windows --crate-type=rlib + -Cdebuginfo=2 + -Zremap-cwd-prefix=. is not reproducible on Windows Aug 15, 2024
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 15, 2024
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 A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows Operating system: Windows S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants