fix: guard Unix-only syscalls in cmd/ward so it builds on Windows #538
No reviewers
Labels
No labels
burndown-2026-06
pressure-test
sunday-sprint
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/ward!538
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/windows-cmd-ward-syscalls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cmd/ward referenced Unix-only syscall symbols with no build guards, so the
whole main package failed to compile on windows/amd64 and nothing downstream
(ward exec, ops, git verbs, doctor, hooks) was reachable there:
agent_drain_exit.go: syscall.SysProcAttr{Setsid: ...} (no Setsid field on Windows)
container_bootstrap.go: info.Sys().(*syscall.Stat_t) (undefined on Windows)
Both live in the Linux-only container / agent-driver subsystem, which the
README already documents as depth-0 / unused on Windows; they just lacked
//go:build guards. Extract the two non-portable operations behind per-OS
helpers so the subsystem compiles everywhere without stubbing any command:
detachProcess(*exec.Cmd) - Unix sets SysProcAttr{Setsid: true}; Windows no-op
(the drain-exit waiter is Linux-container-only).
fileGID(os.FileInfo) (int, bool) - Unix reads Sys().(*syscall.Stat_t).Gid;
Windows returns ok=false (no POSIX group ownership), and both callers
already short-circuit on that.
After the split: go build/install ./... succeed on windows/amd64, go vet is
clean, linux+darwin (amd64+arm64) still cross-compile, and every cmd/ward test
covering the touched paths passes on Windows. The remaining Windows test
failures are pre-existing Unix assumptions in unrelated tests, now runnable for
the first time, and are called out for separate follow-up.
closes #536
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Summary
Related issue
Checklist
ward exec build,ward exec test,ward exec vet,ward exec lint.docs/,README.md,docs/FEATURES.md).cmd/ward referenced Unix-only syscall symbols with no build guards, so the whole main package failed to compile on windows/amd64 and nothing downstream (ward exec, ops, git verbs, doctor, hooks) was reachable there: agent_drain_exit.go: syscall.SysProcAttr{Setsid: ...} (no Setsid field on Windows) container_bootstrap.go: info.Sys().(*syscall.Stat_t) (undefined on Windows) Both live in the Linux-only container / agent-driver subsystem, which the README already documents as depth-0 / unused on Windows; they just lacked //go:build guards. Extract the two non-portable operations behind per-OS helpers so the subsystem compiles everywhere without stubbing any command: detachProcess(*exec.Cmd) - Unix sets SysProcAttr{Setsid: true}; Windows no-op (the drain-exit waiter is Linux-container-only). fileGID(os.FileInfo) (int, bool) - Unix reads Sys().(*syscall.Stat_t).Gid; Windows returns ok=false (no POSIX group ownership), and both callers already short-circuit on that. After the split: go build/install ./... succeed on windows/amd64, go vet is clean, linux+darwin (amd64+arm64) still cross-compile, and every cmd/ward test covering the touched paths passes on Windows. The remaining Windows test failures are pre-existing Unix assumptions in unrelated tests, now runnable for the first time, and are called out for separate follow-up. closes #536 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>