Windows support (rebased): cross-compile MSVC via cargo-xwin #47
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 ungatedlibc::calls I flagged in the audit.- Windows Service (SCM) support (
service_windows.rs, dispatcher inmain.rs). update.rsWindows naming +.exeswap;executor.rsWindows-container path;shutdown.rs/pid_file.rs/detach.rsvia 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
preparegains clang/lld/llvm + cargo-xwin 0.23.0 + the msvc target + a warmed xwin SDK (baked into the image). build-arch.shbuildsanvil_windows_amd64on the amd64 path;publish-release.shfolds 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-servicelink under cargo-xwin) without cutting a release. First run rebuilds the amd64 prepared image (cargo-xwin + SDK), so expect it slow.
Deferred
- arm64 Windows.
- Native Windows CI on a WSL host (WSL detection/bridge) — fangorn/anvil-cli#45.