-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
goreleaser: add arm64 build for each OS #1073
Conversation
@ekingery Could you look at the GoReleaser part of the code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair warning - I'm also no goreleaser expert, but this seems totally fine and should be easy enough to validate / confirm. This may have already been done, but if not you can build off the branch to test before merging.
I tried building this on my machine and got the following failure:
I'm not sure if this means that I need to do something on my machine to support the pair, or if it's just unsupported in general. It did successfully create all of the following:
|
@ee7 Do you know if Windows ARM64 is supported? |
I think it should be.
And there seems to be plenty of software that both uses GoReleaser, and has windows/arm64 releases. For example, the GitHub CLI: |
And building $ go version
go version go1.19.3 linux/amd64
$ goreleaser --version
goreleaser version 1.12.3
goos: linux
goarch: amd64
https://goreleaser.com
$ GOARCH=arm64 GOOS=windows goreleaser build --single-target --snapshot --rm-dist
• starting build...
• loading config file file=.goreleaser.yml
• building only for windows/arm64 reason=single target is enabled
• loading environment variables
• getting and validating git state
• building... commit=bda6cd2700acf05f3511abe6f957367d8482fe91 latest tag=v3.1.0
• pipe skipped reason=disabled during snapshot mode
• parsing tag
• setting defaults
• snapshotting
• building snapshot... version=3.1.0-SNAPSHOT-bda6cd2
• checking distribution directory
• --rm-dist is set, cleaning it up
• loading go mod information
• build prerequisites
• writing effective config file
• writing config=dist/config.yaml
• building binaries
• building binary=dist/exercism_windows_arm64/exercism.exe
• storing release metadata
• writing file=dist/artifacts.json
• writing file=dist/metadata.json
• build succeeded after 0s
$ file dist/exercism_windows_arm64/exercism.exe
dist/exercism_windows_arm64/exercism.exe: PE32+ executable (console) Aarch64 (stripped to external PDB), for MS Windows |
@kytrinyx What version of Go and GoReleaser did you use? Maybe the build failure was due to https://goreleaser.com/deprecations/#builds-for-windowsarm64? Does the |
I used
I'll upgrade both and try again. |
For me, every build succeeds apart from Currently the version is: Line 25 in e0dbcd1
So I think the options are:
Any thoughts? |
I'm unable to reproduce the failure on |
Thanks. So this command succeeds for you? GOARCH=arm64 GOOS=freebsd goreleaser build --rm-dist --snapshot --single-target I'm asking because you wrote that
My understanding is that Edit: And if the command to build |
Ah, no. That fails for me. Sorry about that.
Maybe? I doubt it. I will take a proper look again tomorrow when I can give this my full attention. |
I upgraded go and goreleaser:
I tried running the following command, which failed (details collapsed):
Output
Here's the version where I just run the single target: Output
|
Thanks. It looks like that fixed the
Great - that's what I see too. Bumping |
OK - I did a binary search to determine the minimum @kytrinyx Edit: now |
For me |
I've reproduced that failure too. I spoke too soon - sorry for the noise. But every build really does succeed for me locally with 5aa8768. Does that fix everything for you too? |
This now succeeds for me as well! |
The latest release of the Exercism CLI (3.1.0, 2022-10-04) includes these assets, via GoReleaser: exercism-3.1.0-darwin-x86_64.tar.gz exercism-3.1.0-freebsd-i386.tar.gz exercism-3.1.0-freebsd-x86_64.tar.gz exercism-3.1.0-linux-armv5.tar.gz exercism-3.1.0-linux-armv6.tar.gz exercism-3.1.0-linux-i386.tar.gz exercism-3.1.0-linux-ppc64.tar.gz exercism-3.1.0-linux-x86_64.tar.gz exercism-3.1.0-openbsd-i386.tar.gz exercism-3.1.0-openbsd-x86_64.tar.gz exercism-3.1.0-windows-armv5.zip exercism-3.1.0-windows-armv6.zip exercism-3.1.0-windows-i386.zip exercism-3.1.0-windows-x86_64.zip exercism_checksums.txt exercism_checksums.txt.sig For future releases, this commit configures GoReleaser to include an arm64 (also known as aarch64) release asset for each of the existing OSes. Note that we will have separate x86_64 and arm64 release assets for macOS; previously macOS users on arm64 had to run the x86_64 binary via Rosetta (or build the CLI themselves). At least for now, let's avoid adding a fat binary. But note that GoReleaser does support it [1]. [1] https://goreleaser.com/customization/universalbinaries/ Closes: exercism#966
This commits the result of running go get golang.org/x/[email protected] to fix a build failure for freebsd_arm64. This seems to be the minimum bump to fix that failure without introducing a build failure for darwin_arm64 and openbsd_arm64. We cannot bump to the latest release (0.3.0, 2022-12-03) because that causes the Linux and macOS CI jobs to fail with: Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall.go:83:16: undefined: unsafe.Slice Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.go:95:8: undefined: unsafe.Slice Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:118:7: undefined: unsafe.Slice Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice note: module requires Go 1.17 and we need other changes in order to bump the minimum Go version.
5aa8768
to
ba91c32
Compare
Great. Thanks again for testing. This PR seems OK to me now. For the future, it'd be nice if we could try to bump some dependency versions in this repo - this PR was trickier than I hoped. In case somebody wanted to merge with a merge commit: I've rebased on I'd only say that I'd prefer to avoid "rebase and merge" here, since it means that we'd introduce a commit on |
Thank you so much for working through this so carefully. I agree that getting some dependencies bumped would be a Good Thing(tm)! |
Thanks @ee7! |
The latest release of the Exercism CLI (3.1.0, 2022-10-04) includes these assets, via GoReleaser:
For the next release, make GoReleaser include an arm64 (AKA aarch64) build for each of the existing OSes. This means we will have separate x86_64 and arm64 release assets for macOS; previously macOS users on arm64 had to run the x86_64 binary via Rosetta (or build the CLI themselves).
At least for now, let's avoid adding a fat binary (which contains both x86_64 and arm64 executables). But note that GoReleaser does support it.
Closes: #966
I am not a GoReleaser expert - please review this carefully.
Note for Go 1.19.3, the first class targets are:
so Go itself does not declare arm64 as "first class" on Windows, FreeBSD, and OpenBSD. But the Exercism CLI already provides lots of releases that aren't in the above list.
GitHub does not yet provide arm64 machines for their hosted runners, so we can't run integration tests of the new arm64 binaries on the native architecture without adding a new CI provider.