Skip to content

Commit

Permalink
server/etcdmain: add build support for Apple M1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dbussink committed Dec 17, 2021
1 parent 42840d0 commit ddb9554
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
- linux-amd64
- linux-386
- darwin-amd64
- darwin-arm64
- windows-amd64
- linux-arm
- linux-arm64
Expand All @@ -34,6 +35,9 @@ jobs:
darwin-amd64)
ARCH=amd64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh
;;
darwin-arm64)
ARCH=arm64 GOOS=darwin GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh
;;
windows-amd64)
ARCH=amd64 GOOS=windows GO_BUILD_FLAGS='-v -mod=readonly' ./build.sh
;;
Expand Down
4 changes: 4 additions & 0 deletions scripts/build-binary
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit ddb9554

Please sign in to comment.