Fix Windows CI: pin windows-2022 -- new image's clang-cl 22 rejects bundled SDL's _m_prefetch - #119
Fix Windows CI: pin windows-2022 -- new image's clang-cl 22 rejects bundled SDL's _m_prefetch#119arekbr wants to merge 1 commit into
Conversation
…undled SDL header The Windows job dies compiling MTEngineSDL: SDL_endian.h(40,1): error : definition of builtin function '_m_prefetch' What changed: nothing in either repo. The windows-2025-vs2026 runner image was updated between the last green run (June, image 20260608 with clang-cl 20.1.8) and now (image 20260728 with clang-cl 22.1.3). Since clang 21, _m_prefetch is a compiler builtin, and the SDL 2.28.5 header bundled in MTEngineSDL redefines it under a plain '#ifdef __clang__' (an old Clang-11-vs-winnt.h workaround). There were no CI runs between June and the slajerek#114/slajerek#115 merges, so the failure surfaced on the first push after the image update -- the merged PRs touch neither MTEngineSDL nor the workflow. This pin buys a working CI: windows-2022 ships VS 2022 (clang-cl 19.x) and is servicing-only, so its clang will stay below 21. The proper fix lives in MTEngineSDL's bundled header and mirrors what upstream SDL2 did (their branch, not yet in any release): -#ifdef __clang__ +#if defined(__clang__) && !_SDL_HAS_BUILTIN(_m_prefetch) (with the underscore: _SDL_HAS_BUILTIN is the SDL2 spelling; upstream's first attempt used the SDL3 name and did not compile, fixed in their follow-up). Safe for older toolchains: clang 11-20 report no such builtin, so the workaround stays for them. Happy to send that PR to MTEngineSDL if wanted -- then this pin can go back to windows-latest.
|
Additional measurements backing both the pin and the proper patch, done on real toolchains: clang-cl 19.1.7 (the version windows-2022 ships): both the current clang 22.1.8 (Homebrew LLVM, same major as the failing runner): One honest caveat: I could not reproduce the hard error itself outside CI -- upstream LLVM 22.1.8's |
The Windows job dies compiling MTEngineSDL (single error in the whole log):
Nothing changed in either repo. The
windows-2025-vs2026runner image was updated between the last green run (June, clang-cl 20.1.8) and now (clang-cl 22.1.3). Since clang 21,_m_prefetchis a compiler builtin, and the SDL 2.28.5 header bundled in MTEngineSDL redefines it under a plain#ifdef __clang__(an old Clang-11-vs-winnt.h workaround). There were no CI runs between June and the #114/#115 merges, so the failure surfaced on the first push after the image update -- the merged PRs touch neither MTEngineSDL nor the workflow. (Both June and August runs used the same VS-2026 image family and the same MSVC 14.51 -- the only variable that moved is the bundled clang: 20.1.8 green, 22.1.3 red.)This PR: pin
windows-2022(VS 2022, clang-cl 19.x, servicing-only -- its clang stays below 21). One-line change, buys a working CI immediately.The proper fix is a one-line guard change in MTEngineSDL's bundled header, mirroring what upstream SDL2 did on their branch (not yet in any SDL2 release -- 2.32.10 still has the plain
#ifdef):(with the underscore --
_SDL_HAS_BUILTINis the SDL2 spelling; upstream's first attempt used the SDL3 nameSDL_HAS_BUILTINand did not compile, they fixed it in a follow-up commit. Safe for older toolchains: clang 11-20 report no such builtin, so the workaround stays active for them.) Since AGENTS.md says MTEngineSDL changes need your sign-off: say the word and I'll send that PR there too, then this pin can go back towindows-latest.🤖 Generated with Claude Code