[PATCH] compiletest: set the dylib path when gathering target cfg
authorJosh Stone <jistone@redhat.com>
Fri, 14 Oct 2022 23:11:28 +0000 (16:11 -0700)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Tue, 27 Jun 2023 15:12:20 +0000 (16:12 +0100)
commitb9c32fe19f5e542dbd4d317736121e1e1be50a8d
tree5b89f2d8d0ce8891aa1d1ac5e1d87ba457ec463f
parent76769f4b4a2ffebce8752ad367bb433ecac43351
[PATCH] compiletest: set the dylib path when gathering target cfg

If the compiler is built with `rpath = false`, then it won't find its
own libraries unless the library search path is set. We already do that
while running the actual compiletests, but #100260 added another rustc
command for getting the target cfg.

    Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc"
    --- stdout

    --- stderr
    [...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory
    ', src/tools/compiletest/src/common.rs:476:13

Now the library path is set here as well, so it works without rpath.

FG: Context adapted

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Gbp-Pq: Name u-make-compiletest-work-without-rpath.patch
src/tools/compiletest/src/common.rs
src/tools/compiletest/src/runtest.rs
src/tools/compiletest/src/util.rs