Port the kata daemon to Windows#75
Conversation
roborev: Combined Review (
|
|
Thanks. If you don't mind I can take it from here and I'll add CI so this doesn't regress? |
Squashed Windows port branch. Additional commits folded in: - fix(daemon): detach auto-started daemon from caller console/stdio on Windows - fix(windows): tag token_identity e2e test !windows like its siblings - test(windows): stand up named signal events for faked daemons in stop/reload tests - fix(windows): make the test suite pass on Windows
Guard the Windows daemon port against regressions. The _windows.go files and !windows build tags are never compiled by the existing ubuntu-latest lanes, so breakage on Windows is invisible there. The new job runs go build, go vet, and go test -p 1 ./... on windows-latest. The project has no cgo, so unlike msgvault it needs no MSYS2 or toolchain setup. vet runs explicitly because the GOOS=linux golangci-lint lane never sees the Windows-tagged files.
The path is built from the daemon's own data dir and the fixed "daemon.log" constant, not user input. Annotate //nolint:gosec so the make-lint pre-commit hook (and CI lint lane) pass.
roborev: Combined Review (
|
Git for Windows checks out text files as CRLF (core.autocrlf=true by default). The internal/tui snapshot tests compare golden files byte-for-byte against LF-rendered output, so on windows-latest all ~45 TestSnapshot_* cases failed with invisible want/got diffs. A repo-wide .gitattributes pins text files to LF on checkout for every platform.
TestClaimHubClientUsesUnixRuntimeForKataInvalid hardcoded
os.MkdirTemp("/tmp", ...); on the GitHub windows-latest runner /tmp
resolves to a nonexistent C:\tmp, failing with GetFileAttributesEx
before the test ever reached its AF_UNIX listener. The test exercises
the unix:// runtime-file fallback, which is Unix-only, so guard it with
the same runtime.GOOS check its endpoint_test.go siblings already use.
The file's other (platform-independent) test keeps running on Windows.
roborev: Combined Review (
|
|
@wesm is attempting to deploy a commit to the Kenn Software Team on Vercel. A member of the Team first needs to authorize it. |
roborev: Combined Review (
|
roborev: Combined Review (
|
Ports the kata daemon to Windows.
go build,go vet,go test, andgo mod tidyare clean on Windows and unchanged on Unix.Supersedes #73 / #74 (the
0xc0000142detach fix is folded in as its own commit).What's in it
Daemon port — platform-specific pieces behind build tags:
Local\kata-stop|reload-<dbhash>-<pid>) set bydaemon stop/reload. Unix keeps SIGTERM/SIGHUP.OpenProcess+GetExitCodeProcess(STILL_ACTIVE); Unix keepskill(0).USERNAME.Console detach fix (the original bug) — the daemon runs
git remoteto resolve project identity. On Windows the auto-started daemon shared the caller's console; once that shell exited, git aborted at startup withSTATUS_DLL_INIT_FAILED(exit status 0xc0000142). Now the daemon is created withDETACHED_PROCESS | CREATE_NEW_PROCESS_GROUPand routes stdout/stderr todaemon.loginstead of the caller's stderr (which a surviving detached daemon would hold open, hanging output-capturing parents).Test portability — stock
mainhad ~25 Windows failures in a Unix-first suite:token_identitye2e test tagged!windowslike its siblings.hookprobe.exe; hook-config tests use bare-name / per-OS absolute commands.shouldRefuseAutoStartDaemonnormalized viafilepath.ToSlash(a real bug: it looked for\go-buildon Windows).agentValue; beads-from-live-bd tests skip on Windows; stop/reload tests stand up the named events a real daemon would.CI — adds a
windowsjob to.github/workflows/test.ymlrunninggo build,go vet, andgo testonwindows-latest. The existing ubuntu lanes never compile the*_windows.gofiles or!windows-tagged tests, so this is the regression gate for the port. No cgo, so no extra toolchain setup.