-
Notifications
You must be signed in to change notification settings - Fork 461
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
CMake executable cannot be a script #4037
Comments
This is a relevant issue for us too, and a regression over some previous version (unsure which version). |
@JVApen @emmenlau If you could provide some more information about this issue, that would be great. For example, repro steps to reproduce this, or a small exacmple of a script you're using. Looking at the code, nothing between version 1.18.44 and 1.19.50 was changed when checking the cmake.exe, so I wouldn't expect that it's causing an issue. Therefore, more investigation may be needed and any repro steps can help with that. Thanks! |
@gcampbell-msft : see my first event, simple CMD file with |
Dear @gcampbell-msft ,
|
@JVApen When trying to reproduce with these steps: #4037 (comment), I notice that the "Bad CMake executable" popup appears in 1.18.44 as well. Do you also see this? |
Dear @gcampbell-msft , sadly I can not say which version worked for me before. We have an isolated system that is not updated too frequently. I would think that the last working version was from about 6 months ago (both VSCode and all extensions), but I may be off a bit there. In case that helps, we're using the same scripting "trick" on Linus and MacOS every day, and there it works flawless. These systems are updated very frequently, and used more than our Windows environment. So the problem is Windows-only, and I would think it has to do with not allowing nodejs to spawn bat files. I can only say this worked at some point, for at least a few months, maybe the better part of a year. Does the suggestion from @JVApen help, about https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows? |
@JVApen @emmenlau I've tracked the issue down. This didn't come from a CMake Tools update, but rather a VS Code update. In July, VS Code updated to 1.92 which now uses Node 20. This contains a breaking change for spawn, which we weren't aware of. Could you please test the vsix (after modifying the file extension from .zip to .vsix) from here? |
Dear @gcampbell-msft , awesome!!! This indeed fixes the issue!!! Just to confirm, the linked extension will identify itself as Regression fixed! |
This fix would allow converting windows paths to cygwins posix paths, too: #4038 Or even load shells for Cygwin, MSys etc. |
Small hint in case it help. There was a breaking change in NodeJS that it requires to pass |
Thanks @dbaeumer for the hint! However the regression has already been fixed. Do you think that the fix requires more attention? |
@emmenlauif it works you are fine. The |
Dear @dbaeumer , so just to be double sure: You are saying that the fix is fine as it is, and nothing else needs to be done, correct? |
Correct. |
Brief Issue Summary
The option "cmake.cmakePath" cannot refer to a script.
For example: (cmake.bat)
(In the real case, this is more complex as this triggers some remote execution)
Output:
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
I already did some reverse engineering on the code.
proc.ts has a method called execute which accepts some options. If options.shell is set to true, it should enable the shell option as described in https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
However cmakeExecutable.ts in the method getCMakeExecutableInformation doesn't pass this option.
const execOpt: proc.ExecutionOptions = { showOutputOnError: true };
The text was updated successfully, but these errors were encountered: