microsoft / vscode-cmake-tools

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

Failed to activate protocol version: Generator "Visual Studio 16 2019" not supported #1684

Closed davidrodsanchez closed 3 years ago

davidrodsanchez commented 3 years ago

Brief Issue Summary

VSC CMake Tools extension fails to Configure cmake - generator not found (excuse spanish language)

[rollbar] Excepción no controlada: Rechazo de promesas no controlado: Post-folder-open [cmake-server] Failed to activate protocol version: Generator "Visual Studio 16 2019" not supported. {"folder":{"uri":{"$mid":1,"fsPath":"c:\prueba2","_sep":1,"external":"file:///c%3A/prueba2","path":"/c:/prueba2","scheme":"file"},"name":"prueba2","index":0}}

Expected:

VSC should be able to configure the CMAKE Project. Triggering a cmake configure from terminal or VisualStudio works perfectly fine Triggering a cmake configure from VSC (same IDE, extensions, BuildTools versions) in different machines (both Windows10 and Windows7) works perfectly fine

Steps: 1) Open VSC and Open Folder - CMAKE Project 2) Switch to CMake Tools extension view and trigger a Configure All Projects

Apparent Behavior:

The javascript promise does not receive a response from cmake-server

Platform and Versions

Other Notes/Information

I have noticed that in the working environment, there is a: [cmakefileapi-driver] Creating instance of CMakeFileApiDriver

Which does not take place in the broken environment. I dont know if the issue may go in this direction.

Developer Tools Log

Setting traces on: "cmake.loggingLevel": "debug"

LOGS IN BROKEN ENVIRONMENT - AFTER OPENING PROJECT FOR THE FIRST TIME: [main] Creación segura de una instancia de CMakeTools [variant] Creando VariantManager [main] Creando una instancia de CMakeTools [main] Empezando la inicialización de segunda fase de CMakeTools [variant] Se cargó un nuevo conjunto de variantes. [main] La inicialización de la instancia de CMakeTools se ha completado. [kit] Leyendo el archivo de kits C:\Users\thales\AppData\Local\CMakeTools\cmake-tools-kits.json [kit] Se han cargado correctamente 8 kits de C:\Users\thales\AppData\Local\CMakeTools\cmake-tools-kits.json [kit] No se está leyendo el archivo de kits no existentes: c:\prueba2.vscode\cmake-kits.json [extension] Configuración del área de trabajo al abrir file:///c%3A/prueba2 [kitsController] Iniciar la selección de kits. Kits encontrados: 10. [kitsController] Abriendo la selección de kit de QuickPick [kitsController] Kit {"label":"Visual Studio Professional 2019 Release - amd64","description":"Usando los compiladores para 16.8.6 (arquitectura x64)","kit":{"name":"Visual Studio Professional 2019 Release - amd64","visualStudio":"b002e713","visualStudioArchitecture":"x64","preferredGenerator":{"name":"Visual Studio 16 2019","platform":"x64","toolset":"host=x64"}}} seleccionado por el usuario [main] Insertando el nuevo kit en el controlador de CMake [main] Configurando la carpeta: prueba2 [main] Guardando los archivos abiertos antes de configurar o compilar [main] Iniciando un nuevo controlador de CMake [main] Iniciando el controlador de CMake [driver] El kit de CMakeDriver se estableció en Visual Studio Professional 2019 Release - amd64 [kit] Se acepta la ejecución de x64 en C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat, variables de entorno: [["CL",""],["CL",""],["INCLUDE","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt"],["LIBPATH","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319"],["LINK",""],["LINK",""],["LIB","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64"],["PATH","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\WINDOWS\CCM;C:\Program Files (x86)\Oberthur Technologies\AWP\Dlls;C:\Program Files\Oberthur Technologies\AWP\Dlls;C:\Program Files (x86)\Sennheiser\SoftphoneSDK\;C:\Program Files\SafeNet\Authentication\SAC\x64\;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet\;C:\Users\thales\AppData\Local\Microsoft\WindowsApps;C:\Users\thales\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\Linux\bin\ConnectionManagerExe"],["TMP","C:\Users\thales\AppData\Local\Temp"],["FRAMEWORKDIR","C:\Windows\Microsoft.NET\Framework64\"],["FRAMEWORKDIR64","C:\Windows\Microsoft.NET\Framework64\"],["FRAMEWORKVERSION","v4.0.30319"],["FRAMEWORKVERSION64","v4.0.30319"],["UCRTCONTEXTROOT",""],["UCRTVERSION","10.0.18362.0"],["UNIVERSALCRTSDKDIR","C:\Program Files (x86)\Windows Kits\10\"],["VCINSTALLDIR","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\"],["VCTARGETSPATH",""],["WINDOWSLIBPATH","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0"],["WINDOWSSDKDIR","C:\Program Files (x86)\Windows Kits\10\"],["WINDOWSSDKLIBVERSION","10.0.18362.0\"],["WINDOWSSDKVERSION","10.0.18362.0\"],["VISUALSTUDIOVERSION","16.0"]] [driver] Intentando detectar el generador que el sistema admite [driver] Run _refreshExpansions [cms-driver] Run doRefreshExpansions [driver] Run _refreshExpansions cb [cms-client] Se ha iniciado una nueva instancia del servidor de CMake con el PID 3068. [cms-client] Configuración con el generador de CMake "Visual Studio 16 2019" con la plataforma "x64" y el conjunto de herramientas "host=x64" [rollbar] Excepción no controlada: Rechazo de promesas no controlado: Post-folder-open [cmake-server] Failed to activate protocol version: Generator "Visual Studio 16 2019" not supported. {"folder":{"uri":{"$mid":1,"fsPath":"c:\prueba2","_sep":1,"external":"file:///c%3A/prueba2","path":"/c:/prueba2","scheme":"file"},"name":"prueba2","index":0}}

