carvel-dev / carvel

Carvel provides a set of reliable, single-purpose, composable tools that aid in your application building, configuration, and deployment to Kubernetes. This repo contains information regarding the Carvel open-source community.
https://carvel.dev/
Apache License 2.0
369 stars 108 forks source link

Publish mac darwin compatible binaries #218

Open jayunit100 opened 2 years ago

jayunit100 commented 2 years ago

What steps did you take: on OS X, MacBook Air (M1, 2020)... big sur probably an easy fix, just need to support arm64 i think in the brew publication process?

GOOS=darwin GOARCH=arm64 go build -o  ...
brew install ytt kbld kapp imgpkg kwt vendir
==> Installing ytt from vmware-tanzu/carvel
==> Downloading https://github.com/vmware-tanzu/carvel-ytt/releases/download/v0.36.0/ytt-darwin-arm64
==> Downloading from https://github-releases.githubusercontent.com/173207060/7e47b79b-a02d-48f2-87b5-604

What happened: looks like the 64 intel brew is the only one supported?

######################################################################## 100.0%
🍺  /opt/homebrew/Cellar/ytt/v0.36.0: 3 files, 12.4MB, built in 2 seconds
==> Installing kbld from vmware-tanzu/carvel
kbld: The x86_64 architecture is required for this software.
Error: An unsatisfied requirement failed this build.

What did you expect: carvel would install on an m1 mac...


(edit: add summary of issues to implement this.)

Related work:

aaronshurley commented 2 years ago

Thanks for surfacing this. I think you're right and that all we'd have to do is update our homebrew formulas. Ideally, we'll automate this so it doesn't add ongoing toil. I created a couple of issues in that repo to address this work. For now, we can keep this issue open to increase visibility on this.

pivotaljohn commented 2 years ago

Also, the install script currently selects the AMD64-targeted version of our tools...

https://github.com/vmware-tanzu/carvel/blob/5e8da622826935aded946c4d4f53e38a3695de29/site/static/install.sh#L28-L36

Let's update that script as part of this work as well so that if you install on an M1, you get ARM64 binaries through all install paths.

100mik commented 2 years ago

Added a Apple Silicon-targeted version for our latest release. There is a PR updating our scripts to do this for future releases.

Made a PR to vmware-tanzu/homebrew-carvel updating the formula for kapp. Looks like vendir needs a similar change. Homebrew formulas for kbld, imgpkg and kwt seem to not check for amd64-targeted binaries at all, just like the install script. They should be updated once these binaries are available, they are not built as of now (for both Linux and Darwin).

DennisDenuto commented 2 years ago

imgpkg and kbld next release will generate a mac arm binary

See the below PRs for details imgpkg PR kbld PR

The next time an imgpkg or kbld release occurs, in addition to modifying the homebrew formula and install.sh with the new version and sha, a change to also include the mac arm binary will need to be made (similar to the PR made above by @100mik)

I'm not sure how to best capture this 'one-off' release step.

pivotaljohn commented 2 years ago

I'm not sure how to best capture this 'one-off' release step.

@DennisDenuto note the list of issues in the description ... there's one for each tool, respectively... is that a good place to capture the release step?

DennisDenuto commented 2 years ago

Yes I think so. However when a release is being performed (in the future), I think ultimately, the person conducting the release will need to remember to also make additional updates to the homebrew formula and install.sh (which are in separate repos).

vangie commented 1 year ago

brew install vmware-tanzu/carvel/kwt kwt: The x86_64 architecture is required for this software. Error: kwt: An unsatisfied requirement failed this build.

aaronshurley commented 1 year ago

Thanks, @vangie. We haven't yet updated kwt's build process but have an issue tracked here: https://github.com/vmware-tanzu/carvel-kwt/issues/28.

I'll drop a mention in our slack channel just so that folks are aware and in case someone has bandwidth to knock this out. As always, PRs are welcome :)