GoReleaser "unsupported GOOS/GOARCH pair" in CI
GoReleaser expands goos x goarch into a build matrix. If a combination is not a valid Go target (or your Go version does not support it), the build fails with "unsupported GOOS/GOARCH pair".
What this error means
GoReleaser stops with "go: unsupported GOOS/GOARCH pair <os>/<arch>" for a target like windows/arm or darwin/386.
Terminal
⨯ build failed error=failed to build for darwin_386:
go: unsupported GOOS/GOARCH pair darwin/386
exit status 1Common causes
An invalid os/arch combination
Not every goos x goarch pair is a real Go target; for example darwin/386 is not supported.
A target dropped in a newer Go version
Some pairs were removed as Go evolved, so a matrix that once built now includes an invalid target.
How to fix it
Exclude the invalid pair
- List the valid pairs with
go tool dist list. - Add an
ignoreentry for the unsupported combination in the build. - Re-run so only valid targets are built.
.goreleaser.yaml
builds:
- goos: [linux, darwin, windows]
goarch: ['386', amd64, arm64]
ignore:
- goos: darwin
goarch: '386'Verify targets against the toolchain
Cross-check your matrix against the Go version in CI, since supported pairs change between releases.
Terminal
go tool dist listHow to prevent it
- Generate the matrix from
go tool dist listvalid pairs. - Use
ignoreto prune combinations that do not apply. - Re-check targets when bumping the Go version.
Related guides
GoReleaser "build failed: exit status 1" in CIFix GoReleaser "build failed: exit status 1" in CI - the underlying go build for one target failed, so GoRele…
GoReleaser cgo "gcc: not found" build error in CIFix GoReleaser cgo "gcc not found" in CI - a cross-compiled cgo build needs a C toolchain the runner lacks, o…
GoReleaser nfpm rpm/deb packaging failed in CIFix GoReleaser nfpm packaging failures in CI - building rpm or deb packages fails when required fields are mi…