Skip to content

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

Open
Ozzy1423 wants to merge 1 commit intorust-lang:mainfrom
Ozzy1423:comp-lines
Open

Compiletest: Fix compare-output-by-lines directive#153797
Ozzy1423 wants to merge 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.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 13, 2026
Compiletest: Fix compare-output-by-lines directive

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.

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
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`)
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