Skip to content

Build and test on Windows - #43

Merged
foundev merged 2 commits into
masterfrom
windows-support
Sep 29, 2026
Merged

foundev merged 2 commits into
masterfrom
windows-support

Conversation

@foundev

@foundev foundev commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

go install github.com/BrokkAi/micro-acp@latest fails on Windows:

internal/osrun/run.go:55:41: unknown field Setpgid in struct literal of type syscall.SysProcAttr
internal/osrun/run.go:64:17: undefined: syscall.Kill

internal/osrun used Unix-only syscalls without a build constraint, so anything importing runner, v2/runner, or clienthost could not compile on Windows. CI only covered Linux and macOS.

Changes

  • internal/osrun: process-group setup and Kill split into kill_unix.go (unchanged Setpgid + group SIGKILL) and kill_windows.go (CREATE_NEW_PROCESS_GROUP, taskkill /T /F for the tree, direct kill fallback).
  • Test fixtures: acpvalidate.AbsolutePath is intentionally host-absolute, so Unix fixtures like /tmp fail on Windows. New internal/testpath.Root ("" on Unix, "C:" on Windows) prefixes those fixtures; Unix behavior is byte-identical.
  • FIFO test moved to clienthost/regression_unix_test.go; symlink tests skip only on ERROR_PRIVILEGE_NOT_HELD; Example_v2McpServers (Unix path in fixed // Output:) is !windows.
  • CI: windows-latest added with fail-fast: false. License and Python script checks stay on Linux/macOS (CRLF checkout changes the hashed LICENSE bytes; they're OS-independent anyway).

Verification

  • Windows: go build ./..., go vet ./..., go test -count=1 ./... all pass (race not run locally: no cgo).
  • GOOS=linux / GOOS=darwin go vet ./... clean.
  • micro-acp builds and passes its tests on Windows against this branch.

🤖 Generated with Claude Code

internal/osrun used Setpgid and syscall.Kill without a build constraint,
so any module importing runner, v2/runner, or clienthost failed to compile
on Windows (seen via `go install github.com/BrokkAi/micro-acp@latest`).
Process-group setup and tree kill now live in kill_unix.go and
kill_windows.go; Windows uses taskkill /T with a direct-kill fallback.

Tests used Unix-rooted fixture paths that host-absolute validation
rejects on Windows; internal/testpath roots them on a drive there. The
FIFO test is Unix-only, symlink tests skip without the Windows symlink
privilege, and the v2 MCP cookbook example (Unix path in its fixed
output) is excluded on Windows. CI gains a windows-latest job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clienthost kills every terminal again after Wait so Unix can reap
orphans in the process group. On Windows, Wait releases Go's handle, so
taskkill /T by PID could hit an unrelated process that reused it. Kill
now opens its own handle, confirms Go has not reaped the command, and
returns os.ErrProcessDone otherwise, as Unix does.

TestTerminalSymlinkWorkspace ran pwd, which Git Bash prints as /c/...;
Windows now uses cmd /c cd for the native spelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foundev
foundev merged commit a5c9a46 into master Sep 29, 2026
9 of 10 checks passed
@foundev
foundev deleted the windows-support branch September 29, 2026 13:01
@foundev foundev mentioned this pull request Sep 29, 2026
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.

1 participant