Allow redirected Cargo progress in Windows PowerShell 5.1 #182

Merged
YeetSkillet merged 1 commit from upstream-pr/185 into main 2026-11-23 20:51:52 +00:00
YeetSkillet commented 2026-11-23 19:32:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by YeetSkillet on 2026-11-23T19:32:40Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6567213950 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/185). Originally posted by [YeetSkillet](https://github.com/YeetSkillet) on 2026-11-23T19:32:40Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:57:33 +00:00
WarmMilkCodes commented 2026-11-24 07:04:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by WarmMilkCodes on 2026-11-23T19:49:57Z.


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
<!-- greyfinch-sync:ivall/xcl:comment:7112166147 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/185#issuecomment-7112166147). Originally posted by [WarmMilkCodes](https://github.com/WarmMilkCodes) on 2026-11-23T19:49:57Z. --- 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
ivall commented 2026-11-24 07:04:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T20:52:44Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7113684557 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/185#issuecomment-7113684557). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T20:52:44Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!182
No description provided.