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 450 forks source link

CMAKE_MAKE_PROGRAM is not set. #3443

Closed atom0s closed 10 months ago

atom0s commented 10 months ago

Brief Issue Summary

The most recent update of cmake-tools has effectively bricked my ability to use CMake within VSCode Insiders as of tonight. Upon opening any project that makes use of C++ and CMake, attempting to compile is now greeted with:

[cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.

My CMake install is directly from Visual Studio 2022 and is also fully up-to-date as of tonight. [v17.8]

Attempting to manually fix this issue by adding the path to Ninja to my PATH environment variable will then result in cmake-tools complaining that the path to cl.exe is invalid.

To currently fix this, I have to completely disable all extension automatic updates in VSCode and manually reinstall the older version of cmake-tools.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.85.0-insider",
  "cmtVersion": "1.16.29",
  "configurations": [
    {
      "folder": "c:\\Users\\atom0s\\Desktop\\temp_project",
      "cmakeVersion": "3.27.2",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {
        "C": "cl.exe",
        "CXX": "cl.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 1,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "temp_project",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

[main] Building folder: temp_project 
[main] Saving open files before configure/build
[main] Configuring project: temp_project 
[main] Saving open files before configure/build
[driver] Start configure 
[driver] Running pre-configure checks and steps
[cmakefileapi-driver] Configuring using preset
[cmakefileapi-driver] Invoking CMake C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe with arguments ["-DCMAKE_C_COMPILER=cl.exe","-DCMAKE_CXX_COMPILER=cl.exe","-DCMAKE_BUILD_TYPE=Debug","-DCMAKE_INSTALL_PREFIX=C:/Users/atom0s/Desktop/temp_project/out/install/x86-debug-win","-SC:/Users/atom0s/Desktop/temp_project","-BC:/Users/atom0s/Desktop/temp_project/out/build/x86-debug-win","-G","Ninja"]
[proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=C:/Users/atom0s/Desktop/temp_project/out/install/x86-debug-win -SC:/Users/atom0s/Desktop/temp_project -BC:/Users/atom0s/Desktop/temp_project/out/build/x86-debug-win -G Ninja
[proc]   with environment: {"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\atom0s\\AppData\\Roaming","ASHITA4_DEPS_PATH":"X:\\SourceCode\\GitHub\\Ashita\\","ASHITA4_SDK_PATH":"C:\\Ashitav4\\plugins\\sdk\\","COMPUTERNAME":"ATOM0S-LAPTOP","ComSpec":"C:\\Windows\\system32\\cmd.exe","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","ELECTRON_RUN_AS_NODE":"1","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\atom0s","LOCALAPPDATA":"C:\\Users\\atom0s\\AppData\\Local","LOGONSERVER":"\\\\ATOM0S-LAPTOP","LUA_DEV":"C:\\Program Files (x86)\\Lua\\5.1","LUA_PATH":";;C:\\Program Files (x86)\\Lua\\5.1\\lua\\?.luac","MSMPI_BENCHMARKS":"C:\\Program Files\\Microsoft MPI\\Benchmarks\\","MSMPI_BIN":"C:\\Program Files\\Microsoft MPI\\Bin\\","NUMBER_OF_PROCESSORS":"32","NVM_HOME":"C:\\Users\\atom0s\\AppData\\Roaming\\nvm","NVM_SYMLINK":"C:\\Program Files\\nodejs","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","OS":"Windows_NT","OneDrive":"C:\\Users\\atom0s\\OneDrive","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.wlua;.lexe","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 183 Stepping 1, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"b701","PSModulePath":"%ProgramFiles%\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\Tools\\PowerShell\\Modules\\","PUBLIC":"C:\\Users\\Public","Path":"C:\\Program Files (x86)\\VMware\\VMware Workstation\\bin\\;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\Program Files\\Python311\\Scripts\\;C:\\Program Files\\Python311\\;C:\\Program Files\\Common Files\\Oracle\\Java\\javapath;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:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Microsoft VS Code Insiders\\bin;C:\\Program Files\\010 Editor;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files (x86)\\WinMerge;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Users\\atom0s\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Lua\\5.1;C:\\Program Files (x86)\\Lua\\5.1\\clibs;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\160\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\160\\DTS\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\DTS\\Binn\\;C:\\Program Files\\Azure Data Studio\\bin;C:\\Program Files\\dotnet\\;C:\\Users\\atom0s\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Tools\\hugo\\;C:\\Users\\atom0s\\.dotnet\\tools;C:\\Users\\atom0s\\AppData\\Local\\Programs\\Fiddler;C:\\Users\\atom0s\\.dotnet\\tools","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","SystemDrive":"C:","SystemRoot":"C:\\Windows","TEMP":"C:\\Users\\atom0s\\AppData\\Local\\Temp","TMP":"C:\\Users\\atom0s\\AppData\\Local\\Temp","USERDOMAIN":"ATOM0S-LAPTOP","USERDOMAIN_ROAMINGPROFILE":"ATOM0S-LAPTOP","USERNAME":"atom0s","USERPROFILE":"C:\\Users\\atom0s","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CODE_CACHE_PATH":"C:\\Users\\atom0s\\AppData\\Roaming\\Code - Insiders\\CachedData\\54821ee1f14beca4866abd7de86175b4794b030d","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"C:\\Windows\\system32","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"\\\\.\\pipe\\04f3321aca05619bf2f9ddd699282dd5-1.85.0-insider-main-sock","VSCODE_L10N_BUNDLE_LOCATION":"","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"8932","ZES_ENABLE_SYSMAN":"1","configsetroot":"C:\\Windows\\ConfigSetRoot","windir":"C:\\Windows","DevEnvDir":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\","Framework40Version":"v4.0","FrameworkDir":"C:\\Windows\\Microsoft.NET\\Framework\\","FrameworkDIR32":"C:\\Windows\\Microsoft.NET\\Framework\\","FrameworkVersion":"v4.0.30319","FrameworkVersion32":"v4.0.30319","INCLUDE":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\ATLMFC\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um","LIB":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\ATLMFC\\lib\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x86","LIBPATH":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\ATLMFC\\lib\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\lib\\x86\\store\\references;C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.22621.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.22621.0;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319","NETFXSDKDir":"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\","UCRTVersion":"10.0.22621.0","UniversalCRTSdkDir":"C:\\Program Files (x86)\\Windows Kits\\10\\","VCIDEInstallDir":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\VC\\","VCINSTALLDIR":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\","VCToolsRedistDir":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Redist\\MSVC\\14.38.33130\\","VisualStudioVersion":"17.0","VSINSTALLDIR":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\","WindowsLibPath":"C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.22621.0;C:\\Program Files (x86)\\Windows Kits\\10\\References\\10.0.22621.0","WindowsSdkBinPath":"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\","WindowsSdkDir":"C:\\Program Files (x86)\\Windows Kits\\10\\","WindowsSDKLibVersion":"10.0.22621.0\\","WindowsSDKVersion":"10.0.22621.0\\","WindowsSDK_ExecutablePath_x64":"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\x64\\","WindowsSDK_ExecutablePath_x86":"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\","VS170COMNTOOLS":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools","CC":"cl.exe","CXX":"cl.exe"}
[cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=C:/Users/atom0s/Desktop/temp_project/out/install/x86-debug-win -SC:/Users/atom0s/Desktop/temp_project -BC:/Users/atom0s/Desktop/temp_project/out/build/x86-debug-win -G Ninja exited with code: 1
[extension] [8580] cmake.build finished (returned 1)

Additional Information

No response

smeunier-amd commented 10 months ago

Same issue here.

aidanhowie19 commented 10 months ago

I also have the same issue.

gcampbell-msft commented 10 months ago

@atom0s Could you please send us your repro? Or at least your CMakePresets.json? We are investigating this in hopes of getting out a fix as soon as possible and a repro would be highly beneficial to diagnose the issue.

gcampbell-msft commented 10 months ago

@atom0s @smeunier-amd @aidanhowie19 We have diagnosed the issue and hope to get a new release with the fix out in the next couple of hours. Thanks for posting your issue so quickly!

github-actions[bot] commented 10 months ago

:tada: This issue has now been fixed and is now available in the latest release! :tada:

atom0s commented 10 months ago

Sorry for the delayed response. Can confirm the latest fix/release is working great again. :)

marhenrsl commented 9 months ago

I still experience what seems to be this exact problem on 1.16.32.

my .vscode/cmake-kits.json file is set to (vs 17.6.9 LTS)

[ { "name": "Visual Studio Enterprise 2022 6 - amd64", "visualStudio": "0775995f", "visualStudioArchitecture": "x64", "isTrusted": true, "preferredGenerator": { "name": "Visual Studio 17 2022", "platform": "x64", "toolset": "host=x64" } } ]

The log states that the kit was succesfully loaded, but generation then gives me the exact errors listed in this thread. Could there be other issues in my setup resulting in this very error? I also don't seem to have any "kits" button/dropdown in the status bar nor the "scan kits" option in the command palette...

TiboVZ-r commented 1 week ago

+1 Currently also having the ninja not found issue. (same with other generators). They work fine from cli, configuration seems to be correct

gcampbell-msft commented 1 week ago

@TiboVZ-r Please ensure that you're making use of cmake.generator or cmake.preferredGenerator settings. In the most recent extension release it is expected that if you're using the unspecified kit for example, no generator is used unless it's found on the system, so you should be sure to define the cmake.generator setting. Thanks!