Skip to content

fix(scripts): use call curl in run.bat so batch control returns after download#131

Merged
aeneasr merged 1 commit intomainfrom
fix/windows-curl-bat-no-return
Apr 14, 2026
Merged

fix(scripts): use call curl in run.bat so batch control returns after download#131
aeneasr merged 1 commit intomainfrom
fix/windows-curl-bat-no-return

Conversation

@aeneasr
Copy link
Copy Markdown
Member

@aeneasr aeneasr commented Apr 14, 2026

Root cause

CMD batch files silently swallow control when one .bat file invokes another without call — the called batch runs, but execution never returns to the caller.

The Windows CI test (test_run_windows.ps1) stubs real curl with a curl.bat shim placed at the front of PATH. When run.bat reaches the download step and invokes:

curl -sfL ... -o "%BINARY%"

CMD finds curl.bat first. Without call, control transfers to curl.bat, the fake download completes (copying the mock binary into place), but run.bat never resumes — "%BINARY%" %* is never executed, stdout is empty, and the MCP handshake assertion fails.

Fix

Add call before all three curl invocations in run.bat. call is a no-op for real .exe files, so production behaviour is unchanged. For .bat/.cmd files on PATH, it ensures the caller gets control back.

Test plan

  • Windows CI test Windows launcher MCP handshake (run.bat stdio) should now pass
  • call curl.exe works identically to curl.exe for the real binary

🤖 Generated with Claude Code

… download

CMD batch files silently swallow control when a .bat file is invoked
without `call` — the called .bat runs, but execution never returns to
the caller.  The Windows CI test stubs real curl with a curl.bat shim
(so it can intercept -o and plant the mock binary).  Without `call`,
run.bat exited immediately after the stub ran and never reached the
`%BINARY% %*` line, producing empty stdout and a failing MCP handshake
assertion.

Using `call curl` is safe for real curl.exe (no-op for executables) and
required for any .bat/.cmd on the PATH.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeneasr aeneasr merged commit e8c8817 into main Apr 14, 2026
9 checks passed
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.

1 participant