From c79f96d6ffe9498f4d19bc93faa360df5cc69323 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Fri, 17 Dec 2021 16:41:38 +0100 Subject: [PATCH] server/etcdmain: add build support for Apple M1 This has been additionally verified by running the tests locally as a basic smoke test. GitHub Actions doesn't provide MacOS M1 (arm64) yet, so there's no good way to automate testing. Ran `TMPDIR=/tmp make test` locally. The `TMPDIR` bit is needed so there's no really long path used that breaks Unix socket setup in one of the tests. Signed-off-by: Marek Siarkowicz --- .github/workflows/tests.yaml | 1 + scripts/build-binary | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8f337987a9f..f36f138c249 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -44,6 +44,7 @@ jobs: GOARCH=amd64 PASSES='build' ./test.sh GOARCH=386 PASSES='build' ./test.sh GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh + GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh diff --git a/scripts/build-binary b/scripts/build-binary index 6186424aa9e..b819a3e5757 100755 --- a/scripts/build-binary +++ b/scripts/build-binary @@ -79,6 +79,10 @@ function main { TARGET_ARCHS+=("s390x") fi + if [ ${GOOS} == "darwin" ]; then + TARGET_ARCHS+=("arm64") + fi + for TARGET_ARCH in "${TARGET_ARCHS[@]}"; do export GOARCH=${TARGET_ARCH}