Skip to content

compiletest: suppress Windows Error Reporting (WER) for run-make tests #132093

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Oct 24, 2024

WER by default will show a bunch of error dialogues for missing DLLs on Windows for run-make tests. We address that by:

  1. Guarding run-make test process spawning with disable_error_reporting.
  2. Fixing disable_error_reporting to also add the SEM_FAILCRITICALERRORS flag to SetErrorMode. Just SEM_NOGPFAULTERRORBOX was not sufficient to suppress error dialogues for e.g. missing DLLs.

Fixes #132092. In particular, refer to that issue for the necessary conditions to observe these dialogues from popping up in the first place.

I was only able to manually test this locally in my "native" Windows msvc environment and it prevents the WER dialogues from popping up, I don't think it's possible to really test this automatically.

@jieyouxu jieyouxu added the O-windows-msvc Toolchain: MSVC, Operating system: Windows label Oct 24, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2024

r? @albertlarsan68

rustbot has assigned @albertlarsan68.
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-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) labels Oct 24, 2024
@onur-ozkan
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

📌 Commit 464b242 has been approved by onur-ozkan

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 Oct 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 25, 2024
…kingjubilee

Rollup of 6 pull requests

Successful merges:

 - rust-lang#131851 ([musl] use posix_spawn if a directory change was requested)
 - rust-lang#132048 (AIX: use /dev/urandom for random implementation )
 - rust-lang#132093 (compiletest: suppress Windows Error Reporting (WER) for `run-make` tests)
 - rust-lang#132101 (Avoid using imports in thread_local_inner! in static)
 - rust-lang#132113 (Provide a default impl for Pattern::as_utf8_pattern)
 - rust-lang#132115 (rustdoc: Extend fake_variadic to "wrapped" tuples)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3fea422 into rust-lang:master Oct 25, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 25, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 25, 2024
Rollup merge of rust-lang#132093 - jieyouxu:suppress-wer, r=onur-ozkan

compiletest: suppress Windows Error Reporting (WER) for `run-make` tests

WER by default will show a *bunch* of error dialogues for missing DLLs on Windows for `run-make` tests. We address that by:

1. Guarding `run-make` test process spawning with `disable_error_reporting`.
2. Fixing `disable_error_reporting` to also add the [`SEM_FAILCRITICALERRORS` flag to `SetErrorMode`][SetErrorMode]. Just `SEM_NOGPFAULTERRORBOX` was not sufficient to suppress error dialogues for e.g. missing DLLs.

Fixes rust-lang#132092. In particular, refer to that issue for the necessary conditions to observe these dialogues from popping up in the first place.

I was only able to manually test this locally in my "native" Windows msvc environment and it prevents the WER dialogues from popping up, I don't think it's possible to really test this automatically.

[SetErrorMode]: https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode?redirectedfrom=MSDN#parameters
@bors
Copy link
Collaborator

bors commented Oct 25, 2024

⌛ Testing commit 464b242 with merge 788202a...

@jieyouxu jieyouxu deleted the suppress-wer branch October 25, 2024 04:17
@jieyouxu
Copy link
Member Author

@bors r- (bors pls stop trying to merge what you just merged)

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2024
@jieyouxu
Copy link
Member Author

@bors r- retry (stop, really)

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 25, 2024
@jieyouxu
Copy link
Member Author

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2024
@jieyouxu jieyouxu added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-windows-msvc Toolchain: MSVC, Operating system: Windows 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.

run-make tests on Windows (wezterm + recent PowerShell 7) triggers Windows Error Reporting error dialogues
5 participants