Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

  • Understand the issue: VS 2017 (majorVersion 15) with bundled CMake 3.12.18081601-MSVC_2 fails when host=x86 toolset is passed via -T flag
  • Identify root cause: kit.ts line 809 sets toolset: majorVersion < 15 ? undefined : host, meaning VS 2017 gets host=x86 which its bundled CMake doesn't support
  • Research related issues: Failed to generate projects for older Visual Studio #1352 (VS 2010 fix), contains invalid field 'host=amd64'. #2790 (host=amd64 fix)
  • Implement fix: Change threshold from majorVersion < 15 to majorVersion < 16 to exclude VS 2017 from host= toolset generation
  • Update related Clang for MSVC kit generation similarly
  • Add unit test for the fix
  • Add changelog entry
  • Run code review and security scan
Original prompt

This section details on the original issue you should resolve

<issue_title>that contains invalid field 'host=x86'.</issue_title>
<issue_description>### 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\\...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes microsoft/vscode-cmake-tools#4051

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants