Skip to content

Commit a0fb73e

Browse files
committed
Fix grpc build
1 parent 87a27a2 commit a0fb73e

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

lib/go/Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ $(PROTOC_GEN_GO):
6969
go build -o "$@" $(PROTOC_GEN_GO_PKG)
7070

7171

72+
########################################################################
73+
## GRPC-GO-PKG ##
74+
########################################################################
75+
76+
# This is the recipe for getting and installing the grpc-go
77+
GRPC_GO_PKG := github.com/grpc/grpc-go
78+
GRPC_INSTALL_GO := grpc-go
79+
$(GRPC_INSTALL_GO): GRPC_PKG := $(dir $(GRPC_GO_PKG))
80+
$(GRPC_INSTALL_GO): GRPC_VERSION := v1.29.1
81+
$(GRPC_INSTALL_GO):
82+
mkdir -p $(dir $(GOPATH)/src/$(GRPC_PKG))
83+
test -d $(GOPATH)/src/$(GRPC_PKG)/.git || git clone https://$(GRPC_GO_PKG) $(GOPATH)/src/$(GRPC_PKG)
84+
(cd $(GOPATH)/src/$(GRPC_PKG) && \
85+
(test "$$(git describe --tags | head -1)" = "$(GRPC_VERSION)" || \
86+
(git fetch && git checkout tags/$(GRPC_VERSION))))
87+
(cd $(GOPATH)/src/$(GRPC_PKG) && go get -v -d $$(go list -f '{{ .ImportPath }}' ./...))
88+
89+
7290
########################################################################
7391
## PATH ##
7492
########################################################################
@@ -119,7 +137,7 @@ endif
119137
# 1. Go get any missing dependencies.
120138
# 2. Cache the packages.
121139
# 3. Build the archive file.
122-
$(CSI_A): $(CSI_GO)
140+
$(CSI_A): $(CSI_GO) $(GRPC_INSTALL_GO)
123141
go get -v -d ./...
124142
go install ./$(CSI_PKG_SUB)
125143
go build -o "$@" ./$(CSI_PKG_SUB)
@@ -133,4 +151,4 @@ clean:
133151
clobber: clean
134152
rm -fr "$(PROTOC)" "$(PROTOC_GEN_GO)" "$(CSI_PKG_SUB)"
135153

136-
.PHONY: clean clobber
154+
.PHONY: clean clobber $(GRPC_INSTALL_GO)

0 commit comments

Comments
 (0)