New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support Go first class ports as targets #3053
Comments
I think this would be nice indeed, not sure of the UI for it yet, but will think about something. |
Yep, I agree that the UI isn't super clear. I'm not sure that there is an established pattern in YAML for a default list value that also allows adding (or removing?) custom elements. Perhaps a YAML object would be easier than a list, given that it behaves more like a set in terms of duplicate elements. |
Adds the ability to tell goreleaser to use the first-class Go ports as targets. Closes #3053 Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
Adds the ability to tell goreleaser to use the first-class Go ports as targets. Closes #3053 Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
Go has a notion of first class ports; it's the GOOS/GOARCH combinations for which upstream Go publishes binary releases. Since golang/go#38874, this information is also provided by cmd/go itself:
I can manually copy this table over to the
builsd.targets
section as follows:However, this is verbose and cumbersome - especially as Go's first-class ports can change with each Go version. I wouldn't be surprised if
windows_arm64
was added in a future Go release, for example. Hard-coding a list is also not great, as a first class port might be added in e.g. Go 1.19 but isn't yet ready in e.g. Go 1.18.x.It's worth noting that first class ports are a bit of a fuzzy concept, but as described in https://github.com/golang/go/wiki/PortingPolicy#first-class-ports, they are a good starting point for Go projects to release binaries. If upstream Go treats these ports as important and well tested, then they are less likely to break and more likely to be popular among users.
Describe the solution you'd like
Some way to ask goreleaser to build with the first class GOOS/GOARCH targets. I'm not very experienced with YAML or how goreleaser configs work, so I'll leave the design a bit vague in that respect. As a strawman proposal, one could imagine:
Describe alternatives you've considered
Manually listing the targets, as described; too verbose and can easily get stale over the years.
A GOOS/GOARCH matrix doesn't work either, because the first class ports are not a simple product of GOOS and GOARCH values. For example,
darwin
andlinux
havearm64
butwindows
does not, andlinux
andwindows
have386
butdarwin
does not.Search
Code of Conduct
Additional context
The catalyst here is the goreleaser config used in CUE: https://github.com/cue-lang/cue/blob/5127136cfc8c6b695c9d663bee8cb89f4c5df6ad/.goreleaser.yml#L13-L19
Note how it lacks multiple first class ports, which is unfortunate.
linux/386
is still popular, for example.The text was updated successfully, but these errors were encountered: