Skip to content

Two test files don't compile for GOOS=windows (syscall.Stat_t, SysProcAttr.Setpgid); no gate vets non-default GOOS #925

Closed

Description

@scttfrdmn

Found while working on #913 (which gates custom build tags, not GOOS).

Production code builds for Windows (GOOS=windows go build ./... is clean, and GoReleaser ships windows/amd64). But the test build doesn't:

$ GOOS=windows go vet ./...
vet: pkg/taskproto/wrapper_test.go:629:33: undefined: syscall.Stat_t
vet: pkg/service/remote_test.go:41:42: unknown field Setpgid in struct literal of type syscall.SysProcAttr

(verified on main, 38b2d66). Both files use Unix-only syscall APIs without a //go:build !windows constraint, so go test ./... can't build on Windows. That's low impact today, since nobody runs the suite on Windows. But the repo has 6 //go:build windows files and 3 !windows/!linux && !windows ones, and CI only vets linux. Windows-only code paths get type-checked by go build and nothing else.

Suggested: constrain those two tests (or move the Unix-specific parts to a _unix_test.go), then add GOOS=windows go vet ./... next to the build-tag gate from #913.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions