Skip to content

Add Apple M1 Build Arch (& other arm64) #28

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

Merged
merged 8 commits into from
Feb 24, 2021
Merged

Add Apple M1 Build Arch (& other arm64) #28

merged 8 commits into from
Feb 24, 2021

Conversation

jblz
Copy link
Member

@jblz jblz commented Feb 24, 2021

Now that go 1.16 has dropped, we can add darwin/arm64 to our build targets.

This change:

  • Bumps the go version to 1.16.x in the Travis CI config
  • Splits out the darwin platform into its own gox call (darwin/386 is not a valid GOOS/GOARCH pair)
  • Adds a barebones go.mod file (to get past cannot find main module error in go vet)
  • Adds a comment to the Replacement struct (to satisfy the lint job)
  • Runs the test file through gofmt -s (to satisfy the fmt job)

Discussion

https://a8c.slack.com/archives/CKUJZT08Y/p1614186371037300?thread_ts=1614128274.023800&cid=CKUJZT08Y

To Test

  • Install go 1.16
  • Clone this repo
  • make
    • The build should complete without error
    • ls build should contain valid gzipped binaries for all supported platform / architecture pairs.

Test on an M1 Mac

  • curl -L -o - https://github.com/Automattic/go-search-replace/releases/download/0.0.6-pre/go-search-replace_darwin_arm64.gz | gunzip > /tmp/go-search-replace
  • chmod +x /tmp/go-search-replace
  • echo "You can do anything at https://zombo.com" | /tmp/go-search-replace "zombo.com" "wpvip.com"

Fixes #27

@jblz
Copy link
Member Author

jblz commented Feb 24, 2021

@joshbetz looks like go 1.16 shipped, but I couldn't get this working by just adding the arch. I tried splitting into a separate gox command, but no 🎲. Any ideas?

@jblz jblz requested review from joshbetz and a team February 24, 2021 16:48
@jblz jblz self-assigned this Feb 24, 2021
@jblz jblz changed the title Add Apple M1 Build Arch Add Apple M1 Build Arch (& other arm64) Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for Apple M1 chips
2 participants