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

compiletest: allow only running a test if we have a *specific* llvm major version #132348

Closed
jieyouxu opened this issue Oct 30, 2024 · 6 comments · Fixed by #132995
Closed

compiletest: allow only running a test if we have a *specific* llvm major version #132348

jieyouxu opened this issue Oct 30, 2024 · 6 comments · Fixed by #132995
Assignees
Labels
A-compiletest Area: The compiletest test runner C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Oct 30, 2024

tests/codegen/try_question_mark_nop.rs has a hack like

//@ revisions: NINETEEN TWENTY
//@[NINETEEN] min-llvm-version: 19
//@[NINETEEN] ignore-llvm-version: 20-99
//@[TWENTY] min-llvm-version: 20

we should allow the test writer to specify a //@ only-llvm-major-version: 19 which will only run the test if the llvm's major version matches 19. Instead of having to hack this by using min-llvm-version + ignore-llvm-version.

@jieyouxu jieyouxu added A-compiletest Area: The compiletest test runner C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 30, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 30, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 30, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Oct 30, 2024

Mentoring instructions:

@HypheX
Copy link

HypheX commented Oct 30, 2024

@rustbot claim

@Eclips4
Copy link
Contributor

Eclips4 commented Nov 13, 2024

@rustbot claim

@rustbot rustbot assigned Eclips4 and unassigned HypheX Nov 13, 2024
@Eclips4
Copy link
Contributor

Eclips4 commented Nov 13, 2024

Pick a directive name, something like only-llvm-major-version

Unfortunately, we can't use only-llvm-major-version here, because it will be handled by the cfg::handle_only instead of the ignore_llvm. What do you think about exact-llvm-major-version?

@jieyouxu
Copy link
Member Author

That's fine.

@bors bors closed this as completed in a1923b3 Nov 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 14, 2024
Rollup merge of rust-lang#132995 - Eclips4:issue-132348, r=jieyouxu

compiletest: Add ``exact-llvm-major-version`` directive

Now contributors don't need to use  `min-llvm-version: X` + `ignore-llvm-version: X+1 - 99`, so they can simply use `exact-llvm-major-version: X`

To be honest, I didn't find any usages of that hack other than the one mentioned in the issue.  ( `tests/codegen/try_question_mark_nop.rs`)
Closes rust-lang#132348.

rustc-dev-guide PR for `//@ exact-llvm-major-version`: rust-lang/rustc-dev-guide#2135

r? jieyouxu
@jieyouxu
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

Successfully merging a pull request may close this issue.

4 participants