Scripts: smoke.ps1 finds xcl.exe on Windows PowerShell 5.1 #624

Closed
Ryongen wants to merge 1 commit from upstream-pr/629 into main
Ryongen commented 2026-11-24 02:41:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Ryongen on 2026-11-24T02:41:19Z.


On Windows PowerShell 5.1, $PSScriptRoot is empty while parameter defaults are evaluated, so smoke.ps1 -Game <folder> fails in Join-Path unless -Xcl is given. The default is now set after param().

What is in it

  • scripts/smoke.ps1: -Xcl defaults to ..\target\release\xcl.exe next to the script, resolved in the body.

Tested

  • Windows 10 22H2 (19045), Windows PowerShell 5.1, RTX 2070 SUPER, Ryzen 7 5800X3D.
  • powershell -File scripts/smoke.ps1 -Game <game folder> -Seconds 20 without -Xcl: before, Join-Path error on the empty path; after, a full xcl-smoke block (exit 0x0, 284 frames).
  • cargo test not rerun for this branch: it changes only the script.

Not tested

  • PowerShell 7 (the change does not depend on the version).

AI use

  • Claude Code with Claude Opus 5.5 found and fixed it and wrote this description.
<!-- greyfinch-sync:ivall/xcl:issue:6573402350 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/629). Originally posted by [Ryongen](https://github.com/Ryongen) on 2026-11-24T02:41:19Z. --- On Windows PowerShell 5.1, `$PSScriptRoot` is empty while parameter defaults are evaluated, so `smoke.ps1 -Game <folder>` fails in `Join-Path` unless `-Xcl` is given. The default is now set after `param()`. **What is in it** - `scripts/smoke.ps1`: `-Xcl` defaults to `..\target\release\xcl.exe` next to the script, resolved in the body. **Tested** - Windows 10 22H2 (19045), Windows PowerShell 5.1, RTX 2070 SUPER, Ryzen 7 5800X3D. - `powershell -File scripts/smoke.ps1 -Game <game folder> -Seconds 20` without `-Xcl`: before, `Join-Path` error on the empty path; after, a full `xcl-smoke` block (exit 0x0, 284 frames). - `cargo test` not rerun for this branch: it changes only the script. **Not tested** - PowerShell 7 (the change does not depend on the version). **AI use** - Claude Code with Claude Opus 5.5 found and fixed it and wrote this description.
RandomGithub12309 commented 2026-11-24 07:06:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RandomGithub12309 on 2026-11-24T04:39:48Z.


Independent test report and review of 7728d1906cb923c005e04960adfd78a5931a7a47:

Tested

  • OS / Shell: Windows 11 Build 26300, Windows PowerShell 5.1
  • Command: powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\smoke.ps1 -Game 'Z:\missing' -Seconds 1 (run without -Xcl from repo root, scripts\, and crates\)
  • Result: Resolved target\release\xcl.exe in all three working directories and executed xcl.exe (failing cleanly on Z:\missing with XCL printed no log path instead of failing on no ..\target\release\xcl.exe).

Review

  • Clean targeted fix moving $PSScriptRoot resolution out of param(). Found no bugs.

Not tested

  • PowerShell 7 (pwsh), full 60 s retail game run on this commit

AI use

  • Antigravity with Gemini 4 Hydrogen — checked out 7728d19, reviewed the diff, ran the PowerShell 5.1 checks, and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7122224245 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/629#issuecomment-7122224245). Originally posted by [RandomGithub12309](https://github.com/RandomGithub12309) on 2026-11-24T04:39:48Z. --- Independent test report and review of `7728d1906cb923c005e04960adfd78a5931a7a47`: **Tested** - OS / Shell: Windows 11 Build 26300, Windows PowerShell 5.1 - Command: `powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\smoke.ps1 -Game 'Z:\missing' -Seconds 1` (run without `-Xcl` from repo root, `scripts\`, and `crates\`) - Result: Resolved `target\release\xcl.exe` in all three working directories and executed `xcl.exe` (failing cleanly on `Z:\missing` with `XCL printed no log path` instead of failing on `no ..\target\release\xcl.exe`). **Review** - Clean targeted fix moving `$PSScriptRoot` resolution out of `param()`. Found no bugs. **Not tested** - PowerShell 7 (`pwsh`), full 60 s retail game run on this commit **AI use** - Antigravity with Gemini 4 Hydrogen — checked out `7728d19`, reviewed the diff, ran the PowerShell 5.1 checks, and wrote this report.
futurepro62 commented 2026-11-24 07:06:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T04:44:09Z.


Tested exact head 7728d19. This fixes the same $PSScriptRoot problem as #593, so I ran #593's regression test (scripts/smoke-default-xcl.tests.ps1 from 3766ff0) against this PR's smoke.ps1.

Tested

  • Windows 11 Home 26300, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here), Python 3.14.3.
  • #593's test with this PR's smoke.ps1: passed (exit 0). With the parent 9ce2070's smoke.ps1: fails (exit 1) with the Join-Path empty-string error. So both PRs fix the same failure; only one of them should land.
  • End to end with a temporary game folder My Game Folder and a fake xcl.cmd that prints a log path (the same kind of fixture smoke-environment.tests.ps1 uses), smoke.ps1 -Game <folder> -Seconds 1 -Xcl <fake>, on Windows PowerShell 5.1: prints the xcl-smoke v1 block (exit: 0x0).

Not tested

  • PowerShell 7, a real title.

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and the fixture runs and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7122289823 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/629#issuecomment-7122289823). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T04:44:09Z. --- Tested exact head `7728d19`. This fixes the same `$PSScriptRoot` problem as #593, so I ran #593's regression test (`scripts/smoke-default-xcl.tests.ps1` from `3766ff0`) against this PR's `smoke.ps1`. **Tested** - Windows 11 Home 26300, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here), Python 3.14.3. - #593's test with this PR's `smoke.ps1`: passed (exit 0). With the parent `9ce2070`'s `smoke.ps1`: fails (exit 1) with the `Join-Path` empty-string error. So both PRs fix the same failure; only one of them should land. - End to end with a temporary game folder `My Game Folder` and a fake `xcl.cmd` that prints a log path (the same kind of fixture `smoke-environment.tests.ps1` uses), `smoke.ps1 -Game <folder> -Seconds 1 -Xcl <fake>`, on Windows PowerShell 5.1: prints the `xcl-smoke v1` block (`exit: 0x0`). **Not tested** - PowerShell 7, a real title. **AI use** - Claude Code (Claude Opus 5.5) ran the tests and the fixture runs and wrote this report. I checked it before posting.
upipibi commented 2026-11-24 07:06:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T05:41:08Z.


Full-suite run on this PR's head 7728d19, for the counts CONTRIBUTING.md item 2 asks for:

Tested

  • NVIDIA GeForce RTX 3070 (driver 616.56, wave32), Ryzen 9 5950X, Windows 11 Pro 26100, rustc 1.100.0 MSVC, debug
  • cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4: 684 passed, 0 failed, 41 ignored (16 test binaries, the e2e title included)
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested: AMD / wave64; no retail title (this PR changes only scripts/smoke.ps1).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7123178142 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/629#issuecomment-7123178142). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T05:41:08Z. --- Full-suite run on this PR's head `7728d19`, for the counts CONTRIBUTING.md item 2 asks for: **Tested** - NVIDIA GeForce RTX 3070 (driver 616.56, wave32), Ryzen 9 5950X, Windows 11 Pro 26100, rustc 1.100.0 MSVC, debug - `cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **684 passed, 0 failed, 41 ignored** (16 test binaries, the e2e title included) - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) **Not tested:** AMD / wave64; no retail title (this PR changes only `scripts/smoke.ps1`). AI-assisted (Claude Code).
SpaghettiMaster545 commented 2026-11-24 11:05:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SpaghettiMaster545 on 2026-11-24T10:43:07Z.


