Skip to content

Compiletest: Fix compare-output-by-lines directive#153797

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Ozzy1423:comp-lines
Mar 13, 2026
Merged

Compiletest: Fix compare-output-by-lines directive#153797
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Ozzy1423:comp-lines

Conversation

@Ozzy1423
Copy link
Contributor

Fixes: #148235

This was checking that the blessed stderr was a subset of the stderr. Additionally, when re-blessing it would re-bless the subset that matched. So, when an extra line or comment was added and the line numbers changed, it would bless it without the line numbers.

I hope this is the intended behaviour now, my only concern is if the parallel frontend has cases where it sometimes emits less diagnostics than other times and so re-blessing the minimum was the intended behaviour? There used to be a flag called "compare-output-by-lines-subset" for this which used this logic.

r? @jieyouxu

Fixes: rust-lang#148235

This was checking that the blessed stderr was a
subset of the stderr. Additionally, when re-blessing
it would re-bless the subset that matched. So, when
an extra line or comment was added and the line
numbers changed, it would bless it without the line
numbers.
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner 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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 12, 2026
@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot 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 Mar 13, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

I think the sorts are ok, but the 4 swapped diagnostics are weird.

View changes since this review

@Ozzy1423
Copy link
Contributor Author

@rustbot ready

@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 Mar 13, 2026
@jieyouxu
Copy link
Member

I think that reblessing-can-swap-order is not an ideal property, but don't want to block this PR on that. Thanks.
@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 13, 2026

📌 Commit 772e456 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 Mar 13, 2026
@Ozzy1423
Copy link
Contributor Author

Note they will only swap order if you re-bless when there is an actual change. If the diagnostics only change order (due to -Zthreads), they will match by lines and won't be re-blessed.

rust-bors bot pushed a commit that referenced this pull request Mar 13, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #153650 (Streamline active job collection.)
 - #153707 (Remove `CycleErrorHandling`.)
 - #153384 (Add missing safety doc for CString::from_vec_unchecked and async_drop_in_place)
 - #153752 (fix(delegation): Filter Out Module Segments in Generic Args Inheritance)
 - #153797 (Compiletest: Fix compare-output-by-lines directive)
 - #153810 (compiletest: Use PYTHONPATH for lldb too, not only gdb)
 - #153820 (Rename `opt_span_diag_lint` into `opt_span_lint` and remove `emit_diag_lint`)
@rust-bors rust-bors bot merged commit faeaedc into rust-lang:main Mar 13, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 13, 2026
@teor2345
Copy link
Contributor

Note they will only swap order if you re-bless when there is an actual change. If the diagnostics only change order (due to -Zthreads), they will match by lines and won't be re-blessed.

It seems like a stable process would be:

  • bless without parallel, to make any changes in serial order
  • bless with parallel, to make any parallel-only changes (which might swap around)

Can we add that to the tooling (or comments, or documentation)?

Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 17, 2026
Add the option to run UI tests with the parallel frontend

This PR adds two arguments for tests:

1. `--parallel-frontend-threads`: specify `-Zthread` to compile test case (currently UI tests only)
2. `--iteration-count`: the number of times to run each test

Also, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive `//@ ignore-parallel-frontend` to ignore tests with cycle error when the parallel-frontend is enabled (by `--parallel-frontend-threads`) and enables `//@ compare-output-by-lines` by default.

Context: [#t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/near/578781369)

This PR should work with rust-lang#153797 together.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 17, 2026
Add the option to run UI tests with the parallel frontend

This PR adds two arguments for tests:

1. `--parallel-frontend-threads`: specify `-Zthread` to compile test case (currently UI tests only)
2. `--iteration-count`: the number of times to run each test

Also, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive `//@ ignore-parallel-frontend` to ignore tests with cycle error when the parallel-frontend is enabled (by `--parallel-frontend-threads`) and enables `//@ compare-output-by-lines` by default.

Context: [#t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/near/578781369)

This PR should work with rust-lang#153797 together.
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Mar 18, 2026
Add the option to run UI tests with the parallel frontend

This PR adds two arguments for tests:

1. `--parallel-frontend-threads`: specify `-Zthread` to compile test case (currently UI tests only)
2. `--iteration-count`: the number of times to run each test

Also, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive `//@ ignore-parallel-frontend` to ignore tests with cycle error when the parallel-frontend is enabled (by `--parallel-frontend-threads`) and enables `//@ compare-output-by-lines` by default.

Context: [#t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/near/578781369)

This PR should work with rust-lang/rust#153797 together.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Mar 18, 2026
Add the option to run UI tests with the parallel frontend

This PR adds two arguments for tests:

1. `--parallel-frontend-threads`: specify `-Zthread` to compile test case (currently UI tests only)
2. `--iteration-count`: the number of times to run each test

Also, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive `//@ ignore-parallel-frontend` to ignore tests with cycle error when the parallel-frontend is enabled (by `--parallel-frontend-threads`) and enables `//@ compare-output-by-lines` by default.

Context: [#t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/near/578781369)

This PR should work with rust-lang/rust#153797 together.
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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parallel rustc + compare-output-by-lines + edition 2015 loses diagnostic file path / line number in stderr snapshot

4 participants