Repository navigation
Move away from cross-spawn - #1251
Merged
Merged
Conversation
sindresorhus
force-pushed
the
inline-cross-spawn
branch
2 times, most recently
from
July 4, 2026 23:38
08f6044 to
d02fe20
Compare
sindresorhus
force-pushed
the
inline-cross-spawn
branch
from
July 5, 2026 00:23
6ddd75c to
1280ace
Compare
Collaborator
|
That's amazing. I can't believe all our current tests are passing! |
This was referenced Sep 3, 2026
timotheeguerin
added a commit
to timotheeguerin/typespec
that referenced
this pull request
Sep 3, 2026
…ft#11852) execa 10 rewrote how it spawns commands on Windows ([microsoft#1251](sindresorhus/execa#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: ```bat 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #578