Skip to content

Commit 8d8e03c

Browse files
committed
On multiarch arch64, it requires cmake 3.13 to allow using abseil module instead of as a package, and this version is not available to install. Hence building cmake from source. Building the latest source of cmake needs openssl location to be specified (or have openssl turned off) so using the older version 3.13.4
1 parent 5a3e3cc commit 8d8e03c

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

buildscripts/grpc-java-artifacts/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM almalinux:8
33
RUN yum install -y \
44
autoconf \
55
automake \
6-
cmake \
76
diffutils \
87
gcc-c++ \
98
glibc-devel \

buildscripts/grpc-java-artifacts/Dockerfile.multiarch.base

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
44
apt-get update && \
55
apt-get upgrade -y && \
66
apt-get install -y --no-install-recommends \
7-
cmake \
87
build-essential \
98
ca-certificates \
109
curl \

buildscripts/grpc-java-artifacts/Dockerfile.ubuntu2004.base

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
44
apt-get update && \
55
apt-get upgrade -y && \
66
apt-get install -y --no-install-recommends \
7-
cmake \
87
build-essential \
98
ca-certificates \
109
curl \

buildscripts/make_dependencies.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -evux -o pipefail
55

66
PROTOBUF_VERSION=22.5
77
ABSL_VERSION=20230125.4
8+
CMAKE_VERSION=3.13.4
89

910
# ARCH is x86_64 bit unless otherwise specified.
1011
ARCH="${ARCH:-x86_64}"
@@ -29,6 +30,16 @@ if [ -f ${INSTALL_DIR}/bin/protoc ]; then
2930
echo "Not building protobuf. Already built"
3031
# TODO(ejona): swap to `brew install --devel protobuf` once it is up-to-date
3132
else
33+
if [[ ! -d "cmake-${CMAKE_VERSION}" ]]; then
34+
curl -Ls "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz" | tar xz
35+
fi
36+
# the same source dir is used for 32 and 64 bit builds, so we need to clean stale data first
37+
rm -rf "$DOWNLOAD_DIR/cmake-${CMAKE_VERSION}/bin"
38+
cd "$DOWNLOAD_DIR/cmake-${CMAKE_VERSION}"
39+
./bootstrap
40+
make
41+
make install
42+
ln -s /usr/local/bin/cmake /usr/bin/cmake
3243
if [[ ! -d "protobuf-${PROTOBUF_VERSION}" ]]; then
3344
curl -Ls "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz" | tar xz
3445
curl -Ls "https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSL_VERSION}.tar.gz" | tar xz
@@ -60,7 +71,8 @@ else
6071
cmake .. \
6172
-DCMAKE_CXX_STANDARD=14 -Dprotobuf_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF \
6273
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -Dcrosscompile_ARCH="$GCC_ARCH" \
63-
-DCMAKE_TOOLCHAIN_FILE=$BUILDSCRIPTS_DIR/toolchain.cmake
74+
-DCMAKE_TOOLCHAIN_FILE=$BUILDSCRIPTS_DIR/toolchain.cmake \
75+
-B.
6476
fi
6577
export CMAKE_BUILD_PARALLEL_LEVEL="$NUM_CPU"
6678
cmake --build .

0 commit comments

Comments
 (0)