microsoft / vscode-cmake-tools

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

that contains invalid field 'host=x86'. #4051

Open muliu opened 2 months ago

muliu commented 2 months ago

Brief Issue Summary

When selecting Visual Studio Enterprise 2017 Release - x86 configuring cmake fails. Selecting Visual Studio Professional 2022 Release - x86 works.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.83.1",
  "cmtVersion": "1.19.51",
  "configurations": [
    {
      "folder": "c:\\work\\sdp\\slc_env_agent_ex",
      "cmakeVersion": "3.12.18081601",
      "configured": true,
      "generator": "Visual Studio 15 2017",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

and here is the output when running the CMake:configure command:
[driver] Switching to kit: Visual Studio Enterprise 2017 Release - x86
[main] Configuring project: slc_env_agent_ex 
[cmake] Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
[cmake] CMake Error at CMakeLists.txt:3 (project):
[cmake]   Generator
[cmake] 
[cmake]     Visual Studio 15 2017
[cmake] 
[cmake]   given toolset specification
[cmake] 
[cmake]     host=x86
[cmake] 
[cmake]   that contains invalid field 'host=x86'.
[cmake] 
[cmake] 
[cmake] Configuring incomplete, errors occurred!
[cmake] See also "c:/work/sdp/slc_env_agent_ex/build/CMakeFiles/CMakeOutput.log".
[cms-driver] Error during CMake configure: 
    Error: Configuration failed.
    at CMakeServerClient.onMessage (c:\Users\Administrator\.vscode\extensions\ms-vscode.cmake-tools-1.19.51\dist\main.js:97258:33)
    at CMakeServerClient.onMoreData (c:\Users\Administrator\.vscode\extensions\ms-vscode.cmake-tools-1.19.51\dist\main.js:97231:18)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Debug Log

[main] Configuring project: slc_env_agent_ex 
[main] Saving open files before configure/build
[cms-driver] Run doRefreshExpansions
[expand] expanded ${workspaceFolder}/build
[driver] Start configure 
[driver] Running pre-configure checks and steps
[cms-driver] Run doRefreshExpansions
[expand] expanded ${workspaceFolder}/build
[cmake] Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
[cmake] CMake Error at CMakeLists.txt:3 (project):
[cmake]   Generator
[cmake] 
[cmake]     Visual Studio 15 2017
[cmake] 
[cmake]   given toolset specification
[cmake] 
[cmake]     host=x86
[cmake] 
[cmake]   that contains invalid field 'host=x86'.
[cmake] 
[cmake] 
[cmake] Configuring incomplete, errors occurred!
[cmake] See also "c:/work/sdp/slc_env_agent_ex/build/CMakeFiles/CMakeOutput.log".
[cms-driver] Error during CMake configure: 
    Error: Configuration failed.
    at CMakeServerClient.onMessage (c:\Users\Administrator\.vscode\extensions\ms-vscode.cmake-tools-1.19.51\dist\main.js:97258:33)
    at CMakeServerClient.onMoreData (c:\Users\Administrator\.vscode\extensions\ms-vscode.cmake-tools-1.19.51\dist\main.js:97231:18)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
[visual-studio] OK running C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x86 , env vars: {"DevEnvDir":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\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 (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\include;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um;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\\shared;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\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt","LIB":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\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;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\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 (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\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;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\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.6.1\\","Path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Team Tools\\Performance Tools;C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\VSPerfCollectionTools\\;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.1 Tools\\;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\\\MSBuild\\15.0\\bin;C:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Team Tools\\Performance Tools;C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\VSPerfCollectionTools\\;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.1 Tools\\;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\\\MSBuild\\15.0\\bin;C:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\;C:\\Perl64\\site\\bin;C:\\Perl64\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\Go\\bin;C:\\mingw64\\bin;C:\\Program Files\\Tesseract-OCR;C:\\chromedriver-win64;C:\\WINDOWS\\system32\\config\\systemprofile\\.dnx\\bin;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Users\\Administrator\\.dnx\\bin;C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\;C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\;C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Administrator\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Administrator\\go\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\Ninja;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\Ninja","UCRTVersion":"10.0.22621.0","UniversalCRTSdkDir":"C:\\Program Files (x86)\\Windows Kits\\10\\","VCIDEInstallDir":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\VC\\","VCINSTALLDIR":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\","VCToolsInstallDir":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\","VCToolsRedistDir":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Redist\\MSVC\\14.16.27012\\","VCToolsVersion":"14.16.27023","VisualStudioVersion":"15.0","VSINSTALLDIR":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\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.6.1 Tools\\x64\\","WindowsSDK_ExecutablePath_x86":"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.1 Tools\\","TMP":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp"}
[extension] [1523] cmake.configure finished (returned 1)

Additional Information

Operating System: Microsoft Windows 10 Professional 19045 AMD64 CMake Version: cmake version 3.12.18081601-MSVC_2 VSCode Version: 1.83.1(user setup) CMake Tools Extension Version: 1.19.51

gcampbell-msft commented 2 months ago

@muliu Could you help us understand what might be happening by providing us the following information?

  1. Does this happen on extension version 1.18.44 as well?
  2. Could you copy the kits for both that you tested with and place them in this issue?
  3. Any other repro information that would be useful

Thanks!

muliu commented 2 months ago

@gcampbell-msft

  1. 1.18.44 does't work. see the attached screenshots cmaktool 1 18 44
  2. Visual Studio Enterprise 2017 Release - x86, cmake fails。 { "name": "Visual Studio Enterprise 2017 Release - x86", "visualStudio": "921aa8fc", "visualStudioArchitecture": "x86", "isTrusted": true, "preferredGenerator": { "name": "Visual Studio 15 2017", "platform": "win32", "toolset": "host=x86" } }, Here is my steps: 1 start "Developer Command Prompt for VS 2017" 2 cd my project directory. 3 run code . 4 press 'ctrl+shift+p', select 'cmake: select a kit', choose 'Visual Studio Enterprise 2017 Release - x86' 5 press 'ctrl+shift+p', select 'cmake: configure'
  3. Visual Studio Professional 2022 Release - x86, work well。 { "name": "Visual Studio Professional 2022 Release - x86", "visualStudio": "18b86a66", "visualStudioArchitecture": "x86", "isTrusted": true, "preferredGenerator": { "name": "Visual Studio 17 2022", "platform": "win32", "toolset": "host=x86" } },
v-frankwang commented 2 months ago

@gcampbell-msft I also reproduced this issue on CMake Tools version v1.19.51.

Actual result: image

v-frankwang commented 2 months ago

@gcampbell-msft @muliu After changing the value of toolset to “v141”, the project can use cl.exe under Hostx86, but it is not recognized when the value of toolset is “host=x86”.

image