Skip to content
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

Merged
merged 1 commit into from
May 26, 2024

Conversation

erikdesjardins
Copy link
Contributor

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.

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.
@rustbot
Copy link
Collaborator

rustbot commented May 24, 2024

r? @clubby789

rustbot has assigned @clubby789.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 24, 2024
Comment on lines +13 to +30
const KNOWN_LLVM_COMPONENTS: &[&str] = &[
"aarch64",
"arm",
"avr",
"bpf",
"hexagon",
"loongarch",
"m68k",
"mips",
"msp430",
"nvptx",
"powerpc",
"riscv",
"sparc",
"systemz",
"webassembly",
"x86",
];
Copy link
Contributor Author

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.

Copy link
Member

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...

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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"

@clubby789
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 25, 2024

📌 Commit 5888de8 has been approved by clubby789

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2024
…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
@bors bors merged commit 64730a1 into rust-lang:master May 26, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 26, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
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.
@erikdesjardins erikdesjardins deleted the component branch May 26, 2024 21:24
bors added a commit to rust-lang-ci/rust that referenced this pull request May 29, 2024
… 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`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 29, 2024
… 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`
erikdesjardins added a commit to erikdesjardins/rust that referenced this pull request Jun 4, 2024
…r=clubby789"

This reverts commit 64730a1, reversing
changes made to 80aea30.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 17, 2024
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants