-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rush] child_process.spawnSync on windows must set shell: true when targeting a .cmd file #4637
[rush] child_process.spawnSync on windows must set shell: true when targeting a .cmd file #4637
Conversation
@microsoft-github-policy-service agree company="Bentley Systems" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please call out that this is expressly because we are invoking an npm bin stub, since npm bin stubs on Windows are .CMD
files, and Node.js will now refuse to directly invoke a .CMD
file without setting shell: true
.
common/changes/@microsoft/rush/fix-spawnsync-windows_2024-04-11-22-28.json
Outdated
Show resolved
Hide resolved
Co-authored-by: David Michon <[email protected]>
…1-22-28.json Co-authored-by: David Michon <[email protected]>
Thanks - PR title and description updated. |
common/changes/@microsoft/rush/fix-spawnsync-windows_2024-04-11-22-28.json
Outdated
Show resolved
Hide resolved
Closes neoclide/coc-prettier#178 Latest version of Node.js needs to set `shell: true` to spawn option - node-red/node-red#4652 - microsoft/rushstack#4637
Closes neoclide/coc-prettier#178 Latest version of Node.js needs to set `shell: true` to spawn option - node-red/node-red#4652 - microsoft/rushstack#4637
Summary
Adapt to Node.js security release, which disallows .bat and .cmd file spawning without enabling the shell option. As @dmichon-msft notes below, Rush invokes npm bin stubs which are
.CMD
files on Windows.Fixes #4636
Details
Add
shell: true
tochild_process.spawnSync
options when running in Windows, and ensure any path or binstub invoked is formatted appropriately.How it was tested
On both MacOS and Windows:
node ./libraries/rush-lib/dist/scripts/run-rush-install.js install
andnode ./libraries/rush-lib/dist/scripts/run-rush-install.js rebuild
successfully.