This commit is contained in:
Josh Humphries 2023-04-18 11:40:06 -04:00
parent e9c5d2433c
commit ad8115c327
2 changed files with 8 additions and 3 deletions

View File

@ -2,6 +2,8 @@ dev_build_version=$(shell git describe --tags --always --dirty)
export PATH := $(shell pwd)/.tmp/protoc/bin:$(PATH)
export PROTOC_VERSION := 22.0
# TODO: run golint and errcheck, but only to catch *new* violations and
# decide whether to change code or not (e.g. we need to be able to whitelist
# violations already in the code). They can be useful to catch errors, but
@ -88,6 +90,6 @@ errcheck:
test:
go test -race ./...
.tmp/protoc/bin/protoc:
.tmp/protoc/bin/protoc: ./Makefile ./download_protoc.sh
./download_protoc.sh

View File

@ -4,7 +4,10 @@ set -e
cd $(dirname $0)
PROTOC_VERSION="22.0"
if [[ -z "$PROTOC_VERSION" ]]; then
echo "Set PROTOC_VERSION env var to indicate the version to download" >&2
exit 1
fi
PROTOC_OS="$(uname -s)"
PROTOC_ARCH="$(uname -m)"
case "${PROTOC_OS}" in
@ -27,6 +30,6 @@ if [[ "$(${PROTOC} --version 2>/dev/null)" != "libprotoc 3.${PROTOC_VERSION}" ]]
rm -rf ./.tmp/protoc
mkdir -p .tmp/protoc
curl -L "https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${PROTOC_OS}-${PROTOC_ARCH}.zip" > .tmp/protoc/protoc.zip
cd ./.tmp/protoc && unzip protoc.zip && cd ..
pushd ./.tmp/protoc && unzip protoc.zip && popd
fi