[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)
committerJeremy Bícha <jbicha@ubuntu.com>
Mon, 26 Jun 2023 21:16:27 +0000 (22:16 +0100)
commit0edf386cae58c3b2d7d350f6500b395e1ec492cc
treef18fcc971b54fca1948966c0719255a2b8b55993
parent021a186bf231dbc0d120885fe028fa261cb878aa
[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