Skip to content

Scripts: preserve trailing backslashes in native smoke paths - #2721

Draft
luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/smoke-native-game-quoting
Draft

luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/smoke-native-game-quoting

Conversation

@luckyteagirl

@luckyteagirl luckyteagirl commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Escape terminal backslashes before the closing quote for the native launcher. Verify what a real executable receives for paths with spaces and a drive root.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
@RavenCurseBurg

RavenCurseBurg commented Nov 26, 2026 •

Copy link
Copy Markdown

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.

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.

2 participants