Skip to content

Pin execa to 9.x to fix Windows batch file argument escaping - #11852

Merged
iscai-msft merged 1 commit into
microsoft:mainfrom
timotheeguerin:timotheeguerin/pin-execa-9
Sep 3, 2026
Merged

iscai-msft merged 1 commit into
microsoft:mainfrom
timotheeguerin:timotheeguerin/pin-execa-9

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

execa 10 rewrote how it spawns commands on Windows (#1251, which replaced cross-spawn). It now caret-escapes every argument twice for any .cmd/.bat file, on the assumption that the batch file is an npm cmd-shim which re-expands %* through a second cmd.exe parse. cross-spawn only did that for actual shims under node_modules/.bin.

Batch files that inspect their own arguments instead of forwarding them get the extra carets verbatim and break. Maven's mvn.cmd is one of them:

if "%~1" == "-f" (

so mvn clean install spawned through execa dies immediately on Windows with:

The syntax of the command is incorrect.
ExecaError: Command failed with exit code 255: mvn clean install ...

This already breaks the typespec-java generator build in typespec-azure, which invokes Maven through execa and takes this catalog. What execa 10 produces versus 9:

cmd.exe /q /d /s /c "…\mvn.cmd ^^^"clean^^^" ^^^"install^^^" …"   # 10.0.1 — mvn.cmd chokes
cmd.exe    /d /s /c "…\mvn.cmd ^"clean^" ^"install^" …"           # 9.6.1  — works

There is no upstream issue or fixed release yet (10.0.1 is latest), so this pins the catalog back to ^9.6.1 with a comment. Nothing in this repo uses the execa 10 API surface (nodeChildProcess, killDescendants, the new stream methods), so the downgrade is a no-op here beyond the Windows behavior.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A .chronus/changes entry appears required for this non-excluded dependency change per .chronus/config.yaml.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Pins execa in the pnpm catalog back to the 9.x line to avoid the Windows .cmd/.bat double-caret escaping behavior introduced in execa 10, which breaks batch files like Maven’s mvn.cmd.

Changes:

  • Update the pnpm catalog to use execa: ^9.6.1 with an explanatory comment.
  • Update the lockfile to resolve execa to 9.6.1 (and adjust transitive deps accordingly).
File summaries
File Description
pnpm-workspace.yaml Pins execa to 9.6.1 in the workspace catalog with rationale for the Windows behavior regression in execa 10.
pnpm-lock.yaml Updates the resolved execa version (and related snapshot entries) to match the catalog pin.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pnpm-workspace.yaml Resolved
@azure-sdk-automation

azure-sdk-automation Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@iscai-msft
iscai-msft disabled auto-merge September 3, 2026 16:50
@iscai-msft
iscai-msft added this pull request to the merge queue Sep 3, 2026
Merged via the queue into microsoft:main with commit 716f61f Sep 3, 2026
32 of 33 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.

3 participants