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

Reproducible build run-make tests fails if -C debuginfo=2 (on Linux this time) #89911

Open
2 tasks
pnkfelix opened this issue Oct 15, 2021 · 6 comments
Open
2 tasks
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-reproducibility Area: Reproducible / deterministic builds A-run-make Area: port run-make Makefiles to rmake.rs C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Oct 15, 2021

This might be a cousin of #66568, which was thought to be Mac-specific.

On my Linux box, with a config.toml that has debug=true and debuginfo-level=2, I do:

 x.py check && \
 x.py test  --stage 1 src/tools/tidy &&  \
 x.py build    --stage 1   library/std  && \
 x.py test    --stage 1    \
     src/test/{rustdoc-js,ui,run-pass-valgrind,mir-opt,codegen,codegen-units,rustdoc,rustdoc-ui,pretty,run-make,run-make-fulldeps,assembly} \
     library/core \
     library/std

After the whole thing runs, it ends up failing in the last step with:

failures:

---- [run-make] run-make-fulldeps/reproducible-build-2 stdout ----

error: make failed
status: exit status: 2
command: "make"
stdout:
------------------------------------------
rm -rf /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2 && mkdir /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/t\
est/run-make-fulldeps/reproducible-build-2/reproducible-build-2
LD_LIBRARY_PATH="/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/\
stage1/lib:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage0/lib\
" '/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reprodu\
cible-build-2 -L /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2  reproducible-build-aux.rs
LD_LIBRARY_PATH="/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/\
stage1/lib:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage0/lib\
" '/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reprodu\
cible-build-2 -L /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2  reproducible-build.rs -C lto=fat
cp /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2/reproducible-build /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux\
-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2/reproducible-build-a
LD_LIBRARY_PATH="/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/\
stage1/lib:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage0/lib\
" '/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reprodu\
cible-build-2 -L /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2  reproducible-build.rs -C lto=fat
cmp "/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2/reproducible-build-a" "/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown\
-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2/reproducible-build" || exit 1
/media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2/reproducible-build-a /media/pnkfelix/Rust/rust.git/objdir-dbgopt/build/x86_64-unknown-linux-\
gnu/test/run-make-fulldeps/reproducible-build-2/reproducible-build-2/reproducible-build differ: byte 41, line 1

------------------------------------------
stderr:
------------------------------------------
make: *** [Makefile:17: fat_lto] Error 1

------------------------------------------



failures:
    [run-make] run-make-fulldeps/reproducible-build-2

test result: FAILED. 207 passed; 1 failed; 19 ignored; 0 measured; 0 filtered out; finished in 19.77s

I'm filing this issue to track investigation of whether this has the same root cause as #47086 and #66568 (except on Linux now), or if it is something else.


  • tests/run-make/reproducible-build
  • tests/run-make/reproducible-build-2
@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 15, 2021

Seems to occur with just debug-assertions = true in the config.toml

Update: No, I overlooked something else in my own config.toml. Narrowing down now.

@pnkfelix
Copy link
Member Author

OMG I think it needs debuginfo-level = 2 to be observed...

@pnkfelix pnkfelix changed the title reproducible-build-2 fails if debug=true (on Linux this time) reproducible-build-2 fails if debuginfo-level=2 (on Linux this time) Oct 15, 2021
@infinity0
Copy link
Contributor

Same issue on Debian, on all architectures e.g. amd64 ctrl-f for "reproducible-build-2". We set debuginfo-level = 2.

@infinity0
Copy link
Contributor

Might be a consequence of moving to LLVM 13 as the same test passed fine on Debian with 1.55 + LLVM 12, and LLVM is typically responsible for debuginfo. I will try to grab a more detailed diff of the artifacts later.

@infinity0
Copy link
Contributor

Here is detailed list of the differences: https://people.debian.org/~infinity0/rust/reproducible-build-2/diff.txt

Looks like it's ultimately caused by non-deterministic ordering some table of strings, which causes location differences elsewhere.

@bjorn3 bjorn3 added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 24, 2021
@jieyouxu jieyouxu changed the title reproducible-build-2 fails if debuginfo-level=2 (on Linux this time) Reproducible build run-make tests fails if -C debuginfo=2 (on Linux this time) Aug 7, 2024
@jieyouxu jieyouxu added the A-run-make Area: port run-make Makefiles to rmake.rs label Aug 7, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Aug 7, 2024

This is not specific to reproducible-build-2, reproducible-build also observes this failure on Linux if the cases that exercise binary crates + -C debuginfo=2 was not commented out (it also fails on Windows, but binaries already have reproducibility problems without -C debuginfo=2 but with path remapping #88982).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-reproducibility Area: Reproducible / deterministic builds A-run-make Area: port run-make Makefiles to rmake.rs C-bug Category: This is a bug. 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

4 participants