Add arm64 support for M1 Mac, replace golint#46
Conversation
…test gomock with arm support
ibottamike
left a comment
There was a problem hiding this comment.
It looks good, some nice updates with adding arm64
|
@physik932 -- I've created elementalvoid/asdf-sopstool#1 to get ready for the asdf plugin update. I am not positive what the release file name will look like but this is the basics. Once we have a release here we can ensure the plugin update works! |
| dockers: | ||
| - goos: linux | ||
| - id: amd64image | ||
| goos: linux |
There was a problem hiding this comment.
this is in prep for manifest build. However - buildx is only available via docker desktop? so I can't get any further.
There was a problem hiding this comment.
we should probably add a note in the readme that we're only building amd64 docker images currently
There was a problem hiding this comment.
I used colima locally and it seems like the build works (see this comment). I can add that note too.
There was a problem hiding this comment.
sure. its building your local platform. we need to build a manifest-build and specify both platforms for it to work properly for both. That requires buildx.
There was a problem hiding this comment.
sure. its building your local platform. we need to build a manifest-build and specify both platforms for it to work properly for both. That requires buildx.
To clarify for myself, colima is able to process the docker image goreleaser is buildiong because it uses my local machine's platform, but for a manifest build, we would want both amd64 and arm64 to be produced and that requires buildx?
There was a problem hiding this comment.
I've added a note about the OS and arch for the docker build to the README.
|
Looks like we're good to go! ❯ go build
❯ go fmt ./...
❯ go test ./...
? github.com/Ibotta/sopstool [no test files]
? github.com/Ibotta/sopstool/cmd [no test files]
ok github.com/Ibotta/sopstool/filecrypt (cached)
ok github.com/Ibotta/sopstool/fileutil (cached)
ok github.com/Ibotta/sopstool/oswrap (cached)
? github.com/Ibotta/sopstool/oswrap/mock [no test files]
ok github.com/Ibotta/sopstool/sopsyaml (cached)
? github.com/Ibotta/sopstool/testhelpers [no test files]
❯ golangci-lint run
❯ goreleaser release --snapshot --rm-dist --skip-publish
• releasing...
• loading config file file=.goreleaser.yml
• loading environment variables
• getting and validating git state
• building... commit=a616f92238e93190772106e7106f6196ddad6dc7 latest tag=v0.4.4
• pipe skipped error=disabled during snapshot mode
• parsing tag
• setting defaults
• snapshotting
• building snapshot... version=0.4.4-SNAPSHOT-a616f92
• 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/sopstool_linux_arm64/sopstool
• building binary=dist/sopstool_darwin_arm64/sopstool
• building binary=dist/sopstool_linux_amd64/sopstool
• building binary=dist/sopstool_darwin_amd64/sopstool
• archives
• creating archive=dist/sopstool_darwin_amd64.tar.gz
• creating archive=dist/sopstool_darwin_arm64.tar.gz
• creating archive=dist/sopstool_linux_amd64.tar.gz
• creating archive=dist/sopstool_linux_arm64.tar.gz
• linux packages
• creating arch=amd64 file=dist/sopstool_linux_amd64.rpm format=rpm package=sopstool
• creating arch=amd64 file=dist/sopstool_linux_amd64.deb format=deb package=sopstool
• creating arch=arm64 file=dist/sopstool_linux_arm64.rpm format=rpm package=sopstool
• creating arch=arm64 file=dist/sopstool_linux_arm64.deb format=deb package=sopstool
• homebrew tap formula
• writing formula=dist/sopstool.rb
• calculating checksums
• docker images
• building docker image image=ibotta/sopstool:latest
• pipe skipped error=publishing is disabled
• storing release metadata
• writing file=dist/artifacts.json
• writing file=dist/metadata.json
• release succeeded after 7.82s |
| dockers: | ||
| - goos: linux | ||
| - id: amd64image | ||
| goos: linux |
There was a problem hiding this comment.
we should probably add a note in the readme that we're only building amd64 docker images currently
elementalvoid
left a comment
There was a problem hiding this comment.
Looks good from my side. I'll defer to y'all to decide when the packaging is all correct.
Co-authored-by: Justin Hart <onyxraven@users.noreply.github.com>
|
After some discussion with @onyxraven I filed two issues for the future: |
Background
sopstoolcurrently doesn't have support for Mac M1 laptops (darwin-arm64).sopslatest 3.7.2 version adds support for the architecture. I'm adding it as an option togoreleaserbut ran into some new things:gomock 1.6.0 breaking change
gomockadded ARM support in 1.6.0 but introduced a breaking change toDoAndReturn. It only takes one argument now instead of supporting any number of them (TIL this is what variadic means). I've removedargs ...stringfrom these functions to get tests to pass for now, but I'm new togolangand unsure of the consequences. I'm doing a bit of reading to make sure I understand what this means.golint deprecated
golint appears deprecated and was not installed on my machine when I built the project using
go 1.17. I haven't found a replacement yet but a few popped up:go-version file
I added a
.go-versionfile for the current version of the project. It is recognized bygoenvandasdf-vm.asdf-vm plugin for sopstool
@elementalvoid owns the asdf-vm plugin for
sopstool; we will need to introduce a PR there to work withdarwin-arm64packages and update the error message.Versioning
0.5.0Additional Requests to Reviewers
Looking for any help on linters, testing the breaking change, and testing arm64 support.
Tasks
/cc