vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Changing cmake path to an invalid location force user to restart VS Code to proceed
Brief Issue Summary
I've changed cmake.path to a non existing location & saved the changes. I can see Bad cmake executable error coming, which is obvious.
Now I changed the cmake executable to existing one, still it's not working, giving bad cmake executable error, I had to restart VS Code to get rid of this issue.
CMake Tools Diagnostics
{
"os": "win32",
"vscodeVersion": "1.86.0",
"cmtVersion": "1.16.32",
"configurations": [
{
"folder": "c:\\Users\\test",
"cmakeVersion": "unknown",
"configured": false,
"generator": "unknown",
"usesPresets": false,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": true,
"hasCodeModel": true,
"activeBuildType": "Debug",
"buildTypesSeen": [
"Debug"
],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 3,
"executablesCount": 1,
"librariesCount": 1,
"targets": [
{
"name": "test.elf",
"type": "EXECUTABLE"
},
{
"name": "create-objdump",
"type": "UTILITY"
},
{
"name": "test",
"type": "STATIC_LIBRARY"
}
]
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": null
}
]
}
Debug Log
No response
Additional Information
No response
@vinodappu Thanks for letting us know. We'll mark this as a bug and place it on our backlog of bugs to fix.
Related is when CMake is installed after launching VS Code. An example that I frequently encounter is when using a conda
-based project in which the conda
package manager is responsible for installing cmake
.
Prior to installation of the conda
-managed packages, VS Code tests for the cmake
executable and fails. After this failure it never tests the executable again, even though the package may have been installed.
A preferable behavior would be to always attempt to run the cmake
executable and reporting the error if it cannot be run, instead of testing once at startup.
@vinodappu @gcampbell-msft We can reproduce this issue on latest version, you can get the details below.
ENV: VSCode: 1.89.0 CMake tools: v1.17.17 C/C++: v1.20.5
Repro steps:
- Open a folder
- Open settings UI and set the Cmake: Cmake Path to a non existing location, e.g., 'cmake1'
- Click F1 to run 'CMake: configure'
- Reset the Cmake: Cmake Path to original location, e.g., 'cmake'
- Click F1 to run “CMake: configure” and check if the configuration is successful
Expected result: It should be configured successfully
Actual result:
The configuration did not succeed. And displays the error: “Bad CMake executable ‘cmake1’.
@gcampbell-msft is there a PR that closed this issue?
This commit: https://github.com/microsoft/vscode-cmake-tools/commit/6eb0121930d4b2222bb0538d94580e8e40861f69
This addresses the situation in which changing a cmake path occurs, but does not address the situation in which a previously invalid path is made valid. I'll file a new issue for this.