microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

Kit scanner will not find any Visual Studio kits #1185

Closed syntroniks closed 4 years ago

syntroniks commented 4 years ago

Brief Issue Summary

Kit scanning is unable to run vswhere.exe

CMake Tools Log

[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[visual-studio] Failed to execute vswhere.exe: The system cannot find the path specified.

[visual-studio] Failed to execute vswhere.exe: The system cannot find the path specified.

[visual-studio] Failed to execute vswhere.exe: The system cannot find the path specified.

[kit] Found Kit: GCC for arm-none-eabi 6.3.1
[kit] Found Kit: GCC for arm-none-eabi 6.3.1
[kit] Successfully loaded 1 kits from C:\Users\xxxx\AppData\Local\CMakeTools\cmake-tools-kits.json

Platform and Versions

Other Notes/Information

I have vswhere

& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe'
Visual Studio Locator version 2.7.1+180c706d56 [query version 2.3.2200.14893]
Copyright (C) Microsoft Corporation. All rights reserved.

instanceId: 11e7c60b
installDate: 5/26/2017 5:38:01 PM
installationName: VisualStudio/15.9.22+28307.1093
installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
...
instanceId: 84cf7ee5
installDate: 11/28/2019 8:38:52 AM
installationName: VisualStudio/16.5.4+30011.22
installationPath: E:\Program Files (x86)\Microsoft Visual Studio\2019\Community
...

I also have a copy from chocolatey (produces the same output) which is earlier in my PATH

& vswhere
Visual Studio Locator version 2.8.4+ff0de50053 [query version 2.3.2200.14893]
Copyright (C) Microsoft Corporation. All rights reserved.

I am willing to help debug. You'll notice my VS installs are on 2 different drives. My vscode install is per-user (my user)

I've ran as administrator, I've also executed the bundled vswhere and it seems fine.

C:\Users\xxxx\.vscode-insiders\extensions\ms-vscode.cmake-tools-1.3.1\res>vswhere.exe -version
Visual Studio Locator version 2.2.11+gf1a9c6c78d [query version 2.3.2200.14893]
Copyright (C) Microsoft Corporation. All rights reserved.
syntroniks commented 4 years ago

I had a "Command Processor" conda hook that was running a conda bat file that didn't exist. This would result in each cmd.exe call to return The system cannot find the path specified. and have a non-zero exit code I imagine.

By removing the value for HKCU\Software\Microsoft\Command Processor\AutoRun, I got cmd.exe to be happy again, and all is well.

In fact, by hacking in a VS2019 kit, cmake itself would fail to configure because it was leveraging cmd.exe /C ...

bobbrow commented 4 years ago

I'm glad you were able to solve your issue. We probably wouldn't have guessed to look in the registry! 😉