Build-only Windows port: cross-compile windows/amd64, and name the platform seams
What
vole serve runs on Linux and macOS. There is no Windows build: at
d1c3b32, GOOS=windows GOARCH=amd64 go build ./... stops with five type
errors in two files, and a handful of other call sites are unix-only but hidden
behind the first failure. Nobody can answer “does the server work on Windows?”
without a build to run.
This issue is the first milestone: make the tree build and type-check for
windows/amd64, put every unix assumption behind a platform file, and fail
loudly where a security control cannot yet be honoured. It does not claim the
server runs on Windows.
Current state
Compile blockers, in dependency order:
| Where | What |
|---|---|
internal/storage/storage.go:88,115 |
syscall.Stat_t for allocated-block accounting and hard-link dedupe |
internal/storage/storage.go:150,151 |
syscall.Statfs_t, syscall.Statfs for disk totals |
internal/audit/audit.go:193 |
syscall.Stat_t uid against os.Geteuid() |
ci/agent/disk.go:18,19 |
syscall.Statfs for the runner’s free-space guard |
ci/agent/gitcache.go:63,68,81,86 |
syscall.Flock/LOCK_* with no !unix fallback, unlike core/git and ci/cache |
ci/agent/sandbox.go:155 |
syscall.Kill(pid, 0) liveness probe |
ci/agent/agent.go:1807,1833 |
SysProcAttr{Setpgid:true} and syscall.Kill(-pid, SIGKILL) for the command process group |
server/integration_test.go:3356 |
syscall.Kill(-pid, SIGKILL) in the runner test’s cleanup |
Runtime assumptions that compile but do not hold:
internal/secure/secure.gois file modes as a security control:Chmod(0600)only togglesFILE_ATTRIBUTE_READONLYon Windows, andos.Statreports 0666 for any writable file, so today’sHardenFilewould both make secrets read-only and never verify anything.internal/audit/audit.gorequires the audit log to be owned by the process uid and mode 0600; Windows needs an owner SID and a DACL check instead.cmd/vole/ssh.go:254syscall.Execexists on Windows but returnsEWINDOWS, sovole ssh-shell— the sshd front-door forced command — cannot work there.ci/agentkills a process group; Windows needs a Job Object to reach grandchildren.internal/secure/umask_other.go,core/git/lock_other.goandci/cache/lock_other.goalready degrade on non-unix: no umask, and locks that serialize only inside one process.ci/agent/gitcache.gohas no such fallback.internal/sshdconfigandvole ssh-config --platformknowlinuxanddarwinonly.
Verified with GOOS=windows GOARCH=amd64 go build ./..., go build -gcflags=-e
per package, and a throwaway worktree that stubbed the two first failures: with
those stubbed, the tree builds and go vet reports only the test cleanup.
Hosting note
DigitalOcean cannot test this: its public image catalog has no Windows entry at
all (the API lists AlmaLinux, CentOS, Debian, Fedora, Rocky Linux and Ubuntu; no
windows-* slug), and it offers no Windows licensing or cloudbase-init.
Milestone 2 needs AWS, Azure, or a local QEMU/Hyper-V VM with an eval image.
deploy/cloud-init/vole.yaml is Linux cloud-init and does not apply.
Scope of this issue
- Split each unix-only file into
*_unix.go,*_windows.go, and — where a non-target platform should still build — a*_other.gofallback, matching the existingumask_*andlock_*pairs. - Implement the Windows side where it is cheap and safe: disk totals through
GetDiskFreeSpaceEx, hard-link identity throughGetFileInformationByHandle,LockFileEx/UnlockFileExfor the runner cache locks, anOpenProcess+GetExitCodeProcessliveness probe, and free space for the runner’s guard. - Return an explicit error from the Windows security paths (
internal/securetightening,internal/auditownership) rather than skipping the check or silently applying unix mode bits. A Windows build must refuse to serve before it can weaken a control; ACL hardening is milestone 2. - Replace the front door’s
syscall.Execwith a platform helper so Windows reports that the forced-command path is unavailable instead of returning a bareEWINDOWS. - Move the runner test’s process-tree cleanup behind a test helper.
- Gate it in CI: cross-compile
windows/amd64and runGOOS=windows go vet ./...(which type-checks test files) beside the existingmacOS binariesstep.
golang.org/x/sys moves from indirect to direct for the Windows files. It is
already in the module graph at v0.49.0 and its BSD-3-Clause license is already
listed in licenses.toml.
Acceptance criteria
GOOS=windows GOARCH=amd64 go build ./...andGOOS=windows GOARCH=amd64 go vet ./...pass, locally and inverify.gofmt -l .is empty;go build ./...,go vet ./...andgo test ./...are unchanged on linux/darwin.- No unix security behaviour changes:
internal/secureandinternal/auditkeep their current checks, messages and tests. - Every unix-only site above is either implemented for Windows or answers with an error that says what is missing and why it is not silently skipped.
vole workflow checkpasses.
Out of scope
- Running
vole serveon Windows: ACL-backedinternal/securehardening, SID ownership ininternal/audit,CreateProcess-based front-door handoff, Job Objects for runner commands, Windows OpenSSH drop-in ininternal/sshdconfig. - Packaging, service management, and deployment: no MSI/zip, no Windows service unit, no cloud-init equivalent.
- CI at all beyond type-checking: no Windows runner in the verify image.