Skip to content

Drop Windows support and clear the gosec backlog - #47

Merged
bkildow merged 2 commits into
mainfrom
chore/lint-clean-drop-windows
Aug 17, 2026
Merged

Drop Windows support and clear the gosec backlog#47
bkildow merged 2 commits into
mainfrom
chore/lint-clean-drop-windows

Conversation

@bkildow

@bkildow bkildow commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Closes the two follow-ups left open when CI landed in #46: lint was non-blocking, and Windows was excluded from the test matrix.

Windows

Windows support was only ever partial, so it is removed rather than repaired:

Failing test What it actually showed
TestRunParallelSetupHooksConcurrency Setup hooks never ran — hooks execute through a POSIX shell
TestIsProcessAlive A deliberate stub returning false; stale setup-state reconciliation was a no-op
TestNewTemplateVars Path separators (\ vs /)
TestCopyFileContentAndMode, TestByteCopyFallback Windows has no Unix mode bits

Two core behaviours were inert, not cosmetically broken. Making Windows genuinely work is a project, not a test fix.

  • Deleted cmd/process_windows.go, internal/project/process_windows.go, internal/disk/disk_windows.go
  • Dropped the now-redundant !windows build tags and renamed the files accordingly (process_unix.goprocess.go, disk_unix.gostat.go), via git mv so history follows
  • Removed windows from .goreleaser.yaml (releases are now 4 archives: linux/darwin × amd64/arm64) and from the CI cross-compile job
  • README.md now states macOS/Linux support explicitly

GOOS=windows go build now fails to compile. That is intended — it is more honest than shipping a binary whose hooks and process handling do not work.

internal/project/fscopy/reflink_other.go stays: its !darwin && !linux constraint still covers the BSDs.

gosec

All 5 findings fire on wt doing exactly what it exists to do — walking the user's own project tree and launching the editor they configured. G702/G703 are the taint-analysis equivalents of G204/G304, which .golangci.yml already excluded, so the existing exclude list is extended rather than scattering 5 inline //nolint comments. G122 flags symlink TOCTOU while walking shared/, the user's own directory.

Lint is now blockingname: lint and no --issues-exit-code=0.

Verification

  • make vet → 0 issues (this gated making lint blocking)
  • make test green, and green again under fresh-runner conditions (HOME empty, GIT_CONFIG_NOSYSTEM=1)
  • All 4 remaining release targets cross-compile
  • actionlint passes; goreleaser check validates the config

Note: gofumpt -l flags cmd/add.go and internal/git/git_test.go, but those are pre-existing on main and untouched here — a version skew between the standalone gofumpt binary and the one golangci-lint bundles. golangci-lint itself reports 0 issues.

https://claude.ai/code/session_01DCt9dthckWH7pYtPfzaDwF

CI shipped with two deliberate compromises: lint ran non-blocking because
golangci-lint reported five pre-existing gosec findings, and Windows was
kept out of the test matrix because the suite failed there. Resolve both.

Windows support was only ever partial. IsProcessAlive was a stub that
always returned false, so stale setup-state reconciliation was a no-op,
and setup hooks run through a POSIX shell, so they never ran at all. The
remaining failures were mode bits and path separators. Making Windows
genuinely work is a project, not a test fix, so remove it: delete the
_windows.go implementations, drop the now-redundant !windows tags, and
stop building the target in goreleaser and CI. GOOS=windows no longer
compiles, which is the honest outcome.

The gosec findings all fire on the tool doing what it exists to do --
walking the user's own project tree and launching the editor they
configured. G702 and G703 are the taint-analysis equivalents of G204 and
G304, which .golangci.yml already excluded, so extend that list rather
than scatter nolint comments. With the findings resolved, lint becomes
blocking.

Claude-Session: https://claude.ai/code/session_01DCt9dthckWH7pYtPfzaDwF
Making lint blocking surfaced G115 in internal/disk/stat.go: Bsize is
int64 on Linux and uint32 on Darwin, so the uint64 conversion only looks
lossy on one of them. A block size is never negative, so silence it at
the site rather than excluding G115 everywhere -- it is a useful rule.

The finding was pre-existing and hidden twice over: lint was
non-blocking, and it only ran for one GOOS. Lint each supported target
so platform-specific files stop going unchecked; reflink_darwin.go was
never being linted at all.

Claude-Session: https://claude.ai/code/session_01DCt9dthckWH7pYtPfzaDwF
@bkildow
bkildow merged commit 41c26c8 into main Aug 17, 2026
5 checks passed
@bkildow
bkildow deleted the chore/lint-clean-drop-windows branch August 17, 2026 21:50
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