-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: add max-llvm-major-version
directive
#132310
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Not mandatory, but consider also editing the ~5 tests that currently use the N-99 pattern, so that the new directive is actually used. |
src/tools/compiletest/src/header.rs
Outdated
// Ignore if actual version is smaller the minimum required | ||
// version | ||
if let Some(value) = config.parse_name_value_directive(line, "min-llvm-version") { | ||
let value = value.trim(); |
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.
Remark: Separate from this PR, we should just make the parse functions trim automatically. I can't imagine a legitimate use-case for directives actually wanting to see untrimmed whitespace.
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.
I didn't want to touch that in the current directive handling, tbh. I prefer we just redo this entirely.
This comment was marked as resolved.
This comment was marked as resolved.
Good point, I'll update existing tests. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
aae8f1d
to
b6a7cca
Compare
max-llvm-version
directivemax-llvm-major-version
directive
Changes since last force push:
|
Not sure if this is a good idea or not, but another possibility would be to reframe the directive as something like In practice, I think a lot of the real-world uses of this directive are going to be along the lines of “this doesn't work on LLVM 21”, in which case |
We could also just use a semver version range: (But that is also quite obscure, just musing) |
…nur-ozkan compiletest: improve robustness of LLVM version handling Previously, `extract_llvm_versions` did some gymnastics for llvm versions by combining `(major, minor, patch)` into a combined version integer, but that is not very robust and made it difficult to add `max-llvm-major-version`. This PR tries to: - Improve llvm version handling robustness by parsing and representing the version as a semver. We intentionally deviate from strict semver standards by allowing omission of minor and patch versions. They default to `0` when absent. This is for convenience to allow the user to write e.g. `//@ min-llvm-version: 18` instead of having to spell out the full `major.minor.patch` semver string `//@ min-llvm-verison: 18.0.0`. - Adjust some panic messages to include a bit more context about *why* the version string was rejected. Prerequisite for rust-lang#132310. r? bootstrap (or compiler)
Rollup merge of rust-lang#132315 - jieyouxu:extract-llvm-version, r=onur-ozkan compiletest: improve robustness of LLVM version handling Previously, `extract_llvm_versions` did some gymnastics for llvm versions by combining `(major, minor, patch)` into a combined version integer, but that is not very robust and made it difficult to add `max-llvm-major-version`. This PR tries to: - Improve llvm version handling robustness by parsing and representing the version as a semver. We intentionally deviate from strict semver standards by allowing omission of minor and patch versions. They default to `0` when absent. This is for convenience to allow the user to write e.g. `//@ min-llvm-version: 18` instead of having to spell out the full `major.minor.patch` semver string `//@ min-llvm-verison: 18.0.0`. - Adjust some panic messages to include a bit more context about *why* the version string was rejected. Prerequisite for rust-lang#132310. r? bootstrap (or compiler)
There's already `min-llvm-version`, and contributors were using `ignore-llvm-version: 20 - 99` to emulate `max-llvm-major-version: 19`.
…range like `N - 99` For tests that use `ignore-llvm-version: N - M`, replace that with `max-llvm-major-version: N-1`.
b6a7cca
to
f41e1cf
Compare
Hm, I feel like I forgot to set this as ready, lol. @rustbot ready |
To complement existing
min-llvm-version
so contributors don't have to useignore-llvm-version: 20 - 99
to emulatemax-llvm-major-version: 19
.Closes #132305.
cc @workingjubilee who suggested this.
Implementation steps
max-llvm-major-version
directive rustc-dev-guide#2129)r? bootstrap