-
Notifications
You must be signed in to change notification settings - Fork 376
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
Makefile: add native build support for arm64 MacOS #2258
Conversation
On MacOS `uname -m` returns `arm64` whereas on Linux it returns `aarch64`. Fixes cilium#2257 Signed-off-by: Filip Nikolic <oss.filipn@gmail.com>
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
hey, I see that but I don't think you can build tetragon on macOS (because some pkg don't build on darwin) and we want to do that? Are you trying to cross build Linux Tetragon on macOS? If yes why don't you build on Linux directly? |
Essentially what is happening is that the Makefile is being evaluated on MacOS but the build itself can then happen elsewhere. Now an alternative may be to do everything on Linux immediately so that the target is rightfully evaluated when executing Therefore a common pattern on MacOS is to have a local lightweight Linux VM and exposing the docker socket to MacOS host so that one can "natively" use docker commands on MacOS. The proposed change does not break anything for existing users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep okay why not! I'm thinking by the way that it would be a good change to write it with if/else statements:
ifeq ($(UNAME_M),x86_64)
TARGET_ARCH ?= amd64
else ifeq ($(UNAME_M),aarch64)
TARGET_ARCH ?= arm64
else ifeq ($(UNAME_M),arm64)
TARGET_ARCH ?= arm64
else
TARGET_ARCH ?= amd64
endif
If that can help you, let's merge this! |
On MacOS
uname -m
returnsarm64
whereas on Linux it returnsaarch64
.Fixes #2257