ci: add native Windows build with MSYS2 UCRT64#378
Conversation
Add a ci-windows job that builds and tests gerbv natively on windows-latest using MSYS2 UCRT64 GCC. This complements the existing MinGW-w64 cross-compilation by verifying the binary actually works on Windows. - New toolchain cmake/toolchains/msys2-ucrt64-gcc.cmake - New preset cmake/preset/msys2-ucrt64-gcc.json with test preset - Guard -mwindows behind CMAKE_C_COMPILER_ID check for future MSVC - Release job now gates on ci-windows alongside Ubuntu and macOS
|
@eyal0 Could you review this when you get a chance? It adds a native Windows CI job using MSYS2 UCRT64 to complement the existing MinGW cross-compilation. |
|
Worth noting: the |
|
Windows build is failing on M_PI. Explanation here: #368 (comment) |
|
Interesting platform. I am not sure what this does compared to the current windows build. Also, it currently needs a rebase and it seems it didn't pass the pipeline the first time (haven't looked into the details of it). Also a more generic question. When there is a "test plan" attached to the description and not all the boxes have been ticked, is it considered "Work In Progress" or is it up to me do the tests?
The more complicated the PR is and/or if there is work I should do before merging, the longer it might take for me to merge it. |
|
@spe-ciellt Good point on the test plan — I've checked all three boxes now. The tests were passing on Ubuntu and macOS before, and the Windows job was the only failure (due to the To your question about what this adds vs the existing Windows build: the current CI should be green now across all platforms. No action needed from you beyond review. |
MSYS2 UCRT64 GCC predefines _WIN32 but not WIN32. The codebase uses WIN32 throughout (callbacks.c, main.c, render.c) for X11/Wayland vs Windows guards. Without it, gdk/gdkx.h is included on Windows, causing a build failure. Matches the existing mingw-w64-gcc.cmake toolchain which already defines both _GNU_SOURCE and WIN32.
Summary
ci-windowsGitHub Actions job that builds and tests gerbv natively onwindows-latestusing MSYS2 UCRT64 GCC-mwindowslinker flag behind a GCC compiler check to prepare for future MSVC supportMotivation
The existing MinGW-w64 cross-compilation (via mini-cross on Fedora) proves gerbv compiles for Windows, but never runs the result. This job compiles and tests on Windows, catching platform-specific issues early.
Test plan
ci-windowsjob configures, builds, and attempts tests onwindows-latestcontinue-on-error: truehandles this