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

Support Builds for ARM M1 Macs #477

Merged
merged 4 commits into from
Sep 2, 2021
Merged

Support Builds for ARM M1 Macs #477

merged 4 commits into from
Sep 2, 2021

Conversation

cfstras
Copy link
Contributor

@cfstras cfstras commented Aug 18, 2021

Summary

This PR adds build targets to the makefile to support building for darwin/arm64, which is the architecture for Apples processors going forward from the M1.

It also adds support for the arch in the get-chartmuseum script, which will then attempt to download the version. As soon as the first version with this build is released, everybody can enjoy it :)

Also added .PHONY labels to the other build-* targets, to prevent make confusion when files called build-* exist.

Testing

Successfully tested on an M1 MBP, macOS 11.5.2.

Caveat

Unfortunately, there is a cosmetic error message at the start coming from containerd, because it tries to call getCPUInfo() on every ARM arch:

ERRO[0000] failure getting variant                       error="getCPUInfo for OS darwin: not implemented"

See https://github.com/containerd/containerd/blob/v1.3.4/platforms/cpuinfo.go#L77-L93.

The bug is already fixed since 1.4.0 of containerd/containerd: containerd/containerd@7119a2a, but indirect dependencies still pull in old versions.

@cfstras cfstras changed the title chore: add build-mac-arm target to makefile Support Builds for ARM M1 Macs Aug 18, 2021
@scbizu
Copy link
Contributor

scbizu commented Aug 31, 2021

Good job , could you pass the DCO verification ?

Claus Strasburger and others added 4 commits August 31, 2021 18:18
Signed-off-by: Claus Strasburger <c@cfs.im>
Signed-off-by: Claus Strasburger <c@cfs.im>
Signed-off-by: Claus Strasburger <c@cfs.im>
Signed-off-by: Claus Strasburger <c@cfs.im>
@cfstras
Copy link
Contributor Author

cfstras commented Aug 31, 2021

@scbizu Should be good to go now :)

@scbizu
Copy link
Contributor

scbizu commented Sep 1, 2021

The containerd dependency is from the helm dependency though ...

However , we can not bump our helm dependency to the latest version due to one potential break change .

And so , this PR may should be merged after we fixed the caveat ?

(After v0.14.0 , we need to deprecate the invalid semantic version by default and bump our Helm dependency to the latest and then we can also bump the containerd dependency to fix the caveat).

@scbizu scbizu added this to the v0.14.0 milestone Sep 1, 2021
@cfstras
Copy link
Contributor Author

cfstras commented Sep 1, 2021

I don't you need hold this back -- as mentioned, the error message is purely cosmetic, and has no implications on chartmuseum itself (apart from being slightly annoying).

Being able to build this on M1 with a weird log entry is better than not being able to run it at all ;)

@scbizu
Copy link
Contributor

scbizu commented Sep 2, 2021

Sounds right , I can merge this in and it (the weird error message ) will disappear after we bump the containerd dependency , right ?

@cfstras
Copy link
Contributor Author

cfstras commented Sep 2, 2021

Correct, that should be the case.

(noticed that the build failed though, it looks like helm does not live at https://storage.googleapis.com/kubernetes-helm/ anymore, but here: https://github.com/helm/helm/releases/tag/v2.17.0)

@scbizu
Copy link
Contributor

scbizu commented Sep 2, 2021

Thank you , I will merge it and then fix the CI 😆

@scbizu scbizu merged commit 0c7164e into helm:main Sep 2, 2021
@cfstras cfstras deleted the feature/arm-m1-build branch September 4, 2021 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants