Skip to content

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

Closed
Ryongen wants to merge 1 commit into
xcl-dev:mainfrom
Ryongen:scripts/smoke-ps51
Closed

Ryongen wants to merge 1 commit into
xcl-dev:mainfrom
Ryongen:scripts/smoke-ps51

Conversation

@Ryongen

@Ryongen Ryongen commented Nov 24, 2026 •

Copy link
Copy Markdown

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.

PowerShell 5.1 leaves $PSScriptRoot empty while parameter defaults are evaluated, so the script failed unless -Xcl was given.
@Ryongen
Ryongen marked this pull request as ready for review November 24, 2026 02:51
@RandomGithub12309

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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.
  • Scripts: smoke.ps1 finds xcl.exe without -Xcl when started with -File #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

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

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).

@ivall

ivall commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

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.

@ivall ivall closed this Nov 24, 2026
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.

7 participants