From 31ca7a080daef04224e9e9a17ac1be95cb7f1daa Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Thu, 19 Apr 2018 15:26:55 +0800 Subject: [PATCH] Golang dep tool workaround on AArch64 Currently there's no official `dep` tool release for arm64, so we use `go get -u github.com/golang/dep/cmd/dep` command instead of `curl` official release to workaround this issue, order to support native build on arm64 server. Will remove this once official arm64 release of `dep` announced. Signed-off-by: Dennis Chen --- build/makelib/golang.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/makelib/golang.mk b/build/makelib/golang.mk index 66102e237..d8a8b3bc9 100644 --- a/build/makelib/golang.mk +++ b/build/makelib/golang.mk @@ -172,9 +172,15 @@ go.vendor: $(DEP) $(DEP): @echo === installing dep - @mkdir -p $(TOOLS_HOST_DIR) - @curl -sL -o $(DEP) https://github.com/golang/dep/releases/download/$(DEP_VERSION)/dep-$(GOHOSTOS)-$(GOHOSTARCH) + @mkdir -p $(TOOLS_HOST_DIR)/tmp + @if [ "$(GOHOSTARCH)" = "arm64" ]; then\ + GOPATH=$(TOOLS_HOST_DIR)/tmp GOBIN=$(TOOLS_HOST_DIR) $(GOHOST) get -u github.com/golang/dep/cmd/dep;\ + mv $(TOOLS_HOST_DIR)/dep $@;\ + else \ + curl -sL -o $(DEP) https://github.com/golang/dep/releases/download/$(DEP_VERSION)/dep-$(GOHOSTOS)-$(GOHOSTARCH);\ + fi @chmod +x $(DEP) + @rm -fr $(TOOLS_HOST_DIR)/tmp $(GOLINT): @echo === installing golint