Skip to content

Fix Windows CI's Powershell not propagate error by default - #5070

Open
Cloud0310 wants to merge 1 commit into
rust-lang:mainfrom
Cloud0310:fix/windows-ci-check
Open

Fix Windows CI's Powershell not propagate error by default#5070
Cloud0310 wants to merge 1 commit into
rust-lang:mainfrom
Cloud0310:fix/windows-ci-check

Conversation

@Cloud0310

@Cloud0310 Cloud0310 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Previous Windows GNU and MSVC target on CI/CD has different report. This is what I found when dealing with CI/CD errors on #5056.
This is due to the default shell for running GNU target on Windows is pwsh, and its not exiting upon first error, causing checking failures being ignored.

Note: assisted by codex GPT-6.

@Cloud0310

Cloud0310 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Nah, another OpenSSL build problem.....

@rami3l

rami3l commented Sep 11, 2026

Copy link
Copy Markdown
Member

@Cloud0310 The CI is failing because now with Git Bash, Perl is running under Git Perl instead of Strawberry under Windows. I am afraid we have to do early returns by hand in pwsh now.

@Cloud0310

Copy link
Copy Markdown
Contributor Author

@rami3l Fixed and added note for this thanks for further bug diagnosis.

@rami3l
rami3l added this pull request to the merge queue Sep 11, 2026
@ChrisDenton

ChrisDenton commented Sep 11, 2026

Copy link
Copy Markdown
Member

Hm, have you considered using $PSNativeCommandUseErrorActionPreference = $true?

@Cloud0310

Cloud0310 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Hm, have you considered using "$PSNativeCommandUseErrorActionPreference = $true?

Good idea, would love to try.

@rami3l
rami3l removed this pull request from the merge queue due to a manual request Sep 11, 2026
@Cloud0310 Cloud0310 changed the title Fix Windows CI false report on exitcode Fix Windows CI not propagate error by default. Sep 11, 2026
@Cloud0310 Cloud0310 changed the title Fix Windows CI not propagate error by default. Fix Windows CI's Powershell not propagate error by default Sep 11, 2026
@Cloud0310

Cloud0310 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

I've pinned to PowerShell on Windows actions, and added comments about this choice in case of future confusion.

@ChrisDenton

Copy link
Copy Markdown
Member

Feel free to ignore this if you don't want to do any bigger refactoring but seeing the repeated use of pwsh and powershell makes me wonder if we could set the default shell to a custom pwsh and then override it only when we really need to run bash. E.g. make the default something like:

shell: pwsh -Command $ErrorActionPreference='stop'; $PSNativeCommandUseErrorActionPreference=$true; & '{0}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants