From 81ec5668cc9bbd87abdeaf18c1e20b41cb283a46 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Wed, 19 Aug 2020 16:30:48 +0200 Subject: [PATCH] fix proto tools (#7090) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix proto tools * go get * fix proto-tools Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk --- Makefile | 3 --- contrib/devtools/Makefile | 30 +++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index dc2e68c58f..a29af33b6c 100644 --- a/Makefile +++ b/Makefile @@ -385,9 +385,6 @@ proto-update-deps: ## Issue link: https://github.com/confio/ics23/issues/32 @sed -i '4ioption go_package = "github.com/confio/ics23/go";' $(CONFIO_TYPES)/proofs.proto - - - .PHONY: proto-all proto-gen proto-lint proto-check-breaking proto-update-deps ############################################################################### diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile index d9b73a6549..74e315d7de 100644 --- a/contrib/devtools/Makefile +++ b/contrib/devtools/Makefile @@ -77,31 +77,43 @@ $(RUNSIM): @echo "Installing runsim..." @(cd /tmp && go get github.com/cosmos/tools/cmd/runsim@v1.0.0) -PROTOC_VERSION ?= 3.11.2 +PROTOC_VERSION ?= 3.13.0 +PROTOC_GRPC_GATEWAY_VERSION = 1.14.7 ifeq ($(UNAME_S),Linux) - PROTOC_ZIP ?= protoc-3.11.2-linux-x86_64.zip + PROTOC_ZIP ?= protoc-3.13.0-linux-x86_64.zip + PROTOC_GRPC_GATEWAY_BIN ?= protoc-gen-grpc-gateway-v1.14.7-linux-x86_64 endif ifeq ($(UNAME_S),Darwin) - PROTOC_ZIP ?= protoc-3.11.2-osx-x86_64.zip + PROTOC_ZIP ?= protoc-3.13.0-osx-x86_64.zip + PROTOC_GRPC_GATEWAY_BIN ?= protoc-gen-grpc-gateway-v1.14.7-darwin-x86_64 endif -proto-tools: proto-tools-stamp buf - -proto-tools-stamp: +proto-tools: buf +ifeq (, $(shell which protoc)) @echo "Installing protoc compiler..." @(cd /tmp; \ curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"; \ unzip -o ${PROTOC_ZIP} -d $(PREFIX) bin/protoc; \ unzip -o ${PROTOC_ZIP} -d $(PREFIX) 'include/*'; \ rm -f ${PROTOC_ZIP}) +else + @echo "protoc already installed; skipping..." +endif +ifeq (, $(shell which protoc-gen-gocosmos)) @echo "Installing protoc-gen-gocosmos..." @go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos +else + @echo "protoc-gen-gocosmos already installed; skipping..." +endif +ifeq (, $(shell which protoc-gen-grpc-gateway)) @echo "Installing protoc-gen-grpc-gateway..." - @go install https://github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway - - touch $@ + @curl -o "${BIN}/protoc-gen-grpc-gateway" -L "https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${PROTOC_GRPC_GATEWAY_VERSION}/${PROTOC_GRPC_GATEWAY_BIN}" + @chmod +x "${BIN}/protoc-gen-grpc-gateway" +else + @echo "protoc-gen-grpc-gateway already installed; skipping..." +endif buf: buf-stamp