Skip to content

Commit 2d88c45

Browse files
scriptonisthasura-bot
authored andcommitted
cli: on m1 macs use darwin/amd64 builds in installation script
GitOrigin-RevId: 51078ad
1 parent 99ec0ae commit 2d88c45

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

cli/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ endif
2626
# get dependencies
2727
deps:
2828
go mod download
29-
ifndef HAS_GOX
30-
go get github.com/mitchellh/gox
31-
endif
3229

3330
# build cli locally, for all given platform/arch
3431
.PHONY: build
3532
build: export CGO_ENABLED=0
3633
build: copy-cli-ext
3734
build:
35+
ifndef HAS_GOX
36+
cd ~ && go get github.com/mitchellh/gox && cd -
37+
endif
3838
gox -ldflags '-X github.com/hasura/graphql-engine/cli/version.BuildVersion=$(VERSION) -X github.com/hasura/graphql-engine/cli/plugins.IndexBranchRef=$(PLUGINS_BRANCH) -s -w -extldflags "-static"' \
3939
-rebuild \
4040
-os="$(OS)" \

cli/get.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ arch='unknown'
7979
archstr=`uname -m`
8080
if [[ "$archstr" == 'x86_64' ]]; then
8181
arch='amd64'
82+
elif [[ "$archstr" == 'arm64' ]] && [[ "$platform" == 'darwin' ]]; then
83+
# use amd64 builds on M1 Macs
84+
# TODO: use native builds once it is avialable as release artifacts
85+
arch='amd64'
8286
else
83-
arch='386'
87+
die "prebuilt binaries for $(arch) architecture not avialable, please try building from source https://github.com/hasura/graphql-engine/blob/master/cli/README.md"
8488
fi
8589

8690
# some variables

0 commit comments

Comments
 (0)