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

compiletest: set the dylib path when gathering target cfg #103072

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Oct 14, 2022

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.

@rust-highfive
Copy link
Collaborator

r? @jyn514

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 14, 2022
@cuviper
Copy link
Member Author

cuviper commented Oct 21, 2022

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 22, 2022

📌 Commit 97c3608326d123f5462e3504409a3a069611c0fb has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 22, 2022
@bors
Copy link
Contributor

bors commented Oct 29, 2022

☔ The latest upstream changes (presumably #103727) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 29, 2022
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 rust-lang#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.
@rustbot rustbot added the A-testsuite Area: The testsuite used to check the correctness of rustc label Oct 30, 2022
@cuviper
Copy link
Member Author

cuviper commented Oct 30, 2022

Rebased.

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Oct 30, 2022

📌 Commit f8a0cc2 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 30, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2022
…earth

Rollup of 8 pull requests

Successful merges:

 - rust-lang#103072 (compiletest: set the dylib path when gathering target cfg)
 - rust-lang#103084 (Derive `Eq` and `Hash` for `ControlFlow`)
 - rust-lang#103575 (Change #[suggestion_*] attributes to use style="...")
 - rust-lang#103637 (Use stdio in UWP apps)
 - rust-lang#103638 (Add `multivalue` target feature to WASM target)
 - rust-lang#103781 (Detect unused files in `src/test/mir-opt` and error on them in tidy.)
 - rust-lang#103837 (Migrate sidebar-links-color GUI test to functions)
 - rust-lang#103839 (Print valid `--print` requests if request is invalid)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3aae004 into rust-lang:master Nov 2, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 2, 2022
@stefson
Copy link

stefson commented Nov 7, 2022

@cuviper I know you're a busy man, but do you think its possible for you to give a brief example on how to test if my rustc binary is affected by this?

It seems to me that you were unable to compile/bootstrap your rustc binary on x86_64-unknown-linux-gnu, however I did not have any problems with bootstraping mine on armv7a-unknown-linux-musleabihf, despite using rpath = false in my config.toml - so I'm slightly confused here if I should backport your patch into my patchset?

@cuviper
Copy link
Member Author

cuviper commented Nov 7, 2022

This only affects the in-tree testsuite, like ./x.py test ui, as our compiletest runner was trying to invoke rustc without the path to its libraries.

Once you've built the toolchain and installed it somewhere, it's up to you to make sure that your library path is correct. This hasn't changed.

@cuviper cuviper deleted the compiletest-path branch May 21, 2023 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants