Skip to content

Commit

Permalink
chore: upgrade protoc for osx aarch_64
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaost committed Sep 25, 2024
1 parent 1b9959b commit 6def118
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ go.work
go.work.sum

# Files produced by run.sh
*.bak
*.zip
kitex_gen/
kitex_gen_slim/
kitex_gen_noDefSerdes/
grpc_gen/
go.mod
go.sum
*.bak
bin
thrift_streaming/binaries
thrift_streaming/kitex_gen/
Expand Down
28 changes: 16 additions & 12 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ fi

set -x

PROTOC_OUT=$PWD/bin
PROTOC_VERSION=v3.13.0 # FIXME: this version doesn't support darwin arm64
PATH_BIN=$PWD/bin
mkdir -p $PATH_BIN

export PATH=$PATH_BIN:$PATH

# GOBIN need to be changed here as kitex-tests will install different version bin when testing,
# GOPATH remains the same as default,
# coz other runners in the same host may share path like GOMODCACHE, GOCACHE
export GOBIN=$PATH_BIN

PROTOC_VERSION=v3.20.2

install_protoc() {
echo "installing protoc ... "
Expand All @@ -39,8 +48,7 @@ install_protoc() {
rm -f $filename
wget -q $url || exit 1
unzip -o -q $filename -d ./tmp/
mkdir -p $PROTOC_OUT
mv ./tmp/bin/protoc $PROTOC_OUT
mv ./tmp/bin/protoc $PATH_BIN
rm -rf ./tmp/
echo "installing protoc ... done"
}
Expand All @@ -55,8 +63,6 @@ kitex_cmd() {
kitex --no-dependency-check $@
}

export PATH=$PROTOC_OUT:$PATH

echo -e "\ninstalling missing commands\n"

# install protoc
Expand Down Expand Up @@ -87,12 +93,10 @@ echo -e "\ninstalling missing commands ... done\n"

# double check commands,
# set -e may not working since commands run in background
which protoc
which protoc-gen-go
which protoc-gen-go-grpc
which thriftgo
which kitex

protoc --version
protoc-gen-go --version
protoc-gen-go-grpc --version
thriftgo --version
kitex -version

rm -f go.mod # go mod init fails if it already exists
Expand Down

0 comments on commit 6def118

Please sign in to comment.