-
Notifications
You must be signed in to change notification settings - Fork 13k
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: improve robustness of LLVM version handling #132315
Conversation
let version = match *components { | ||
[a] => a * 10_000, | ||
[a, b] => a * 10_000 + b * 100, | ||
[a, b, c] => a * 10_000 + b * 100 + c, | ||
_ => panic!("Malformed version"), | ||
}; |
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.
Specifically, this
@rustbot author |
a7b20ef
to
8b92efb
Compare
(Brought back a few specific test cases, no functional changes) |
This comment has been minimized.
This comment has been minimized.
8b92efb
to
e419b3d
Compare
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
Changes since last review:
@rustbot ready |
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.
LGTM - Waiting for CI.
@bors r+ |
Rollup of 6 pull requests Successful merges: - rust-lang#130098 (Reject generic self types.) - rust-lang#131096 (rustdoc: Remove usage of `allow(unused)` attribute on `no_run` merged doctests) - rust-lang#132315 (compiletest: improve robustness of LLVM version handling) - rust-lang#132346 (Some graphviz tweaks) - rust-lang#132359 (Fix AIX libc call char type from i8 to u8) - rust-lang#132360 (Un-vacation myself) r? `@ghost` `@rustbot` modify labels: rollup
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)
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 addmax-llvm-major-version
. This PR tries 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 fullmajor.minor.patch
semver string//@ min-llvm-verison: 18.0.0
.Prerequisite for #132310.
r? bootstrap (or compiler)