Skip to content

ci: fix Windows build by forcing Ninja cmake generator#407

Open
revmischa wants to merge 2 commits into
masterfrom
ci/fix-windows-cmake-generator
Open

ci: fix Windows build by forcing Ninja cmake generator#407
revmischa wants to merge 2 commits into
masterfrom
ci/fix-windows-cmake-generator

Conversation

@revmischa

Copy link
Copy Markdown
Member

Windows build jobs have failed on every PR since mid-June. The cmake build-dependency of sdl3-sys (building SDL3 from source) panics before any crate code is compiled:

error: failed to run custom build command for `sdl3-sys v0.6.6+SDL-3.4.10`
  thread 'main' panicked at cmake-0.1.54/src/lib.rs:970:25:
  couldn't determine visual studio generator

Successful runs through Jun 9, broken Jun 15 onward across unrelated PRs, which lines up with a windows-latest image bump to a Visual Studio version that the pinned cmake-rs can't map to a generator. The workflow had no MSVC setup and never set CMAKE_GENERATOR, so it relied entirely on that autodetection.

Set up the MSVC environment with msvc-dev-cmd and force CMAKE_GENERATOR=Ninja (Ninja ships with VS) on Windows only, bypassing the broken VS-version detection. Linux and macOS are untouched.

Action is pinned to a commit SHA to match the existing workflow convention.

The cmake build-dependency of sdl3-sys panics with "couldn't determine
visual studio generator" on current windows-latest images, breaking the
Windows build job for every PR since mid-June. Set up the MSVC
environment and pin CMAKE_GENERATOR=Ninja so the build no longer relies
on cmake's broken VS-version autodetection.
Under Git bash, rustc resolves link.exe to Git's usr/bin/link.exe instead
of the MSVC linker once the VS dev environment is set up. Drop shell: bash
so Windows uses pwsh, and collapse the build command to a single line that
works in both bash and pwsh.
@revmischa
revmischa force-pushed the ci/fix-windows-cmake-generator branch from c571ac5 to 8a28b6b Compare July 12, 2026 06:26
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.

1 participant