-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Open
Labels
Description
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 !windowsSteps 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/composeat commit579bbe7a87cf766a126ac24002d235bdc4dc360e - On Windows (native, not WSL), run from
pkg/compose:go test .
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.
Reactions are currently unavailable