Allow redirected Cargo progress in Windows PowerShell 5.1 #185

Manually merged
github merged 1 commit from gh-pr/185/head into gh-pr/185/base 2026-11-26 04:14:17 +00:00
Owner

@⁠YeetSkillet on GitHub · 2026-11-23 19:32 UTC · original
YeetSkillet:fix/powershell-native-stderr → main · +42 −1 · 2 files · 1 commits · merged 2026-11-23 20:51 UTC

On Windows PowerShell 5.1, & .\scripts\test.ps1 *> test.log exits before cargo test when a successful build writes progress to stderr. With $ErrorActionPreference = 'Stop', the first redirected stderr line raises NativeCommandError. I reproduced the case reported on #140 on main at 956a476.

The runner now checks that Cargo exists before applying the existing Continue preference to both native commands. The build and test exit codes still determine the result. The regression test puts a temporary cargo.cmd on PATH and checks that both the native build message and the GPU skip summary reach the redirected log.

On Windows 10 22H2, I ran scripts/test-native-stderr.tests.ps1 in both shells.

Shell 956a476 This change
Windows PowerShell 5.1 Exit 1 before the test phase Pass
PowerShell 7.6.9 Pass Pass

A separate native Cargo stand-in returned 0 on success, 17 on a failing build, and 101 on a failing test. Both shells preserved all three codes. A failing build skipped the test phase, and a missing Cargo exited 1.

I also merged this script separately with the runner changes in #140 and #143. Each merge was conflict-free and passed the new regression in both shells. All four reporting cases from #140 also passed.

Validation covered the PowerShell runner with synthetic Cargo output. I did not run the Rust workspace suite. AI-assisted with Codex.

**@⁠YeetSkillet** on GitHub · 2026-11-23 19:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/185) `YeetSkillet:fix/powershell-native-stderr` → `main` · +42 −1 · 2 files · 1 commits · merged 2026-11-23 20:51 UTC On Windows PowerShell 5.1, `& .\scripts\test.ps1 *> test.log` exits before `cargo test` when a successful build writes progress to stderr. With `$ErrorActionPreference = 'Stop'`, the first redirected stderr line raises `NativeCommandError`. I reproduced the [case reported on #140](https://github.com/ivall/xcl/pull/140#issuecomment-7111241345) on `main` at `956a476`. The runner now checks that Cargo exists before applying the existing `Continue` preference to both native commands. The build and test exit codes still determine the result. The regression test puts a temporary `cargo.cmd` on PATH and checks that both the native build message and the GPU skip summary reach the redirected log. On Windows 10 22H2, I ran `scripts/test-native-stderr.tests.ps1` in both shells. | Shell | `956a476` | This change | | --- | --- | --- | | Windows PowerShell 5.1 | Exit 1 before the test phase | Pass | | PowerShell 7.6.9 | Pass | Pass | A separate native Cargo stand-in returned `0` on success, `17` on a failing build, and `101` on a failing test. Both shells preserved all three codes. A failing build skipped the test phase, and a missing Cargo exited `1`. I also merged this script separately with the runner changes in #140 and #143. Each merge was conflict-free and passed the new regression in both shells. All four reporting cases from #140 also passed. Validation covered the PowerShell runner with synthetic Cargo output. I did not run the Rust workspace suite. AI-assisted with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:15 +00:00
github manually merged commit d66f4c7dae into gh-pr/185/base 2026-11-26 04:14:17 +00:00
Author
Owner

@⁠WarmMilkCodes on GitHub · 2026-11-23 19:49 UTC · original

Tested d66f4c7 on Windows PowerShell 5.1.22621.6133, Windows 11 23H2 (22631.6199), AMD Radeon RX 6600 XT: pass – reproduces on main, fixed here

Ran the PR's synthetic test and a real redirected run (powershell.exe -NoProfile -Command ".\scripts\test.ps1 *> <log>", with XCL_SPLIT_WAVE64=1 so this card's #155 failure doesn't mask the result), on main 956a476 (with the PR's test file copied in) and on the PR:

main 956a476 PR #185
scripts\test-native-stderr.tests.ps1 fail (exit 1, NativeCommandError) pass
real .\scripts\test.ps1 *> log fail: aborts at cargo build's first stderr line, 0 test binaries run, exit 1 pass: exit 0, all 14 test binaries report

On main the abort is exactly the 5.1 behaviour described:

cargo :    Compiling xcl v0.1.0 (C:\Users\Rabbi\xcl\crates\xcl)
At C:\Users\Rabbi\xcl\scripts\test.ps1:7 char:1
+ cargo build --workspace
    + CategoryInfo          : NotSpecified: (   Compiling xc...xcl\crates\xcl):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
**@⁠WarmMilkCodes** on GitHub · 2026-11-23 19:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/185#issuecomment-7112166147) Tested `d66f4c7` on Windows PowerShell **5.1.22621.6133**, Windows 11 23H2 (22631.6199), AMD Radeon RX 6600 XT: **pass** – reproduces on `main`, fixed here Ran the PR's synthetic test and a real redirected run (`powershell.exe -NoProfile -Command ".\scripts\test.ps1 *> <log>"`, with `XCL_SPLIT_WAVE64=1` so this card's #155 failure doesn't mask the result), on `main` `956a476` (with the PR's test file copied in) and on the PR: | | `main` 956a476 | PR #185 | |---|---|---| | `scripts\test-native-stderr.tests.ps1` | **fail** (exit 1, `NativeCommandError`) | pass | | real `.\scripts\test.ps1 *> log` | **fail**: aborts at `cargo build`'s first stderr line, 0 test binaries run, exit 1 | pass: exit 0, all 14 test binaries report | On `main` the abort is exactly the 5.1 behaviour described: cargo : Compiling xcl v0.1.0 (C:\Users\Rabbi\xcl\crates\xcl) At C:\Users\Rabbi\xcl\scripts\test.ps1:7 char:1 + cargo build --workspace + CategoryInfo : NotSpecified: ( Compiling xc...xcl\crates\xcl):String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
Author
Owner

@⁠ivall on GitHub · 2026-11-23 20:52 UTC · original

Merged (main 2abc562). Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.

**@⁠ivall** on GitHub · 2026-11-23 20:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/185#issuecomment-7113684557) Merged (main 2abc562). Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.
This discussion has been locked. Commenting is limited to contributors.
No description provided.