Skip to content

tests: prefer max-llvm-major-version over open LLVM ranges - #159499

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
AayushMainali-Github:main
Aug 2, 2026
Merged

tests: prefer max-llvm-major-version over open LLVM ranges#159499
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
AayushMainali-Github:main

Conversation

@AayushMainali-Github

@AayushMainali-Github AayushMainali-Github commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Per review, take option 3: replace open ignore-llvm-version ranges with max-llvm-major-version. Left gdb X - 99.0 ranges alone so CI's older gdb still runs those tests.

Fixes #159338.

@rustbot

rustbot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/compiletest

cc @jieyouxu

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

@rustbot rustbot added the A-compiletest Area: The compiletest test runner label Jul 18, 2026
@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 Jul 18, 2026
@rustbot

rustbot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @jieyouxu, @oli-obk, @wesleywiser, bootstrap
  • @jieyouxu, @oli-obk, @wesleywiser, bootstrap expanded to 8 candidates
  • Random selection from Mark-Simulacrum, clubby789, oli-obk, wesleywiser

Comment thread src/tools/compiletest/src/directives.rs Outdated
@Mark-Simulacrum

Copy link
Copy Markdown
Member

Presuming my grep isn't broken, there don't seem to be many version range directives... I'm wondering if we can restrict to known versions of some kind in the syntax? Or maybe switch to e.g. Rust range syntax (..) which is less likely to conflict?

$ rg 'version:' tests --no-filename | rg ':.*-'
//@ [aarch64-llvm-pre-23] ignore-llvm-version: 23 - 99
//@ ignore-gdb-version: 15.0 - 99.0
//@ ignore-gdb-version: 15.0 - 99.0
//@ ignore-gdb-version: 13.1 - 99.0
//@[llvm-current] ignore-llvm-version: 23 - 99
//@[loongarch32] ignore-llvm-version: 22 - 23
//@[loongarch64] ignore-llvm-version: 22 - 23
//@[loongarch32] ignore-llvm-version: 22 - 23
//@[loongarch64] ignore-llvm-version: 22 - 23

@jieyouxu

jieyouxu commented Jul 19, 2026

Copy link
Copy Markdown
Member
//@ [aarch64-llvm-pre-23] ignore-llvm-version: 23 - 99

This should just be //@ max-llvm-major-version: 22 IMHO

//@ ignore-gdb-version: 15.0 - 99.0
//@ ignore-gdb-version: 15.0 - 99.0
//@ ignore-gdb-version: 13.1 - 99.0

I almost feel like these should just be //@ ignore-gdb (after #159451). Right now in CI we use the gdb that comes with Ubuntu 22.04, which happens to be gdb 12.1. It would be good to double-check why they require an older gdb rather than newer gdb. Also the end range of 99.0 is really just a funny way to say "ignore newer gdb versions than the version specified in the start range".

//@[llvm-current] ignore-llvm-version: 23 - 99
//@[loongarch32] ignore-llvm-version: 22 - 23
//@[loongarch64] ignore-llvm-version: 22 - 23
//@[loongarch32] ignore-llvm-version: 22 - 23
//@[loongarch64] ignore-llvm-version: 22 - 23

Ditto on //@ max-llvm-major-version, probably 22 and 21 respectively.

For the LLVM versioning, we can probably re-use the .. that //@ edition currently uses, cc

