Skip to content
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

Build Stripe CLI for ARM #608

Merged
merged 1 commit into from
Mar 15, 2021
Merged

Conversation

tomelm
Copy link
Contributor

@tomelm tomelm commented Mar 13, 2021

Reviewers

r? @suz-stripe @ob-stripe @tjfontaine-stripe
cc @stripe/developer-products

Summary

I know I know, I promised I wouldn't mess with GitHub Actions over the weekend, but ...while I was on my personal laptop I noticed that running brew update pulled the new Stripe CLI tap, but brew upgrade didn't actually upgrade the CLI to 1.5.10. Unfortunately, the updates we made changed how the homebrew tap was written and explicitly removed the ability to install on arm: stripe/homebrew-stripe-cli@bff31d1#diff-cefd878d3ffd3c6e0675e962b88aec27ffba0e756c569a9f9f72063fc46bb5fb

The conditional went from if OS.mac? to if OS.mac? && Hardware::CPU.intel?. I think goreleaser is trying to be smart here but I'm not sure how to not have it try to fork on intel vs arm.

This adds an arm64 build, which does add an #arm? branch: https://github.com/tomelm/homebrew-stripe-cli-temp/blob/main/stripe.rb#L11-L18. The one thing to note is that because we can't run GitHub Actions on macos11, I had to remove the CGO build environment variable, otherwise the build step fails saying it's an unsupported environment. golang1.16 supports building for arm64 natively and I don't think we have any explicit requirements for CGO on mac at the moment. I did a quick test locally and I think this should work fine:

stripe-cli on  tomer/arm-for-real via 🐹 v1.16.1
➜ echo $CGO


stripe-cli on  tomer/arm-for-real via 🐹 v1.16.1
➜ GOOS=darwin GOARCH=arm64 go build -o stripe cmd/stripe/main.go

stripe-cli on  tomer/arm-for-real via 🐹 v1.16.1
➜ ./stripe listen
> Ready! Your webhook signing secret is whsec_secrets (^C to quit)
2021-03-13 07:43:17   --> customer.created [evt_1IUZcXKylELWUK3AAUo5Xdh0]
^C

We don't need to merge this in right now but this will also fix stripe/homebrew-stripe-cli#1

@tomer-stripe tomer-stripe merged commit 0d46e56 into stripe:master Mar 15, 2021
@tomelm tomelm deleted the tomer/arm-for-real branch March 16, 2021 03:52
az777777 pushed a commit to az777777/stripe-cli that referenced this pull request Jun 22, 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.

Recipe misses M1 architecture
5 participants