Repository navigation
Scripts: smoke.ps1 finds xcl.exe without -Xcl when started with -File - #593
SpaghettiMaster545 wants to merge 1 commit into
Conversation
|
Tested exact head Tested
Not tested
AI use
|
|
Ran this end to end with a retail title, on the exact head I ran into the bug myself before finding this PR. I was making regression runs for another change, and on
(My Windows is in Portuguese, so that's the English wording of the same error.) It's line 11, the Tested
Not tested
AI use
|
|
Found a small issue with the regression test on PowerShell 7.6.10. The actual smoke.ps1 fix works, but the test fails because PowerShell 7 inserts formatting characters into the exception output. Tested
Running Suggested fix In $flat = $output -replace '\s', ''with: $flat = $output -replace '\x1b\[[0-?]*[ -/]*[@-~]', '' -replace '[\s|]', ''I validated this change using temporary copies of the scripts:
The baseline still fails with the expected Join-Path empty-string error on PS 5.1. The proposed normalization preserves detection of the original bug while fixing the false negative |
|
I also hit the fixture’s formatting failure on PowerShell 7.6.9. To check executable selection separately, I ran
The default stub reported 7 synthetic frames and the override reported 11, so each successful run confirmed which executable launched. The original fixture passed on 5.1 and failed on 7.6.9. Stripping the leading Scope: Windows 11 build 26200, synthetic executables only. AI use: OpenAI Codex (GPT-6) wrote and ran the probe and drafted this report. |
3766ff0 to
0a5f23c
Compare
Windows PowerShell 5.1 leaves $PSScriptRoot empty in the parameter defaults of a script that has [Parameter()] attributes when the script is started with `powershell -File` (or dot-sourced), so the default `-Xcl (Join-Path $PSScriptRoot ...)` failed with "Cannot bind argument to parameter 'Path' because it is an empty string" before the script did anything. Started with `&` from an open PowerShell session it works, which is why it went unnoticed. The default is now set in the script's body, where $PSScriptRoot is set in every case. scripts/smoke-default-xcl.tests.ps1 runs a copy of the script outside the repository through -File without -Xcl and checks that it looks for target\release\xcl.exe next to its own folder. It compares the child's error text without whitespace, ANSI escapes and the `|` that PowerShell 7 puts before wrapped error lines (found by fladit123 and Alpha325 on PowerShell 7.6.10 and 7.6.9 in the PR's review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @fladit123 and @Alpha325: you're right, the fix worked on PowerShell 7 but the test's comparison did not. On Windows PowerShell 5.1 here, the test passes on (Claude Code, Claude Opus 5.5.) |
fladit123
left a comment
There was a problem hiding this comment.
Thanks for incorporating the normalization!
Retested the exact updated head 0a5f23c3b5ddc331ea941e19ccfaae30b9eb529a on Windows 11 Pro build 26300.
| Test | PowerShell 5.1 | PowerShell 7.6.10 |
|---|---|---|
| smoke-default-xcl.tests.ps1 | PASS | PASS |
| test-native-stderr.tests.ps1 | PASS | PASS |
All four commands returned exit code 0. The worktree remained clean.
The previously reported PowerShell 7 fixture failure is resolved. I reviewed the updated normalization and have no remaining blocking findings within the tested scope.
No Rust workspace or retail tests were rerun for this revision.
AI use: ChatGPT (GPT-6.2) assisted with review, test planning and reporting. All tests were executed locally by me.
|
The required |
|
Tested #593 (
#593's Not tested: PowerShell 7; a full smoke run through either default (I pass AI-assisted (Claude Code). |
|
Independent Windows PowerShell 5.1 check of this fix at Tested
Not tested AI use |
scripts/smoke.ps1started withpowershell -File(or dot-sourced) under Windows PowerShell 5.1 stopped before doing anything when-Xclwas left out:Windows PowerShell 5.1 leaves
$PSScriptRootempty in the parameter defaults of a script that has[Parameter()]attributes when the script is started with-File, and the default was-Xcl (Join-Path $PSScriptRoot '..\target\release\xcl.exe'). Started with&from an open PowerShell session it works, so the usage line in the script's header was not affected. #451's description mentions the same problem ("Windows PowerShell 5.1 does not set$PSScriptRootin the parameter default, hence-Xcl"), and the tests in #282 and #521 pass-Xclexplicitly.I searched open and closed PRs and issues for "PSScriptRoot", "smoke.ps1 PowerShell 5.1" and "smoke.ps1 -Xcl". #318 (merged) fixed the other Windows PowerShell 5.1 problems of this script (New-TemporaryFile, Start-Process), not this one.
What is in it
scripts/smoke.ps1:-Xclhas no default inparam(); the script sets it right after, where$PSScriptRootis always set. Nothing else changes.scripts/smoke-default-xcl.tests.ps1: runs a copy ofsmoke.ps1outside the repository through-Filewithout-Xcland checks that it looks fortarget\release\xcl.exenext to its own folder (the copy finds noxcl.exe, so nothing runs). It compares the child's error text without whitespace, ANSI escapes and the|that PowerShell 7 puts before wrapped error lines (reported by @fladit123 and @Alpha325 in review).Tested
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\smoke-default-xcl.tests.ps1on this PR's head (0a5f23c): exit 0. Withscripts/smoke.ps1put back to9ce2070's, the same test fails with theJoin-Patherror above (exit 1), so it still catches the bug.0a5f23cis the one @fladit123 and @Alpha325 checked on those versions; I could not run PowerShell 7 here.cargo build --workspace, thencargo test --workspace -- --test-threads=4at3766ff0: 684 passed, 0 failed, 41 ignored (lib 644 / 0 / 21).0a5f23cchanges only the.ps1test since.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).powershell.exe -NoProfile -File <repo>\scripts\smoke.ps1 -Game <retail title> -Seconds 30without-Xcl, release build of this PR (at ed85053, before the rebase onto 9ce2070, which changed only Rust files): the script foundtarget\release\xcl.exeand printed itsxcl-smokeblock (590 frames shown, 0 crashes, 0 device removals). Onmainthe same command stops at theJoin-Patherror.Not tested
crates/xcl/src.AI use
🤖 Generated with Claude Code