Repository navigation
Description
Summary
Two small defects in the run block of scripts/smoke.ps1 (426a5a7). Neither changes the numbers in the block; both change what the machine does around it.
1. XCL_NETWORK=0 is left set in the caller's session
$env:XCL_NETWORK = '0'
$env:XCL_RUN_SECONDS = "$Seconds"
$env:XCL_ACTIVITY = '1'
$null = $p.Start()
...
Remove-Item Env:XCL_RUN_SECONDS, Env:XCL_ACTIVITYThree variables are set, two are removed. A script runs in the caller's process, so XCL_NETWORK=0 stays in the PowerShell session after .\scripts\smoke.ps1 returns, and everything started from that window afterwards inherits it:
- a later
xcl runin the same session is silently offline, which is easy to misread as a title or network bug; - someone checking the "
XCL_NETWORK=0still connects, still binds UDP 3074" reports (XCL_NETWORK=0:ConnectExstill connects (main a6f5f7a) #444, XCL_NETWORK=0: the title still binds UDP 3074 on every interface (Windows Firewall asks, the network can reach it) #568) in that window gets a misleading result whichever way it goes; - a wrapper inherits it too:
scripts/test-smoke-artifacts.tests.ps1runssmoke.ps1twice in the runner's session; - and if the session already had
XCL_NETWORKset to something else, the script overwrites it and never puts it back.
The same three variables also survive any throw before the Remove-Item line - XCL printed no log path is one - because nothing restores them on the way out. A try/finally around the run covers both cases: save the three values first, restore them in the block.
2. A -Game path ending in a backslash breaks the command line
$psi.FileName = $Xcl
$psi.Arguments = 'run "' + $Game + '"'ProcessStartInfo.Arguments is one command-line string, so Windows parses it by its usual rules: a backslash directly before a quote does not escape anything, it makes that quote literal. So -Game 'D:\Games\Foo\' produces the command line run "D:\Games\Foo\", and XCL receives D:\Games\Foo" with no closing quote - a path error that says nothing about the real cause. The cmd.exe branch (/c ""<xcl>" run "<game>"") has the same hole.
This is not a hypothetical input shape: scripts/smoke-title.tests.ps1 already passes D:\Games\<name>\ with a trailing separator in its foreach ($game in @(...)) loop, but it asserts only the title: hash, so the command line built from that value is never exercised - the fixture is a .cmd that ignores its arguments.
Suggested fix
$Game = $Game.TrimEnd('\')before the block that builds $psi, plus the save/restore above. Trimming the separator does not change the title: line, which hashes (Split-Path $Game -Leaf).Trim().
Not reported elsewhere
Searched open and closed issues for smoke.ps1, XCL_NETWORK, trailing backslash and command line escaping: nothing covers either point. #717 and #1855 are about what the block says; #1506 and #2213 are about how it is compared.
Not tested
- No local run: this is read from
426a5a7without a checkout, and both points are visible in the source. The-Gamefix should be checked under bothpowershell.exeandpwsh.exe, since 5.1 and 7 pass the same string toCreateProcess.
AI use
- Claude (Opus 5.5) read
scripts/smoke.ps1,scripts/smoke-title.tests.ps1andscripts/test-smoke-artifacts.tests.ps1on426a5a7, wrote this report and the two fixes; the human account checked each claim against the files before opening it.
Activity
upipibi commentedon Nov 25, 2026
@itsonewi Both of these already have open PRs, in case that saves a third one:
XCL_NETWORK=0left set: Scripts: preserve the calling shell environment after smoke runs #521 (wileyGray,9bb6aa2, mergeable). It savesXCL_NETWORK,XCL_RUN_SECONDSandXCL_ACTIVITYbeforeStart()and restores all three in afinally, so the caller's values come back, unset ones included.-Gameending in a backslash: Scripts: preserve trailing backslashes in smoke game paths #588 (luna020924,1707802). It doubles the trailing backslashes before the closing quote ($Game -replace '\+\z', '$0$0'). It conflicts withmainnow, so it needs a rebase.I only read the two diffs against
main1a0bbe3a; I didn't run them.AI-assisted (Claude Code).
itsonewi commentedon Nov 25, 2026
Thanks @upipibi - you are right, and both are open: I checked the two diffs against
1a0bbe3aand they cover the two halves of this report.XCL_NETWORK,XCL_RUN_SECONDSandXCL_ACTIVITYin afinallyaroundProcess.Start, which is what point 1 needs (and it goes further than the report: the caller's original values come back, absent ones included, and a failed launch is covered too).main, so it needs the rebase.How I missed them: my duplicate search used
is:issue, which drops pull requests from the results, so both PRs were invisible to it. That is my mistake, not a judgement call.Closing this as a duplicate. The only thing worth keeping from it is the two fixes in one place: whoever lands first, the other's file and test do not overlap, so both can merge.