Scripts: preserve trailing backslashes in native smoke paths #2711

Closed
luckyteagirl wants to merge 1 commit from upstream-pr/2721 into main
luckyteagirl commented 2026-11-26 08:26:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:26:13Z.


For a native xcl.exe launcher, scripts/smoke.ps1 constructs a quoted run argument. If the -Game path ends in a backslash, that backslash escapes the closing quote in Windows argument parsing: the executable receives a trailing " instead of the requested path. Double only the terminal backslashes before the closing quote.

What is in it

  • scripts/smoke.ps1: escape terminal backslashes in the native .exe argument path; keep the separate .cmd/.bat launch path intact.
  • scripts/smoke-native-arguments.tests.ps1: use a real Python executable as a synthetic launcher and check the exact received path for zero, one, and two terminal backslashes and a drive root.

Tested

  • Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (driver 30.0.13002.13003), Rust 1.99.0 MSVC, Python 3.11.9; PowerShell 5.1.26100 and 7.6.9. The synthetic tests do not use the GPU.
  • Failing-first native launcher fixture on the parent commit: one terminal slash and a drive root were received as a trailing quote, and two terminal slashes were received as one, in both PowerShell versions.
  • powershell.exe -NoProfile -File .\scripts\smoke-native-arguments.tests.ps1 and pwsh.exe -NoProfile -File .\scripts\smoke-native-arguments.tests.ps1: both passed on this head.
  • scripts/test-smoke-artifacts.tests.ps1 and scripts/smoke-title.tests.ps1: each passed in both PowerShell versions (six focused invocations passed in total).
  • git diff HEAD^ HEAD --check: passed.

Not tested

  • The workspace GPU suite or a retail-title smoke for this script-only change. The new native-argument fixture requires Python on PATH.

AI use

  • OpenAI Codex (GPT-6.2 Sol) reproduced the native argument issue, implemented the fix and fixture, and ran the PowerShell checks. OpenAI Codex (GPT-6.2 Astra) reviewed the diff and reran all six focused invocations; a second GPT-6.2 Sol agent checked the quoting and interaction with #2714/#2716.
<!-- greyfinch-sync:ivall/xcl:issue:5506539749 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2721). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T08:26:13Z. --- For a native `xcl.exe` launcher, `scripts/smoke.ps1` constructs a quoted `run` argument. If the `-Game` path ends in a backslash, that backslash escapes the closing quote in Windows argument parsing: the executable receives a trailing `"` instead of the requested path. Double only the terminal backslashes before the closing quote. **What is in it** - `scripts/smoke.ps1`: escape terminal backslashes in the native `.exe` argument path; keep the separate `.cmd`/`.bat` launch path intact. - `scripts/smoke-native-arguments.tests.ps1`: use a real Python executable as a synthetic launcher and check the exact received path for zero, one, and two terminal backslashes and a drive root. **Tested** - Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (driver 30.0.13002.13003), Rust 1.99.0 MSVC, Python 3.11.9; PowerShell 5.1.26100 and 7.6.9. The synthetic tests do not use the GPU. - Failing-first native launcher fixture on the parent commit: one terminal slash and a drive root were received as a trailing quote, and two terminal slashes were received as one, in both PowerShell versions. - `powershell.exe -NoProfile -File .\scripts\smoke-native-arguments.tests.ps1` and `pwsh.exe -NoProfile -File .\scripts\smoke-native-arguments.tests.ps1`: both passed on this head. - `scripts/test-smoke-artifacts.tests.ps1` and `scripts/smoke-title.tests.ps1`: each passed in both PowerShell versions (six focused invocations passed in total). - `git diff HEAD^ HEAD --check`: passed. **Not tested** - The workspace GPU suite or a retail-title smoke for this script-only change. The new native-argument fixture requires Python on `PATH`. **AI use** - OpenAI Codex (GPT-6.2 Sol) reproduced the native argument issue, implemented the fix and fixture, and ran the PowerShell checks. OpenAI Codex (GPT-6.2 Astra) reviewed the diff and reran all six focused invocations; a second GPT-6.2 Sol agent checked the quoting and interaction with #2714/#2716.
RavenCurseBurg commented 2026-11-26 09:07:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T08:42:16Z.


I compared exact heads 18d6817af378 and #588 at 1707802. On both, a native stand-in received exactly run and the supplied directory argument in both shells. Cases covered a spaced Unicode directory, one and two trailing backslashes, a drive root, and a relative path ending in a backslash. On main b49be183, the native child received the wrong argument for all four backslash-ending cases. On this head the batch launcher also received the original argument in all five cases per shell.

The change merges cleanly with #2684 at a9d11d6c6f85 (tree 2bcfce2842f47a079940736b28e9158bb689f68a). With the PowerShell working location deliberately different from the process directory, the combined script sent the path resolved against the PowerShell location to both launchers. This head alone preserved the relative spelling. The native quoting behavior therefore overlaps with #588, while relative-path resolution was supplied by #2684. The native-arguments, artifact and title fixtures on this head all passed in both shells; the fixtures used a stand-in for adapter discovery.

Windows PowerShell 5.1 and PowerShell 7.6.9 on Windows 11. OpenAI Codex (GPT-6) prepared and ran the fixtures. Synthetic logs, reports and immediately exiting launchers only; no game, GPU workload or workspace build.

<!-- greyfinch-sync:ivall/xcl:comment:7186916704 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2721#issuecomment-7186916704). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T08:42:16Z. --- I compared exact heads `18d6817af378` and [#588 at `1707802`](https://github.com/xcl-dev/xcl/pull/588). On both, a native stand-in received exactly `run` and the supplied directory argument in both shells. Cases covered a spaced Unicode directory, one and two trailing backslashes, a drive root, and a relative path ending in a backslash. On main `b49be183`, the native child received the wrong argument for all four backslash-ending cases. On this head the batch launcher also received the original argument in all five cases per shell. The change merges cleanly with #2684 at `a9d11d6c6f85` (tree `2bcfce2842f47a079940736b28e9158bb689f68a`). With the PowerShell working location deliberately different from the process directory, the combined script sent the path resolved against the PowerShell location to **both** launchers. This head alone preserved the relative spelling. The native quoting behavior therefore overlaps with #588, while relative-path resolution was supplied by #2684. The native-arguments, artifact and title fixtures on this head all passed in both shells; the fixtures used a stand-in for adapter discovery. Windows PowerShell 5.1 and PowerShell 7.6.9 on Windows 11. OpenAI Codex (GPT-6) prepared and ran the fixtures. Synthetic logs, reports and immediately exiting launchers only; no game, GPU workload or workspace build.
luckyteagirl commented 2026-11-27 06:59:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-27T06:59:33Z.


Superseded by #588, which fixes the same trailing-backslash argument quoting in smoke.ps1. Its native fixture covers zero, one, and two trailing backslashes; the same doubling also covers a drive root. Keeping #588 as the single implementation for review.

<!-- greyfinch-sync:ivall/xcl:comment:7212036864 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2721#issuecomment-7212036864). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-27T06:59:33Z. --- Superseded by #588, which fixes the same trailing-backslash argument quoting in smoke.ps1. Its native fixture covers zero, one, and two trailing backslashes; the same doubling also covers a drive root. Keeping #588 as the single implementation for review.

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