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

rpath = false breaks run-make-fulldeps tests #90921

Closed
aplanas opened this issue Nov 15, 2021 · 4 comments · Fixed by #122270
Closed

rpath = false breaks run-make-fulldeps tests #90921

aplanas opened this issue Nov 15, 2021 · 4 comments · Fixed by #122270
Assignees
Labels
A-linkage Area: linking into static, shared libraries and binaries A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@aplanas
Copy link
Contributor

aplanas commented Nov 15, 2021

Running the tests from run-make-fulldeps, I found this one falling

./x.py test src/test/run-make-fulldeps --test-args long-linker-command-lines

test [run-make] run-make-fulldeps/long-linker-command-lines ... FAILED

failures:

---- [run-make] run-make-fulldeps/long-linker-command-lines stdout ----

error: make failed
status: exit status: 2
command: "make"
stdout:
------------------------------------------
LD_LIBRARY_PATH="/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines:/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/lib:/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/usr/lib" '/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines -L /home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines  foo.rs -g -O
RUSTC="/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" LD_LIBRARY_PATH="/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines:/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/usr/lib" /home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/long-linker-command-lines/long-linker-command-lines/foo
attempt: 100

------------------------------------------
stderr:
------------------------------------------
thread 'main' panicked at 'status: exit status: 127
stdout:

stderr:
/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-0cce5dc831adf0c6.so: cannot open shared object file:...
', foo.rs:76:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [Makefile:5: all] Error 101

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



failures:
    [run-make] run-make-fulldeps/long-linker-command-lines

test result: FAILED. 0 passed; 1 failed; 1 ignored; 0 measured; 225 filtered out; finished in 1.24s

Some tests failed in compiletest suite=run-make-fulldeps mode=run-make host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu


command did not execute successfully: "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/lib" "--run-lib-path" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--rustdoc-path" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "--rust-demangler-path" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-demangler" "--src-base" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/src/test/run-make-fulldeps" "--build-base" "/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps" "--stage-id" "stage1-x86_64-unknown-linux-gnu" "--suite" "run-make-fulldeps" "--mode" "run-make" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "long-linker-command-lines" "--llvm-version" "13.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwp engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--llvm-bin-dir" "/usr/bin" "--cc" "cc" "--cxx" "c++" "--cflags" "-ffunction-sections -fdata-sections -fPIC -m64" "--ar" "ar" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "stable"
expected success, got: exit status: 1

It is complaining that librustc_driver-0cce5dc831adf0c6.so, and indeed this file is not in the LD_LIBRARY_PATH set in the second one found after RUSTC=. A simple find reveals that this file is present in /home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/lib that is included in the first LD_LIBRARY_PATH. The second one have /home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib, that contains a different librustc_driver-XXX.so, with a different hash (librustc_driver-80572f832f8b69a0.so)

I am not sure if the bug is that the second LD_LIBRARY_PATH is missing this directory, or we are calling the wrong rustc that indeed requires the librustc_driver with a different hash.

@aplanas aplanas added the C-bug Category: This is a bug. label Nov 15, 2021
@ehuss
Copy link
Contributor

ehuss commented Nov 15, 2021

Do you happen to have any config.toml settings?

I can't reproduce this with the given command. Does it happen even after an ./x.py clean?

@aplanas
Copy link
Contributor Author

aplanas commented Nov 16, 2021

There is a config.toml, that once removed comments and empty lines is like:

changelog-seen = 2

[llvm]
ccache = true
link-shared = true

[build]
build = 'x86_64-unknown-linux-gnu'
host = ['x86_64-unknown-linux-gnu']
target = ['x86_64-unknown-linux-gnu']
cargo = '/usr/bin/cargo'
rustc = '/usr/bin/rustc'
docs = false
compiler-docs = false
vendor = true
extended = true
tools = ['cargo']
configure-args = ['--build=x86_64-unknown-linux-gnu', '--host=x86_64-unknown-linux-gnu', '--target=x86_64-unknown-linux-gnu', '--prefix=/usr', '--bindir=/usr/bin', '--sysconfdir=/etc', '--datadir=/usr/share', '--localstatedir=/var', '--mandir=/usr/share/man', '--infodir=/usr/share/info', '--set', 'rust.deny-warnings=false', '--enable-local-rust', '--libdir=/usr/lib', '--docdir=/usr/share/doc/packages/rust', '--llvm-root=/usr', '--enable-llvm-link-shared', '--disable-codegen-tests', '--enable-optimize', '--enable-ccache', '--disable-docs', '--disable-compiler-docs', '--enable-verbose-tests', '--disable-rpath', '--enable-vendor', '--enable-extended', '--tools=cargo', '--release-channel=stable']

[install]
prefix = '/usr'
sysconfdir = '/etc'
docdir = '/usr/share/doc/packages/rust'
bindir = '/usr/bin'
libdir = '/usr/lib'
mandir = '/usr/share/man'
datadir = '/usr/share'

[rust]
optimize = true
channel = 'stable'
rpath = false
verbose-tests = true
codegen-tests = false
deny-warnings = false

[target.x86_64-unknown-linux-gnu]
llvm-config = '/usr/bin/llvm-config'

[dist]

Seems that is reproducible after a clean:

$ python3 ./x.py clean
...
Build completed successfully in 0:00:00

$ python3 ./x.py test src/test/run-make-fulldeps --test-args long-linker-command-lines
...
   Compiling proc-macro2 v1.0.24
...
running 2 tests
test [run-make] run-make-fulldeps/long-linker-command-lines-cmd-exe ... ok
test [run-make] run-make-fulldeps/long-linker-command-lines ... FAILED
...
------------------------------------------
stderr:
------------------------------------------
thread 'main' panicked at 'status: exit status: 127
stdout:

stderr:
/home/abuild/rpmbuild/BUILD/rustc-1.56.1-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-0cce5dc831adf0c6.so: cannot open shared object file:...
', foo.rs:76:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [Makefile:5: all] Error 101

------------------------------------------
...

Do you think that can be something in the config.toml? I can experiment dropping features from there.

@aplanas
Copy link
Contributor Author

aplanas commented Nov 16, 2021

Do you think that can be something in the config.toml? I can experiment dropping features from there.

You are totally correct here. Is the config.toml and the rpath parameter. If I set it to false I get the error, and I a remove the line I get a succeed. Not clear why.

@jyn514
Copy link
Member

jyn514 commented Jul 11, 2022

Hmm, I wonder if #13983 is related.

@jyn514 jyn514 added A-linkage Area: linking into static, shared libraries and binaries A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 27, 2023
@jyn514 jyn514 changed the title Error running test run-make-fulldeps/long-linker-command-lines rpath = false breaks run-make-fulldeps tests Apr 27, 2023
@onur-ozkan onur-ozkan self-assigned this Mar 10, 2024
@bors bors closed this as completed in c2b7d77 Mar 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 17, 2024
Rollup merge of rust-lang#122270 - onur-ozkan:fix-rmake-test-with-rpath-false, r=Mark-Simulacrum

fix `long-linker-command-lines` failure caused by `rust.rpath=false`

Fixes `long-linker-command-lines` test failure (which happens when `rust.rpath` is set to `false`) by adjusting `LD_LIBRARY_PATH`.

Fixes rust-lang#90921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants