Repository: goreleaser/goreleaser (Go)

Issue:
Solaris/Sparc64 target
### Is your feature request related to a problem? Please describe.

Solaris runs on these architectures:
* Sparc
* Sparc64
* AMD64

Go supports Solaris/Sparc64 and Solaris/Sparc.  goreleaser performs additional verification on GOOS and GOARCH before providing them to Go, preventing builds for Solaris on SPARC architectures.

### Describe the solution you'd like

Allow goos `solaris` with architectures `sparc` and `sparc64`.

This affects (at least):
* pipeline/build/valid_os.go
* pipeline/build/target_test.go

### Describe alternatives you've considered

Build outside of goreleaser.

### Search

- [X] I did search for other open and closed issues before opening this

### Supporter

- [ ] I am a [sponsor](https://github.com/sponsors/caarlos0/) or a [Pro](https://goreleaser.com/pro) customer

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

### Additional context

_No response_


Discussion:
> Go supports Solaris/Sparc64 and Solaris/Sparc.

I get this with go 1.23:

```
$ GOOS=solaris GOARCH=sparc go build .
go: unsupported GOOS/GOARCH pair solaris/sparc
```

linux/sparc linux/sparc64 also fail.

it is not listed here https://go.dev/doc/install/source#environment

I could find references in Go's src https://github.com/search?q=repo%3Agolang%2Fgo%20sparc&type=code

but not in go 1.24 release notes... although it appears to be in the tag https://github.com/golang/go/blob/16afa6a740fac7442e94dcd2ec5ea4a4853e45dc/src/internal/syslist/syslist.go#L80

so I suppose this is go 1.24+ only?
Thank you.

To clarify your observations around the unsupported OS/arch pair, Sparc and Sparc64 are legacy processors and are not supported out of the box by Go.  Only people with legacy systems should need this combo:
https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63#goarch-values




Patch:
diff --git a/internal/builders/buildtarget/targets.go b/internal/builders/buildtarget/targets.go
index 5cfbfe68db7..c35defc13ab 100644
--- a/internal/builders/buildtarget/targets.go
+++ b/internal/builders/buildtarget/targets.go
@@ -2,6 +2,9 @@
 // goos, goarch, goarm, goamd64, gomips and go version.
 package buildtarget
 
+// TODO: move this to internal/builders/golang, as it actually is related to
+// and used in the go builder only.
+
 import (
 	"fmt"
 	"regexp"
@@ -237,6 +240,8 @@ var (
 		"plan9amd64",
 		"plan9arm",
 		"solarisamd64",
+		"solarissparc",
+		"solarissparc64",
 		"windowsarm",
 		"windowsarm64",
 		"windows386",
@@ -276,6 +281,8 @@ var (
 		"wasm",
 		"riscv64",
 		"loong64",
+		"sparc",
+		"sparc64",
 	}
 
 	validGoamd64   = []string{"v1", "v2", "v3", "v4"}


Test patch:
diff --git a/internal/builders/buildtarget/targets_test.go b/internal/builders/buildtarget/targets_test.go
index f7d2858a7f7..63270202c15 100644
--- a/internal/builders/buildtarget/targets_test.go
+++ b/internal/builders/buildtarget/targets_test.go
@@ -247,6 +247,8 @@ func TestGoosGoarchCombos(t *testing.T) {
 		{"plan9", "amd64", true},
 		{"plan9", "arm", true},
 		{"solaris", "amd64", true},
+		{"solaris", "sparc", true},
+		{"solaris", "sparc64", true},
 		{"windows", "386", true},
 		{"windows", "amd64", true},
 		{"windows", "arm", true},