Skip to content

Commit

Permalink
Bump protoc version for better compability with Apple Silicon (thanos…
Browse files Browse the repository at this point in the history
…-io#5666)

* Bump protoc to 3.20.1 from 3.4.0

Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>

* Adding changelog

Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>

* Improving scripts

Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>

* Remove entry from changelog

Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>

* Passing protoc version from Makefile to genproto script

Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>

Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>
Co-authored-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Signed-off-by: Prakul Jain <prakul.jain@udaan.com>
  • Loading branch information
2 people authored and prajain12 committed Sep 6, 2022
1 parent b257d16 commit 3e5a9e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -63,7 +63,7 @@ ARCH ?= $(shell uname -m)

# Tools.
PROTOC ?= $(GOBIN)/protoc-$(PROTOC_VERSION)
PROTOC_VERSION ?= 3.4.0
PROTOC_VERSION ?= 3.20.1
GIT ?= $(shell which git)

# Support gsed on OSX (installed via brew), falling back to sed. On Linux
Expand Down Expand Up @@ -289,7 +289,7 @@ go-format: $(GOIMPORTS)
.PHONY: proto
proto: ## Generates Go files from Thanos proto files.
proto: check-git $(GOIMPORTS) $(PROTOC) $(PROTOC_GEN_GOGOFAST)
@GOIMPORTS_BIN="$(GOIMPORTS)" PROTOC_BIN="$(PROTOC)" PROTOC_GEN_GOGOFAST_BIN="$(PROTOC_GEN_GOGOFAST)" scripts/genproto.sh
@GOIMPORTS_BIN="$(GOIMPORTS)" PROTOC_BIN="$(PROTOC)" PROTOC_GEN_GOGOFAST_BIN="$(PROTOC_GEN_GOGOFAST)" PROTOC_VERSION="$(PROTOC_VERSION)" scripts/genproto.sh

.PHONY: tarballs-release
tarballs-release: ## Build tarballs.
Expand Down
5 changes: 3 additions & 2 deletions scripts/genproto.sh
Expand Up @@ -5,6 +5,7 @@
set -e
set -u

PROTOC_VERSION=${PROTOC_VERSION:-3.20.1}
PROTOC_BIN=${PROTOC_BIN:-protoc}
GOIMPORTS_BIN=${GOIMPORTS_BIN:-goimports}
PROTOC_GEN_GOGOFAST_BIN=${PROTOC_GEN_GOGOFAST_BIN:-protoc-gen-gogofast}
Expand All @@ -14,8 +15,8 @@ if ! [[ "scripts/genproto.sh" =~ $0 ]]; then
exit 255
fi

if ! [[ $(${PROTOC_BIN} --version) == *"3.4.0"* ]]; then
echo "could not find protoc 3.4.0, is it installed + in PATH?"
if ! [[ $(${PROTOC_BIN} --version) == *"${PROTOC_VERSION}"* ]]; then
echo "could not find protoc ${PROTOC_VERSION}, is it installed + in PATH?"
exit 255
fi

Expand Down
3 changes: 2 additions & 1 deletion scripts/installprotoc.sh
Expand Up @@ -4,7 +4,7 @@
set -e
set -u

PROTOC_VERSION=${PROTOC_VERSION:-3.4.0}
PROTOC_VERSION=${PROTOC_VERSION:-3.20.1}
TMP_GOPATH=${TMP_GOPATH:-/tmp/thanos-go}
PROTOC_DOWNLOAD_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}"

Expand All @@ -16,6 +16,7 @@ is_supported_platform() {
platform=$1
found=1
case "$platform" in
darwin/arm64) found=0 ;;
darwin/amd64) found=0 ;;
darwin/i386) found=0 ;;
linux/amd64) found=0 ;;
Expand Down

0 comments on commit 3e5a9e7

Please sign in to comment.