-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make compiletest aware of targets without dynamic linking #112454
Make compiletest aware of targets without dynamic linking #112454
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
7b818da
to
53f96bb
Compare
This should be fine for us! |
4b74ffa
to
de7eecf
Compare
☔ The latest upstream changes (presumably #112418) made this pull request unmergeable. Please resolve the merge conflicts. |
r? compiler |
de7eecf
to
767c4b9
Compare
Rebased to fix conflict. |
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#112207 (Add trustzone and virtualization target features for aarch32.) - rust-lang#112454 (Make compiletest aware of targets without dynamic linking) - rust-lang#112628 (Allow comparing `Box`es with different allocators) - rust-lang#112692 (Provide more context for `rustc +nightly -Zunstable-options` on stable) - rust-lang#112972 (Make `UnwindAction::Continue` explicit in MIR dump) - rust-lang#113020 (Add tests impl via obj unless denied) - rust-lang#113084 (Simplify some conditions) - rust-lang#113103 (Normalize types when applying uninhabited predicate.) r? `@ghost` `@rustbot` modify labels: rollup
Did this break running mir-opt tests locally? I am getting
after I rebased today |
…i-obk Fix loading target specs in compiletest not working with custom targets In rust-lang#112454 (comment) it was pointed out that the PR broke blessing mir-opt tests. Since rust-lang#112418, blessing mir-opt tests generates "synthetic targets", which are custom target specs. Those specs are not included in `--print=all-target-specs-json`, and rust-lang#112454 required that the current target was returned by that flag. This PR fixes the breakage by loading the target spec for the current target explicitly, if a custom target is detected. r? `@oli-obk`
Some parts of the compiletest internals and some tests require dynamic linking to work, which is not supported by all targets. Before this PR, this was handled by if branches matching on the target name.
This PR loads whether a target supports dynamic linking or not from the target spec, and adds a
// needs-dynamic-linking
attribute for tests that require it. Note that I was not able to replace all the old conditions based on the target name, as some targets havedynamic_linking: true
in their spec but pretend they don't have it in compiletest.Also, to get this to work I had to partially revert #111472 (cc @djkoloski @tmandry @bjorn3). On one hand, only the target spec contains whether a target supports dynamic linking, but on the other hand a subset of the fields can be overridden through
-C
flags (as far as I'm aware only-C panic=$strategy
). The solution I came up with is to take the target spec as the base, and then override the panic strategy based on--print=cfg
. Hopefully that should not break y'all again.