fn parse_edition_range(config: &Config, line: &DirectiveLine<'_>) -> Option<EditionRange> {

However I'm not actually convinced the ignore-llvm-version: 22 - 23 are good ignore ranges, do those test pass against... LLVM 24? LLVM trunk is only LLVM 23 right? I feel like those loongarch64 ones also want //@ max-llvm-major-version?

@AayushMainali-Github

AayushMainali-Github commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Happy to change approach if preferred.

Options I’m seeing:

  • Switch version ranges to .. (like //@ edition), and keep rejecting ambiguous forms
  • Keep but require spaces and hard-error on 23-99 instead of accepting it
  • replace X - 99 with max-llvm-major-version / simpler gdb ignores, and only touch the parser as needed

Which direction should this PR take? @Mark-Simulacrum @jieyouxu

@Mark-Simulacrum

Copy link
Copy Markdown
Member

I think option 3 is probably where I lean but r? @jieyouxu, I think you've thought more deeply about this space.

@rustbot rustbot assigned jieyouxu and unassigned Mark-Simulacrum Jul 29, 2026
@jieyouxu

jieyouxu commented Jul 29, 2026

Copy link
Copy Markdown
Member

The approach I'd suggest is option 3 as well. I'm somewhat wary of trying to use the .. edition syntax, now that I think about it, because edition can only be NNNN years (pure integers) but LLVM etc. version strings can be X.Y.Z which makes the .. arguably quite confusing

@jieyouxu jieyouxu added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 29, 2026
@AayushMainali-Github AayushMainali-Github changed the title compiletest: accept optional whitespace in version range directives tests: prefer max-llvm-major-version over open LLVM ranges Jul 29, 2026
@AayushMainali-Github

Copy link
Copy Markdown
Contributor Author

Updated for option 3. Left gdb ranges alone for now (CI still uses older gdb). Happy to change if preferred.

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2026

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think these tests probably need revisiting by the target maintainers, but that's orthogonal to the usages here.
@bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 20ac212 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Aug 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
tests: prefer max-llvm-major-version over open LLVM ranges

Per review, take option 3: replace open `ignore-llvm-version` ranges with `max-llvm-major-version`. Left gdb `X - 99.0` ranges alone so CI's older gdb still runs those tests.

Fixes rust-lang#159338.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
tests: prefer max-llvm-major-version over open LLVM ranges

Per review, take option 3: replace open `ignore-llvm-version` ranges with `max-llvm-major-version`. Left gdb `X - 99.0` ranges alone so CI's older gdb still runs those tests.

Fixes rust-lang#159338.
rust-bors Bot pushed a commit that referenced this pull request Aug 2, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #159906 (Semantic check of `mut` restrictions)
 - #160358 (borrowck: Simplify deps to build compiler 30s faster)
 - #160375 (miri subtree update)
 - #159499 (tests: prefer max-llvm-major-version over open LLVM ranges)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 2, 2026
tests: prefer max-llvm-major-version over open LLVM ranges

Per review, take option 3: replace open `ignore-llvm-version` ranges with `max-llvm-major-version`. Left gdb `X - 99.0` ranges alone so CI's older gdb still runs those tests.

Fixes rust-lang#159338.
rust-bors Bot pushed a commit that referenced this pull request Aug 2, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #159906 (Semantic check of `mut` restrictions)
 - #156527 (Move `std::io` tests to `alloctests` & add prelude)
 - #159525 (Stabilize passing 128-bit integers via vector registers with `asm!` on x86)
 - #160342 (Specialize `advance_by` method of `Fuse`)
 - #160358 (borrowck: Simplify deps to build compiler 30s faster)
 - #160375 (miri subtree update)
 - #106643 (Allow only implementing `Read::read_buf`)
 - #159499 (tests: prefer max-llvm-major-version over open LLVM ranges)
 - #159729 (allocations are allowed to grow (but not shrink))
 - #159881 (fix: Do not stop `visible_parent_map` breadth-first search reaching children of `#[doc(hidden)]` modules)
 - #160189 (Move codegen_stmt_debuginfo to debuginfo.rs)
 - #160356 (Add more tests for `must_implement_one_of`)
@rust-bors
rust-bors Bot merged commit 8b35b28 into rust-lang:main Aug 2, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 2, 2026
rust-timer added a commit that referenced this pull request Aug 2, 2026
Rollup merge of #159499 - AayushMainali-Github:main, r=jieyouxu

tests: prefer max-llvm-major-version over open LLVM ranges

Per review, take option 3: replace open `ignore-llvm-version` ranges with `max-llvm-major-version`. Left gdb `X - 99.0` ranges alone so CI's older gdb still runs those tests.

Fixes #159338.
WhySoBad pushed a commit to WhySoBad/miri that referenced this pull request Aug 5, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#159906 (Semantic check of `mut` restrictions)
 - rust-lang/rust#156527 (Move `std::io` tests to `alloctests` & add prelude)
 - rust-lang/rust#159525 (Stabilize passing 128-bit integers via vector registers with `asm!` on x86)
 - rust-lang/rust#160342 (Specialize `advance_by` method of `Fuse`)
 - rust-lang/rust#160358 (borrowck: Simplify deps to build compiler 30s faster)
 - rust-lang/rust#160375 (miri subtree update)
 - rust-lang/rust#106643 (Allow only implementing `Read::read_buf`)
 - rust-lang/rust#159499 (tests: prefer max-llvm-major-version over open LLVM ranges)
 - rust-lang/rust#159729 (allocations are allowed to grow (but not shrink))
 - rust-lang/rust#159881 (fix: Do not stop `visible_parent_map` breadth-first search reaching children of `#[doc(hidden)]` modules)
 - rust-lang/rust#160189 (Move codegen_stmt_debuginfo to debuginfo.rs)
 - rust-lang/rust#160356 (Add more tests for `must_implement_one_of`)
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 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.

compiletest: either require or trim spaces around the dash in version range directives, e.g. //@ ignore-llvm-version: A - B

5 participants