Repository navigation
ci: Windows client build gets past configure, through MSVC and the linker - #5
Merged
Merged
Conversation
The Windows client job has not got past configure since the vcpkg step landed (33f1ee3): PowerShell passes a bare -DCMAKE_TOOLCHAIN_FILE=$env:X argument to a native command without expanding the variable, so CMake was handed the literal text "$env:VCPKG_INSTALLATION_ROOT/..." and stopped with "Could not find toolchain file". Reproduced with PowerShell 7.5.4: unquoted, the argument arrives literal; quoted, it expands. vcpkg's classic mode now installs Lua 5.5.1, not 5.4. Measured on Linux against Lua 5.5.0, with this job's options (DEMOD_CLIENT, DEMOD_DCF): the client builds, the five examples the Linux smoke runs render, the mixer runs in sim mode, and luac 5.5 -p parses all 178 tracked .lua files. MSVC itself is still unmeasured; this job is the first to run it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEapehGd6iN1d5vu53PEN7
With the toolchain argument quoted, the Windows job reached MSVC for the first time and stopped on two gaps that date from 33f1ee3 (the commit that added the job, which never got past configure): - <stdatomic.h> (demod_rt_meters.h, demod_triple_buf.h): MSVC needs /experimental:c11atomics on top of /std:c11, which CMAKE_C_STANDARD 11 already gives it. Five files stopped at vcruntime_c11_stdatomic.h's "C atomic support is not enabled". - ssize_t in dm_dcf.c's sendto/recv checks: POSIX, absent on MSVC. Defined from SSIZE_T in platform/compat.h, MSVC only (MinGW has its own). Both are guarded to MSVC, so Linux and macOS compile exactly what they did. Checked on Linux: the client configuration (DEMOD_CLIENT, DEMOD_DCF) builds with -Werror=vla (MSVC has no VLAs), and the unaudited files have no other POSIX-only calls outside their __linux__ blocks. MSVC itself is still measured only by this PR's Windows job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEapehGd6iN1d5vu53PEN7
With atomics and ssize_t fixed, MSVC's only remaining errors were the eight `lua_tostring(L,-1) ? : ""` in dm.viz_add_item and dm.control_add_item (from 33f1ee3): GCC's omitted-middle-operand extension, a syntax error under MSVC. Replaced by tostring_or_empty(), which evaluates lua_tostring once, as `?:` did. Checked on Linux with the Windows job's options and -Wpedantic, which flags every GNU extension: those eight were the only ones in the 19 files the client compiles, and there are none now. systems_viz and card_launcher, the two examples that call these functions, render screenshots byte-identical to the ones taken before the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEapehGd6iN1d5vu53PEN7
With every source compiling under MSVC, the link failed on an unresolved `main`: on Windows SDL.h renames main() to SDL_main(), and SDL2::SDL2main supplies the entry point that calls it. CMake linked SDL2::SDL2 alone. Now SDL2::SDL2main is prepended when building for Windows and the target exists, which is vcpkg's own usage note for its SDL2. Linux and macOS link lines are unchanged (checked: reconfigured and rebuilt on Linux; no SDL2main on the link line). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEapehGd6iN1d5vu53PEN7
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 & why
client build (Windows)has never got past configure onmain. This PR fixes that and the four Windows gaps that were hiding behind it, each found by the previous fix's CI run. All of them date from 33f1ee3 (3 July), the commit that added the job. None comes from #4: it only added two steps to the Linux job, and the July runs onmaindied at startup on every job.-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/...to a native command without expanding the variable. CMake received the literal text and stopped atCould not find toolchain file. The fix is to quote the argument; I reproduced both behaviours with PowerShell 7.5.4.vcruntime_c11_stdatomic.h: "C atomic support is not enabled".<stdatomic.h>needs/experimental:c11atomicson top of/std:c11, whichCMAKE_C_STANDARD 11already sets. Added underif(MSVC).ssize_t(c8d6034). It's POSIX, used indm_dcf.c's sendto/recv length checks. It's now defined fromSSIZE_Tinsrc/platform/compat.h, for MSVC only (MinGW has its own).x ?: y(6382cde). There were eightlua_tostring(L,-1) ? : ""indm.viz_add_itemanddm.control_add_item, a syntax error under MSVC. They are replaced bytostring_or_empty(), which evaluateslua_tostringonce, as before.main. On WindowsSDL.hrenamesmain()toSDL_main(), andSDL2::SDL2mainsupplies the entry point that calls it. It is now linked underif(WIN32 AND TARGET SDL2::SDL2main), which is vcpkg's own usage note.Checked on Linux with this job's options (
DEMOD_CLIENT,DEMOD_DCF), against Lua 5.5 (what vcpkg's classic mode now installs, not 5.4):-Wpedanticflags every GNU extension. Item 4's eight were the only ones in the 19 files the client compiles, and there are none now.-Werror=vla(MSVC has no variable-length arrays).systems_vizandcard_launcher, which call the item-4 functions, render screenshots byte-identical to those taken before the change.apps/mixerruns in sim mode, andluac 5.5 -pparses all 178 tracked.luafiles.Items 2, 3 and 5 are guarded to MSVC/Windows; item 4 compiles to the same behaviour everywhere. MSVC and its linker are measured only by this PR's Windows job, which builds and does not run the client.
Known, not changed here: on Windows
MSG_DONTWAITmaps to 0 (compat.halready says so), sodm.dcf.poll()can block for up to the 200 ms receive timeout when nothing is queued.compat.hnamesFIONBIOas the follow-up.Not in this PR: the
Pages (browser demo)deploy fails with404 … Ensure GitHub Pages has been enabled. The WASM build step passes. It needs Settings → Pages → Source: GitHub Actions, a repository setting.Checklist
git commit -s). Left to you, as on DeMoD Mixer (touch kiosk), gated DCF bridges, fixed control ops #4: a sign-off certifies the DCO in your name.SPDX-License-Identifierheader. N/A: no new files.makeandmake testpass. Items 2, 3 and 5 are Windows-only; item 4 was checked by screenshot identity, and the Linux job re-runs the suite.🤖 Generated with Claude Code
https://claude.ai/code/session_01YEapehGd6iN1d5vu53PEN7