Skip to content

ci: Windows client build gets past configure, through MSVC and the linker - #5

Merged
ALH477 merged 4 commits into
mainfrom
ccr-08f057a2-l4wyo1
Oct 3, 2026
Merged

ALH477 merged 4 commits into
mainfrom
ccr-08f057a2-l4wyo1

Conversation

@ALH477

@ALH477 ALH477 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What & why

client build (Windows) has never got past configure on main. 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 on main died at startup on every job.

  1. The toolchain argument was never expanded (9cb3734). PowerShell passes a bare -DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/... to a native command without expanding the variable. CMake received the literal text and stopped at Could not find toolchain file. The fix is to quote the argument; I reproduced both behaviours with PowerShell 7.5.4.
  2. C11 atomics (c8d6034). Five files stopped at vcruntime_c11_stdatomic.h: "C atomic support is not enabled". <stdatomic.h> needs /experimental:c11atomics on top of /std:c11, which CMAKE_C_STANDARD 11 already sets. Added under if(MSVC).
  3. ssize_t (c8d6034). It's POSIX, used in dm_dcf.c's sendto/recv length checks. It's now defined from SSIZE_T in src/platform/compat.h, for MSVC only (MinGW has its own).
  4. GCC's x ?: y (6382cde). There were eight lua_tostring(L,-1) ? : "" in dm.viz_add_item and dm.control_add_item, a syntax error under MSVC. They are replaced by tostring_or_empty(), which evaluates lua_tostring once, as before.
  5. No entry point (da11ba0). With every file compiling, 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. It is now linked under if(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):

  • -Wpedantic flags every GNU extension. Item 4's eight were the only ones in the 19 files the client compiles, and there are none now.
  • The client builds with -Werror=vla (MSVC has no variable-length arrays).
  • The five examples the Linux smoke runs all render.
  • systems_viz and card_launcher, which call the item-4 functions, render screenshots byte-identical to those taken before the change.
  • apps/mixer runs in sim mode, and luac 5.5 -p parses all 178 tracked .lua files.
  • The Linux link line is unchanged by item 5.

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_DONTWAIT maps to 0 (compat.h already says so), so dm.dcf.poll() can block for up to the 200 ms receive timeout when nothing is queued. compat.h names FIONBIO as the follow-up.

Not in this PR: the Pages (browser demo) deploy fails with 404 … Ensure GitHub Pages has been enabled. The WASM build step passes. It needs Settings → Pages → Source: GitHub Actions, a repository setting.

Checklist

  • Commits are signed off (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.
  • New source files carry an SPDX-License-Identifier header. N/A: no new files.
  • make and make test pass. Items 2, 3 and 5 are Windows-only; item 4 was checked by screenshot identity, and the Linux job re-runs the suite.
  • No vendored code was relicensed, no generated artifacts committed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YEapehGd6iN1d5vu53PEN7

claude added 2 commits October 2, 2026 23:58
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
@ALH477 ALH477 changed the title ci: Windows client build gets past configure ci: Windows client build gets past configure and through MSVC Oct 3, 2026
claude added 2 commits October 3, 2026 00:11
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
@ALH477 ALH477 changed the title ci: Windows client build gets past configure and through MSVC ci: Windows client build gets past configure, through MSVC and the linker Oct 3, 2026
@ALH477
ALH477 merged commit bcd28de into main Oct 3, 2026
4 checks passed
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.

2 participants