Build on Windows: move the uid and mode checks behind build tags - #6
Open
ucsandman wants to merge 1 commit into
Open
Build on Windows: move the uid and mode checks behind build tags#6ucsandman wants to merge 1 commit into
ucsandman wants to merge 1 commit into
Conversation
checkPrivateDir and InspectSocket read *syscall.Stat_t, which does not exist on Windows, so `go build ./...` failed there. The unix checks move unchanged into privdir_unix.go; privdir_windows.go supplies no-ops, because Go's FileInfo mode bits on Windows are synthesised (0777 for every directory) and the 0o077 test would refuse every path. The ACL on the per-user directory is the control there. InspectSocket also stops flagging the synthesised socket mode as a problem on Windows. Verified: go build on windows, linux and darwin; go test ./internal/daemon on linux unchanged; mole serve --toolkit on Windows 11 with mole-mcp and a live mole.search over the unix socket. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159iCPkpUZaAAzoYd9A6g2z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to run mole on my Windows box and
go build ./...failed on two spots in internal/daemon that read*syscall.Stat_t.What this does:
Checked:
Not touched: the rest of the test suite still assumes unix perms and a 104 byte socket path, so a bunch of tests fail on Windows. Didn't want to bloat this one. Happy to do a follow up if you want Windows in CI. Will sign the CLA.
🤖 Generated with Claude Code
https://claude.ai/code/session_0159iCPkpUZaAAzoYd9A6g2z