ref:main

Windows support (rebased): cross-compile MSVC via cargo-xwin #47

merged colechristensen cole.christensen@gmail.com wants to merge feat/windows-support-rebased into main

Rebase of #32 (Windows support for the CLI + CI runner) onto current main, with the build reworked to fit the per-ISA pipeline.

What changed vs #32

#32 was 30 commits behind and built Windows natively (runs_on: [windows], MSVC, bare) — but that Windows runner is offline, and there’s a bootstrap deadlock: you can’t build the runner-building-runner without a working Windows anvil.exe. So this cross-compiles x86_64-pc-windows-msvc from the amd64 Linux worker with cargo-xwin (fetches Microsoft’s CRT/SDK, links via clang/lld — no Windows host). MSVC is the native target of #32’s windows-service/windows-sys crates, so it’s the low-risk ABI. Once this ships a Windows binary, DESKTOP-01APN6V can come online for native Windows test runs later.

Kept from #32 (merges clean, compiles + tests green on linux)

  • platform/ abstraction (unix/windows backends behind one API) — drops the ungated libc:: calls I flagged in the audit.
  • Windows Service (SCM) support (service_windows.rs, dispatcher in main.rs).
  • update.rs Windows naming + .exe swap; executor.rs Windows-container path; shutdown.rs/pid_file.rs/detach.rs via the platform layer.

Dropped from #32 (superseded by the per-ISA pipeline)

  • Old single-build-runner .anvil.yml, ci/build-macos.sh, ci/build-windows.ps1.

Wiring

  • amd64 build job’s prepare gains clang/lld/llvm + cargo-xwin 0.23.0 + the msvc target + a warmed xwin SDK (baked into the image).
  • build-arch.sh builds anvil_windows_amd64 on the amd64 path; publish-release.sh folds it into the SHA256SUMS + fan-in.

Validation

  • Linux: compiles, fmt, clippy -D warnings, 193 tests — all green locally.
  • The Windows compile is validated by this PR’s CI, not locally (no MSVC SDK here). Publishing is main-only, so this PR run builds the Windows binary (proving the cross-compile + windows-service link under cargo-xwin) without cutting a release. First run rebuilds the amd64 prepared image (cargo-xwin + SDK), so expect it slow.

Deferred

Created Jul 23, 2026 at 16:44 UTC | Merged Jul 23, 2026 at 17:15 UTC by colechristensen cole.christensen@gmail.com