-
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
tidy: validate LLVM component names in tests #125472
Conversation
LLVM component names are not immediately obvious (they usually omit any suffixes on the target arch name), and if they're incorrect, the test will silently never run.
r? @clubby789 rustbot has assigned @clubby789. Use |
const KNOWN_LLVM_COMPONENTS: &[&str] = &[ | ||
"aarch64", | ||
"arm", | ||
"avr", | ||
"bpf", | ||
"hexagon", | ||
"loongarch", | ||
"m68k", | ||
"mips", | ||
"msp430", | ||
"nvptx", | ||
"powerpc", | ||
"riscv", | ||
"sparc", | ||
"systemz", | ||
"webassembly", | ||
"x86", | ||
]; |
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 considered invoking llvm-config --components
to get this list, but I think that would be a bit awkward to do within tidy.
I think hardcoding it is fine. It should be very rare that this needs to be changed--only when adding support for a brand new architecture.
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.
It would mean tidy fails if it can't run llvm-config, and I'm not sure we actually haul that binary around...
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.
Would be good to give people some guidance on how to figure out the correct current list.
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.
FWIW this works for me
build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-config --components
but it lists a lot more than this PR.
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.
many of them are actually the same thing, like this:
- hexagon
- hexagonasmparser
- hexagoncodegen
- hexagondesc
- hexagondisassembler
- hexagoninfo
for our purposes we only really care about having "hexagon"
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#121377 (Stabilize `LazyCell` and `LazyLock`) - rust-lang#122986 (Fix c_char on AIX) - rust-lang#123803 (Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.) - rust-lang#124080 (Some unstable changes to where opaque types get defined) - rust-lang#124667 (Stabilize `div_duration`) - rust-lang#125472 (tidy: validate LLVM component names in tests) - rust-lang#125523 (Exit the process a short time after entering our ctrl-c handler) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125472 - erikdesjardins:component, r=clubby789 tidy: validate LLVM component names in tests LLVM component names are not immediately obvious (they usually omit any suffixes on the target arch name), and if they're incorrect, the test will silently never run. This happened [here](rust-lang#125220 (comment)), and it would be nice to prevent it.
… r=Kobzol,lqd Give tidy the good news about C-SKY It seems this was overlooked in rust-lang#125472 because we don't test C-SKY much yet. Fixes rust-lang#125697 r? `@erikdesjardins`
… r=nikic Give tidy the good news about C-SKY It seems this was overlooked in rust-lang#125472 because we don't test C-SKY much yet. Fixes rust-lang#125697 r? `@erikdesjardins`
Revert "tidy: validate LLVM component names in tests" This reverts rust-lang#125472. This has already caused a [bit](rust-lang#125702) of [trouble](rust-lang#125710), and I was mistaken about the original motivation--incorrect component names [_will_](rust-lang#125702 (comment)) be detected by a full CI run. I no longer think it pulls its weight. r? `@workingjubilee`
LLVM component names are not immediately obvious (they usually omit any suffixes on the target arch name), and if they're incorrect, the test will silently never run.
This happened here, and it would be nice to prevent it.