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 and Release for Mac Arm64 architecture #1030

Merged
merged 4 commits into from
Feb 1, 2021

Conversation

dfreilich
Copy link
Member

@dfreilich dfreilich commented Jan 22, 2021

Summary

This is a WIP, to construct pack for multiple other architectures. Specifically for linux and Mac arm64, and for armv7.
After investigating, I put linux arm64 and arm7 on hold, due to requiring changes in the lifecycle. Mac M1, on the other hand, can successfully build applications, albeit slowly (due to the lifecycle not having a matching release). As such, this PR builds a Mac Arm64 binary and adds it to our releases. Further, it adds it to our Homebrew tap.

Documentation

  • Should this change be documented?
    • Yes, see #___

Related

Resolves #1003

@github-actions github-actions bot added this to the 0.17.0 milestone Jan 22, 2021
@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Jan 22, 2021
@dfreilich
Copy link
Member Author

I haven't added in any functionality to build for darwin yet, I'm going to investigate and add that on Monday.

@dfreilich
Copy link
Member Author

After examining the problem more, we're blocked on adding support for Arm by buildpacks/lifecycle#435. I'll refocus this on adding support for Mac M1.

@dfreilich dfreilich changed the title Build for additional archs Build and Release for Mac Arm64 architecture Jan 27, 2021
@dfreilich dfreilich marked this pull request as ready for review January 27, 2021 18:57
@dfreilich dfreilich requested a review from a team as a code owner January 27, 2021 18:57
This is a WIP, to construct pack for multiple other architectures. Specifically for linux and Mac arm64, and for armv7.

Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
@@ -98,10 +98,37 @@ jobs:
with:
name: pack-${{ matrix.os }}
path: out/${{ env.PACK_BIN }}
release:
build-additional-archs:
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figure that it only really makes sense to do if this is a release branch, though happy to make it happen regardless so we can always check the binary and make sure it works

Comment on lines +103 to +109
strategy:
fail-fast: false
matrix:
include:
- goarch: arm64
goos: darwin
name: macos-arm64
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be more than we need now, but I was planning this for expanding eventually to different arm architectures

@@ -5,7 +5,10 @@
class Pack < Formula
desc "A CLI for building apps using Cloud Native Buildpacks"
homepage "https://github.com/buildpacks/pack"
if OS.mac?
if OS.mac? && Hardware::CPU.arm?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was based off how openJDK added Mac ARM support: Homebrew/homebrew-core#68946

@dwillist dwillist changed the base branch from main to release/0.17.0-rc1 January 28, 2021 19:12
@dfreilich dfreilich merged commit 1277823 into release/0.17.0-rc1 Feb 1, 2021
@dfreilich dfreilich deleted the add-goarchs branch February 1, 2021 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/chore Issue that requests non-user facing changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apple Silicon Support
2 participants