Description
Running go test on native Windows fails to build github.com/docker/compose/v5/pkg/compose because pkg/compose/hook_test.go calls github.com/containerd/console.NewPty(), which is not available on Windows.
Actual behavior
# github.com/docker/compose/v5/pkg/compose [github.com/docker/compose/v5/pkg/compose.test]
.\hook_test.go:70:35: undefined: console.NewPty
FAIL github.com/docker/compose/v5/pkg/compose [build failed]
FAIL
Expected behavior
Windows-native go test should not fail at compile time due to Unix-only PTY usage; PTY-dependent tests should be excluded via Go build constraints (or similar gating).
Suggested fix
Add a build constraint to pkg/compose/hook_test.go, e.g.
//go:build !windows
// +build !windows
Steps To Reproduce
Environment
- OS: Windows (native, not WSL)
- Go:
go version go1.25.4 windows/amd64
- Repo:
docker/compose
- Commit:
579bbe7a87cf766a126ac24002d235bdc4dc360e
To Reproduce
- Clone
docker/compose at commit 579bbe7a87cf766a126ac24002d235bdc4dc360e
- On Windows (native, not WSL), run from
pkg/compose:
Compose Version
Docker Environment
Anything else?
Discovered while working on #13674. No existing build constraints found in hook_test.go; a quick audit of other test files in pkg/compose may reveal similar gaps.
Description
Running
go teston native Windows fails to buildgithub.com/docker/compose/v5/pkg/composebecausepkg/compose/hook_test.gocallsgithub.com/containerd/console.NewPty(), which is not available on Windows.Actual behavior
Expected behavior
Windows-native
go testshould not fail at compile time due to Unix-only PTY usage; PTY-dependent tests should be excluded via Go build constraints (or similar gating).Suggested fix
Add a build constraint to
pkg/compose/hook_test.go, e.g.Steps To Reproduce
Environment
go version go1.25.4 windows/amd64docker/compose579bbe7a87cf766a126ac24002d235bdc4dc360eTo Reproduce
docker/composeat commit579bbe7a87cf766a126ac24002d235bdc4dc360epkg/compose:Compose Version
Docker Environment
Anything else?
Discovered while working on #13674. No existing build constraints found in hook_test.go; a quick audit of other test files in pkg/compose may reveal similar gaps.