CI: use 32-bit hosted toolchain for all VsDevCmd.bat calls#6339
Merged
Conversation
The CMake (Ninja) Windows build configured MSVC via `VsDevCmd.bat -arch=amd64`, which defaults the host tools to amd64, so it used the 64-bit hosted compiler/linker. The MSBuild build of MeshLib.sln instead uses the 32-bit hosted toolchain via `<PreferredToolArchitecture>x86</PreferredToolArchitecture>` in source/platform.props. Add `-host_arch=x86` so the CMake build cross-compiles with the 32-bit hosted tools (x86 host -> x64 target), matching the MSBuild toolchain while still producing x64 binaries. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend the previous change to every remaining `VsDevCmd.bat -arch=amd64` invocation (C# bindings generation, C++/C example builds, and the pip-build wheel build) so all CMake/Ninja MSVC builds use the 32-bit hosted toolchain (x86 host -> x64 target), matching MeshLib.sln's PreferredToolArchitecture=x86. Targets stay x64. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The CMake/Ninja Windows builds configure the MSVC environment via:
-archsets the target architecture but leaves the host tools at the OS default (amd64), so these builds use the 64-bit hosted compiler and linker.The MSBuild build of
MeshLib.slninstead uses the 32-bit hosted toolchain, selected by<PreferredToolArchitecture>x86</PreferredToolArchitecture>insource/platform.props.This PR adds
-host_arch=x86to everyVsDevCmd.batcall across the workflows so they cross-compile with the 32-bit hosted tools (x86 host → x64 target), matching the MSBuild toolchain. The produced binaries stay x64 (-arch=amd64is unchanged).Call sites updated
.github/workflows/build-test-windows.yml:.github/workflows/pip-build.yml:Notes
-T host=x86toolset spec only works with the Visual Studio generator, which MeshLib doesn't use here.cl.exehas a ~4 GB address-space limit, but this matches what the MSBuild build already runs, so behavior is at parity.🤖 Generated with Claude Code
PCH size impact (32-bit vs 64-bit hosted toolchain)
The PCH-size logging from #6340 gives a clean before/after, since the only difference is this PR's
-host_arch=x86:CMake / Ninja — PCHs shrink ~37% (the path this PR changes), sizes in MB:
MSBuild — unchanged (already 32-bit hosted via
PreferredToolArchitecture=x86), every value matches byte-for-byte, e.g. MRPch: msvc-2019 Debug 902.69, msvc-2026 Release 840.62, msvc-2022 Release 813.56.This confirms the toolchain switch takes effect (only the CMake path moves) and is a nice side benefit: the 32-bit hosted compiler emits PCHs ~37% smaller, bringing the CMake builds in line with the (smaller) MSBuild PCHs.