Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aranjans committed Apr 11, 2024
1 parent 4af26f8 commit e578b4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions scripts/protoc_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Install protoc
PROTOC_VERSION="25.2"

# Function to download pre-built binaries for Linux
# Function to download pre-built binaries for Linux with
# ARCH as $1, OS as $2, and WORKDIR as $3 arguments.
download_binary() {
# Download URL (adjust if a newer release is available)
DOWNLOAD_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-$2-$1.zip"
Expand All @@ -13,7 +14,8 @@ download_binary() {
rm "protoc-${PROTOC_VERSION}-$2-$1.zip"
}

download_protoc() {
# Function to install protoc with WORKDIR as argument
install_protoc() {
# Determine architecture
if [[ $(uname -m) == "x86_64" ]]; then
ARCH="x86_64"
Expand Down
5 changes: 2 additions & 3 deletions scripts/regenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function finish {
}
trap finish EXIT

export GOBIN="${WORKDIR}"/bin
GOBIN="${WORKDIR}"/bin
export PATH="${GOBIN}:${PATH}"
mkdir -p "${GOBIN}"

Expand All @@ -49,7 +49,7 @@ echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google
curl --silent https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto > "${WORKDIR}/googleapis/google/rpc/code.proto"

source ./scripts/protoc_installer.sh
download_protoc $WORKDIR
install_protoc $WORKDIR

mkdir -p "${WORKDIR}/out"

Expand Down Expand Up @@ -83,7 +83,6 @@ SOURCES=(
# Note that the protos listed here are all for testing purposes. All protos to
# be used externally should have a go_package option (and they don't need to be
# listed here).
# listed here).
OPTS=Mgrpc/core/stats.proto=google.golang.org/grpc/interop/grpc_testing/core,\
Mgrpc/testing/benchmark_service.proto=google.golang.org/grpc/interop/grpc_testing,\
Mgrpc/testing/stats.proto=google.golang.org/grpc/interop/grpc_testing,\
Expand Down
2 changes: 1 addition & 1 deletion scripts/vet-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [[ "$1" = "-install" ]]; then
popd
elif [[ -z "${VET_SKIP_PROTO}" ]]; then
source ./scripts/protoc_installer.sh
download_protoc
install_protoc
protoc --version
else
# TODO: replace with install protoc when https://github.com/grpc/grpc-go/pull/7064 is merged.
Expand Down

0 comments on commit e578b4d

Please sign in to comment.