LOGS IN BROKEN ENVIRONMENT - AFTER REMOVING BUILD FOLDER AND RETRIGGERING CMAKE CONFIGURE: [main] Configurando la carpeta: prueba2 [main] Guardando los archivos abiertos antes de configurar o compilar [main] Iniciando un nuevo controlador de CMake [main] Iniciando el controlador de CMake [driver] El kit de CMakeDriver se estableció en Visual Studio Professional 2019 Release - amd64 [kit] Se acepta la ejecución de x64 en C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat, variables de entorno: [["CL",""],["CL",""],["INCLUDE","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt"],["LIBPATH","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319"],["LINK",""],["LINK",""],["LIB","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64"],["PATH","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\WINDOWS\CCM;C:\Program Files (x86)\Oberthur Technologies\AWP\Dlls;C:\Program Files\Oberthur Technologies\AWP\Dlls;C:\Program Files (x86)\Sennheiser\SoftphoneSDK\;C:\Program Files\SafeNet\Authentication\SAC\x64\;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet\;C:\Users\thales\AppData\Local\Microsoft\WindowsApps;C:\Users\thales\.dotnet\tools;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\Linux\bin\ConnectionManagerExe"],["TMP","C:\Users\thales\AppData\Local\Temp"],["FRAMEWORKDIR","C:\Windows\Microsoft.NET\Framework64\"],["FRAMEWORKDIR64","C:\Windows\Microsoft.NET\Framework64\"],["FRAMEWORKVERSION","v4.0.30319"],["FRAMEWORKVERSION64","v4.0.30319"],["UCRTCONTEXTROOT",""],["UCRTVERSION","10.0.18362.0"],["UNIVERSALCRTSDKDIR","C:\Program Files (x86)\Windows Kits\10\"],["VCINSTALLDIR","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\"],["VCTARGETSPATH",""],["WINDOWSLIBPATH","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0"],["WINDOWSSDKDIR","C:\Program Files (x86)\Windows Kits\10\"],["WINDOWSSDKLIBVERSION","10.0.18362.0\"],["WINDOWSSDKVERSION","10.0.18362.0\"],["VISUALSTUDIOVERSION","16.0"]] [driver] Intentando detectar el generador que el sistema admite [driver] Run _refreshExpansions [cms-driver] Run doRefreshExpansions [driver] Run _refreshExpansions cb [cms-client] Se ha iniciado una nueva instancia del servidor de CMake con el PID 10308. [cms-client] Configuración con el generador de CMake "Visual Studio 16 2019" con la plataforma "x64" y el conjunto de herramientas "host=x64" [rollbar] Excepción no controlada: Rechazo de promesas no controlado: configureAll [cmake-server] Failed to activate protocol version: Generator "Visual Studio 16 2019" not supported. {}

LOGS IN WORKING ENVIRONMENT - AFTER OPENING PROJECT FOR THE FIRST TIME: [main] Creación segura de una instancia de CMakeTools [variant] Creando VariantManager [main] Creando una instancia de CMakeTools [main] Empezando la inicialización de segunda fase de CMakeTools [variant] Se cargó un nuevo conjunto de variantes. [main] La inicialización de la instancia de CMakeTools se ha completado. [kit] Leyendo el archivo de kits C:\Users\T0244288\AppData\Local\CMakeTools\cmake-tools-kits.json [kit] Se han cargado correctamente 8 kits de C:\Users\T0244288\AppData\Local\CMakeTools\cmake-tools-kits.json [kit] No se está leyendo el archivo de kits no existentes: c:\Users\T0244288\Documents\Projects\tester\prueba3.vscode\cmake-kits.json [extension] Configuración del área de trabajo al abrir file:///c%3A/Users/T0244288/Documents/Projects/tester/prueba3 [kitsController] Iniciar la selección de kits. Kits encontrados: 10. [kitsController] Abriendo la selección de kit de QuickPick [kitsController] Kit {"label":"Visual Studio Professional 2019 Release - amd64","description":"Usando los compiladores para 16.7.5 (arquitectura x64)","kit":{"name":"Visual Studio Professional 2019 Release - amd64","visualStudio":"2da78e6b","visualStudioArchitecture":"x64","preferredGenerator":{"name":"Visual Studio 16 2019","platform":"x64","toolset":"host=x64"}}} seleccionado por el usuario [main] Insertando el nuevo kit en el controlador de CMake [main] Configurando la carpeta: prueba3 [main] Guardando los archivos abiertos antes de configurar o compilar [main] Iniciando un nuevo controlador de CMake [main] Iniciando el controlador de CMake [cmakefileapi-driver] Creating instance of CMakeFileApiDriver [driver] El kit de CMakeDriver se estableció en Visual Studio Professional 2019 Release - amd64 [kit] Se acepta la ejecución de x64 en C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat, variables de entorno: [["CL",""],["CL",""],["INCLUDE","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt"],["LIBPATH","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319"],["LINK",""],["LINK",""],["LIB","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64"],["PATH","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;c:\Program Files (x86)\HP\HP Performance Advisor;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Users\T0244288\AppData\Local\Microsoft\WindowsApps;C:\Users\T0244288\Documents\Tools\bin;C:\Users\T0244288\Documents\Tools\jdk-8u251-windows-x64\bin;C:\Users\T0244288\Documents\Tools\apache-maven-3.6.3\bin;C:\Users\T0244288\AppData\Local\Programs\Microsoft VS Code Insiders\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Users\T0244288\Documents\Tools\zip-3.0-bin\bin;C:\Users\T0244288\Documents\Tools\bzip2-1.0.5-bin\bin;C:\Users\T0244288\Documents\Tools\python-3.7.9-embed-amd64;;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\Linux\bin\ConnectionManagerExe"],["TMP","C:\Users\T0244288\AppData\Local\Temp"],["FRAMEWORKDIR","C:\Windows\Microsoft.NET\Framework64\"],["FRAMEWORKDIR64","C:\Windows\Microsoft.NET\Framework64\"],["FRAMEWORKVERSION","v4.0.30319"],["FRAMEWORKVERSION64","v4.0.30319"],["UCRTCONTEXTROOT",""],["UCRTVERSION","10.0.18362.0"],["UNIVERSALCRTSDKDIR","C:\Program Files (x86)\Windows Kits\10\"],["VCINSTALLDIR","C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\"],["VCTARGETSPATH",""],["WINDOWSLIBPATH","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0"],["WINDOWSSDKDIR","C:\Program Files (x86)\Windows Kits\10\"],["WINDOWSSDKLIBVERSION","10.0.18362.0\"],["WINDOWSSDKVERSION","10.0.18362.0\"],["VISUALSTUDIOVERSION","16.0"]] [driver] Intentando detectar el generador que el sistema admite [driver] Run _refreshExpansions [driver] Run _refreshExpansions cb [driver] Estableciendo la nueva variante Debug [driver] Run _refreshExpansions [driver] Run _refreshExpansions cb [driver] Ejecutando las comprobaciones y los pasos preconfigurados [driver] Run _refreshExpansions [driver] Run _refreshExpansions cb [driver] Iniciar la configuración [driver] Ejecutando las comprobaciones y los pasos preconfigurados [driver] Run _refreshExpansions [driver] Run _refreshExpansions cb [cmakefileapi-driver] Invoking CMake C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe with arguments ["--no-warn-unused-cli"

andreeis commented 3 years ago

Is it possible that you have "cmake.cmakeCommunicationMode" set to "serverApi" in the broken project settings? Server API communication mode is deprecated by CMake and file API is recommended now. Normally that's the default, unless serverApi is specifically requested. Also english logs would help, if you don't manage to fix this with the above.

davidrodsanchez commented 3 years ago

Is it possible that you have "cmake.cmakeCommunicationMode" set to "serverApi" in the broken project settings? Server API communication mode is deprecated by CMake and file API is recommended now. Normally that's the default, unless serverApi is specifically requested. Also english logs would help, if you don't manage to fix this with the above.

Hello Andreeis and thank you for your response,

We are not setting cmake.cmakeCommunicationMode in the settings.json file in any environment. However, I tried explicitely indicating the default argument you mention we should be using (fileAPI), and I got the following error:

[main] No se admite el modo de comunicación file-api de CMake en las versiones anteriores a 3.14.0. Cambiando al modo de comunicación del servidor de CMake.

Meaning: file-api mode is not allowed under CMAKE versions previous to 3.14.0 (It then switches to server-cmake communication mode)

Funnily enough, it accepts the Kit selected from VisualStudio 2019: [kit] Accept x64 execution from C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat

And looking into de CMakeCache, there is: CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe

So I feel that for some reason, VSC is getting the wrong cmake distribution from somewhere (we have a 2017 VS installation as well)

andreeis commented 3 years ago

Interesting... From inspecting the code where the extension searches for cmake.exe, it tries first the path (you can ensure that the CMake you want is the first found CMake on the path), then it looks in the 2 Program Files folders (you did not install in Program Files? Or you have a different drive than "c:\"?) and then it looks for cmake bundled with VS. For you, the above checks fail.

As a workaround, try to set "cmake.cmakePath" to your desired cmake.

davidrodsanchez commented 3 years ago

Interesting... From inspecting the code where the extension searches for cmake.exe, it tries first the path (you can ensure that the CMake you want is the first found CMake on the path), then it looks in the 2 Program Files folders (you did not install in Program Files? Or you have a different drive than "c:"?) and then it looks for cmake bundled with VS. For you, the above checks fail.

As a workaround, try to set "cmake.cmakePath" to your desired cmake.

Dear andreeis,

I may have found the root cause of the problem. I did not yet find the exact place in the extension code where the final decision is made, but I have the feeling it is picking the first item from the list it retrieves after asking vswhere (maybe you are faster finding out). I would also have a suggestion for improving current logic.

1) Answering your questions: We are using VS cmake binary (not a release from CMAKE maintainers) Both VS installations are installed uncer C drive (2017 and 2019)

2) Workaround I attempted (Surely your workaround suggestion would have also worked): Uninstall cmake from VS 2017 so that it is not found when asking vswhere Result: VSC is now able to configure project as expected

3) Investigation: From cmd shell, asking vswhere with the same arguments as CMAKE Tool extension, i found out: In WORKING environment with 2 VS distributions (2017 and 2019): vswhere returned a json with first item 2019 information and then 2017 [OLD]

In BROKEN environment with 2 VS distributions (2017 and 2019): vswhere returned a json with first item 2017 [OLD] information and then 2019

As I said in the introduction, I did not find the place in the code where it finally decides which Installation to take

4) Suggestion: But if my feeling is correct, when all items seem to fulfill that cmake.exe is present, it takes the first one. Probably a more sensitive approach would be to cross check with the selected Kit version, and if for instance, 2019 was the one, correlate with the distro found. This should be possible as the Kit is selected before Configuring project. This way it does not take wrong assumptions.

Let me know your thoughts and thank you

andreeis commented 3 years ago

@davidrodsanchez, I am glad that you are unblocked and thank you for the extra details. All make sense and will be helpful in our investigation.

andreeis commented 3 years ago

Closing as duplicate of https://github.com/microsoft/vscode-cmake-tools/issues/1567. Good suggestions in both.