This is the same change as #593, which was opened 28 minutes earlier (02:13 vs 02:41 UTC) and moves the -Xcl default into the script body in the same way.

#593 also includes a regression test, scripts/smoke-default-xcl.tests.ps1. It starts the script with -File and without -Xcl, then checks the resolved path. The PowerShell 7 output normalisation that reviewers found is in it as well. @futurepro62 ran that test against this PR's script above.

CONTRIBUTING says that when several PRs solve the same problem, all but one are closed. I'm raising it here so the maintainer can choose one.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7129152005 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/629#issuecomment-7129152005). Originally posted by [SpaghettiMaster545](https://github.com/SpaghettiMaster545) on 2026-11-24T10:43:07Z. --- This is the same change as #593, which was opened 28 minutes earlier (02:13 vs 02:41 UTC) and moves the `-Xcl` default into the script body in the same way. #593 also includes a regression test, `scripts/smoke-default-xcl.tests.ps1`. It starts the script with `-File` and without `-Xcl`, then checks the resolved path. The PowerShell 7 output normalisation that reviewers found is in it as well. @futurepro62 ran that test against this PR's script above. CONTRIBUTING says that when several PRs solve the same problem, all but one are closed. I'm raising it here so the maintainer can choose one. AI-assisted (Claude Code).
tiagonleal commented 2026-11-24 13:03:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-24T12:59:30Z.


Tested #593 (0a5f23c) and #629 (7728d19) on Windows PowerShell 5.1 (powershell.exe, Windows 11 Pro 26300), each smoke.ps1 started with -File and no -Xcl from a checkout without a release build:

smoke.ps1 from result
main 47efa2e Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
#593 no …\scripts\..\target\release\xcl.exe - build it first (…)
#629 the same as #593

#593's scripts/smoke-default-xcl.tests.ps1 on 5.1: exits 1 with main's smoke.ps1, 0 with #593's. The smoke.ps1 change is the same in both PRs (#593 was opened first and adds the test).

Not tested: PowerShell 7; a full smoke run through either default (I pass -Xcl for those).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7132196299 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/629#issuecomment-7132196299). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-24T12:59:30Z. --- Tested #593 (`0a5f23c`) and #629 (`7728d19`) on Windows PowerShell 5.1 (`powershell.exe`, Windows 11 Pro 26300), each `smoke.ps1` started with `-File` and no `-Xcl` from a checkout without a release build: | `smoke.ps1` from | result | |---|---| | `main` `47efa2e` | `Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.` | | #593 | `no …\scripts\..\target\release\xcl.exe - build it first (…)` | | #629 | the same as #593 | #593's `scripts/smoke-default-xcl.tests.ps1` on 5.1: exits 1 with `main`'s `smoke.ps1`, 0 with #593's. The `smoke.ps1` change is the same in both PRs (#593 was opened first and adds the test). Not tested: PowerShell 7; a full smoke run through either default (I pass `-Xcl` for those). AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-24 21:04:13 +00:00
ivall commented 2026-11-24 21:09:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T20:43:25Z.


Closing this as a duplicate: #593 makes the same change and was opened first (smoke.ps1 sets the default of -Xcl in its body). It stays open and is the one that will be reviewed and merged.

This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #593 does not, or #593 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #593.

Thank you for the work.

AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's.

<!-- greyfinch-sync:ivall/xcl:comment:7143969563 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/629#issuecomment-7143969563). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T20:43:25Z. --- Closing this as a duplicate: #593 makes the same change and was opened first (smoke.ps1 sets the default of -Xcl in its body). It stays open and is the one that will be reviewed and merged. This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #593 does not, or #593 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #593. Thank you for the work. AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's.

Pull request closed

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!624
No description provided.