-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Validate ignore
and only
compiletest directive, and add human-readable ignore reasons
#108905
Conversation
ec7b9ae
to
cb71607
Compare
@@ -1,5 +1,6 @@ | |||
// build-pass | |||
// only-x86-windows | |||
// only-x86 | |||
// only-windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
Ok so with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for putting it together!
c4086c3
to
0bca8fc
Compare
Ok I should've fixed everything, this PR is ready now. |
Looks like it needs to be formatted. Also, I assume the 10 day period for rust-lang/compiler-team#600 needs to finish? |
☔ The latest upstream changes (presumably #109097) made this pull request unmergeable. Please resolve the merge conflicts. |
82d6b74
to
9be09a4
Compare
Rebased and formatted. |
@@ -1,7 +1,7 @@ | |||
// Tests that the compiler errors if the user tries to turn off unwind tables | |||
// when they are required. | |||
// | |||
// only-x86_64-windows-msvc | |||
// only-x86_64-pc-windows-msvc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that I already did this one in #108809 and it was not enough
9be09a4
to
3d1ccc0
Compare
Pushed changes to fix the broken annotations in other compiletest suites (in addition to |
More than 10 days passed, so the MCP has been approved! |
☔ The latest upstream changes (presumably #108659) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with rebase
I haven't done a thorough review to check which tests will start or stop running with our CI configurations, or that this won't pass/fail on some of the more unusual targets. However, the changes look valid to me on the surface.
Perhaps someone could review the ignore messages in CI, and compare to a previous run, but I think that will be a lot of work.
dbg!(target, pattern, ignore); | ||
dbg!(config.target_cfgs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to remove these since they generate a large amount of output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whelp that wasn't supposed to be left there, I'll remove it tomorrow.
I'll rebase tomorrow!
Well, good thing that all the executed tests are now available in the build metrics JSON files since #108659 😂 |
f27d635
to
4fb3e65
Compare
"tomorrow" @bors r=ehuss rollup=never |
📌 Commit 4fb3e65fc436cf70ae995dcb20d148492daa4d02 has been approved by It is now in the queue for this repository. |
💔 Test failed - checks-actions |
Thanks for making this? I literally just yesterday caught myself making a type in |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b2b676d): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
…ehuss [compiletest] Add more test ignore reasons, `needs-` validation, and improved error messages This PR makes more improvements to the way compiletest ignoring headers are handled, following up on rust-lang#108905: * Human-readable ignore reasons have been added for the remaining ignore causes (`needs-*` directives, `*llvm*` directives, and debugger version directives). All ignored tests should now have a human-readable reason. * The code handling `needs-*` directives has been refactored, and now invalid `needs-*` directive emit errors like `ignore-*` and `only-*`. * All errors are now displayed at startup (with line numbers) rather than just the first error of the first file. This PR is best reviewed commit-by-commit. r? `@ehuss`
Compiletest was switched to querying all targets using `--print=all-target-specs-json` and `--print=target-spec-json` in rust-lang#108905. This unintentionally prevented codegen flags like `-Cpanic` from being reflected in the current target configuration. This change gets the current compiletest target config using `--print=cfg` like it was previously while still using the faster prints for getting information on all other targets. Fixes rust-lang#110850.
…target, r=compiler-errors Get current target config from` --print=cfg` Compiletest was switched to querying all targets using `--print=all-target-specs-json` and `--print=target-spec-json` in rust-lang#108905. This unintentionally prevented codegen flags like `-Cpanic` from being reflected in the current target configuration. This change gets the current compiletest target config using `--print=cfg` like it was previously while still using the faster prints for getting information on all other targets. Fixes rust-lang#110850. `@jyn514` might be interested in reviewing since they commented on the issue. cc `@tmandry` since this issue is affecting Fuchsia.
…rget, r=compiler-errors Get current target config from` --print=cfg` Compiletest was switched to querying all targets using `--print=all-target-specs-json` and `--print=target-spec-json` in rust-lang#108905. This unintentionally prevented codegen flags like `-Cpanic` from being reflected in the current target configuration. This change gets the current compiletest target config using `--print=cfg` like it was previously while still using the faster prints for getting information on all other targets. Fixes rust-lang#110850. `@jyn514` might be interested in reviewing since they commented on the issue. cc `@tmandry` since this issue is affecting Fuchsia.
This was changed from stage 0 to 1 in rust-lang#108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage. This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`.
…mulacrum Don't compile rustc to self-test compiletest This was changed from stage 0 to 1 in rust-lang#108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage. This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`. Note that this also fixes a latent bug that depended on running `x build compiler` before `x doc compiler`, as well as a couple cleanups related to symlinks (which made the latent bug easier to find). cc `@pietroalbini`
Don't compile rustc to self-test compiletest This was changed from stage 0 to 1 in rust-lang/rust#108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage. This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`. Note that this also fixes a latent bug that depended on running `x build compiler` before `x doc compiler`, as well as a couple cleanups related to symlinks (which made the latent bug easier to find). cc `@pietroalbini`
Don't compile rustc to self-test compiletest This was changed from stage 0 to 1 in rust-lang/rust#108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage. This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`. Note that this also fixes a latent bug that depended on running `x build compiler` before `x doc compiler`, as well as a couple cleanups related to symlinks (which made the latent bug easier to find). cc `@pietroalbini`
Don't compile rustc to self-test compiletest This was changed from stage 0 to 1 in rust-lang/rust#108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage. This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`. Note that this also fixes a latent bug that depended on running `x build compiler` before `x doc compiler`, as well as a couple cleanups related to symlinks (which made the latent bug easier to find). cc `@pietroalbini`
This PR adds strict validation for the
ignore
andonly
compiletest directives, failing if an unknown value is provided to them. Doing so uncovered 79 tests intests/ui
that had invalid directives, so this PR also fixes them.Finally, this PR adds human-readable ignore reasons when tests are ignored due to
ignore
oronly
directives, like "only executed when the architecture is aarch64" or "ignored when the operative system is windows". This was the original reason why I started working on this PR and #108659, as we need both of them for Ferrocene.The PR is a draft because the code is extremely inefficient: it calls
rustc --print=cfg --target $target
for every rustc target (to gather the list of allowed ignore values), which on my system takes between 4s and 5s, and performs a lot of allocations of constant values. I'll fix both of them in the coming days.r? @ehuss