Skip to content

Commit

Permalink
ci: precompiled protoc in utils/install-protoc.sh (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jul 14, 2024
1 parent bb2f2ec commit b8fcf52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion utils/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt-get update && \
RUN rustup component add rustfmt
# Install build dependency `protoc`.
COPY utils/install-protoc.sh /tmp
RUN CMAKE_INSTALL_PREFIX=/usr/local bash /tmp/install-protoc.sh
RUN PREFIX=/usr/local bash /tmp/install-protoc.sh

# Now for the two-step building.
#
Expand Down
22 changes: 8 additions & 14 deletions utils/install-protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
set -x
set -euo pipefail

CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX-$HOME/.local/share/protoc}
RELEASE=${RELEASE-27.2}
ARCH=${ARCH-linux-x86_64}
PREFIX=${PREFIX-$HOME/.local/share/protoc}

mkdir -p utils/var
cd utils/var
wget -O /tmp/protoc-${RELEASE}-${ARCH}.zip \
https://github.com/protocolbuffers/protobuf/releases/download/v${RELEASE}/protoc-${RELEASE}-${ARCH}.zip

apt-get update
apt-get install -y git cmake build-essential

if [[ ! -e protobuf ]]; then
git clone https://github.com/protocolbuffers/protobuf.git
fi
cd protobuf
git submodule update --init --recursive

cmake . -DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX
make -j 8 install
mkdir -p $PREFIX
cd $PREFIX
unzip /tmp/protoc-${RELEASE}-${ARCH}.zip

0 comments on commit b8fcf52

Please sign in to comment.