Closed deepak1556 closed 1 month ago
If SAM CLI is a .cmd file on Windows, this likely affects all of the related ChildProcess invocations. Example: https://github.com/aws/aws-toolkit-vscode/blob/80e715bbf3e6eb354a9b6e5e327c732b89df38e3/packages/core/src/shared/sam/cli/samCliInfo.ts#L17
This shouldn't affect EC2 connect nor CodeCatalyst connect, since the .ps1 files are part of the sshconfig ProxyCommand and not directly invoked by us.
It looks like sam is for sure a .cmd on windows:
CommandType Name Version Source
----------- ---- ------- ------
Application sam.cmd 0.0.0.0 C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd
I tried this out on:
Version: 1.92.0-insider (user setup)
Commit: 4d17e85cfd911fb6b116e08a4d7c37cd725a966a
Date: 2024-07-26T13:12:28.318Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045
Things I tried:
sam init
to create a node 20 project.
sam init
to create a python 3.11 project.
I looked a deeper look into how we wrap our child process calls. Turns on we use crossSpawn which takes care of commands with spaces and seems to ensure the correct execution of commands if a shell is needed for windows
I guess that makes sense why none of our tests were failing
Hello from the VS Code team 👋
In our next release v1.92, we will update to Electron 30 which includes Node.js 20.14.0. This Node version contains a breaking change, in response to a CVE, which may affect you if you execute
.bat
or.cmd
files on Windows. Based on a simple scan of your extension's source code, you may be impacted by this change. The stable VS Code that contains this update will be released in early August.Action: please try out your extension on this month's VS Code Insiders on Windows. If you are affected by this change, you will encounter an
EINVAL
error when you try to spawn a bat/cmd file.Node.js has added a section on batch file spawning to their documentation. To fix any issues:
child_process.spawn
to execute a batch file on Windowsshell: true
orshell: process.platform === 'win32'
to the options objectPlease let us know if you run into issues or if you need clarification.
Happy coding!