Skip to content

Commit 0b62dce

Browse files
build: downgrade multiarch to Ubuntu 20.04 and consolidate images (grpc#12830)
Downgrades the multiarch build environment from Ubuntu 24.04 to 20.04. This ensures that native artifacts for aarch64 and ppc64le are linked against glibc 2.31, providing better compatibility with older but still-supported distributions (like RHEL 8 and Ubuntu 20.04). Additionally, this consolidates s390x cross-compilation into the multiarch image, removing the need for a separate ubuntu2004 base image. - Update Dockerfile.multiarch.base to use ubuntu:20.04 - Add g++-s390x-linux-gnu to multiarch image - Update linux_artifacts.sh to use multiarch for all cross-builds - Remove references to Dockerfile.ubuntu2004.base in build scripts Summary of what this commit achieves: 1. Improves Compatibility: Lowering the glibc requirement from 2.39 (Ubuntu 24.04) to 2.31 (Ubuntu 20.04) prevents "version `GLIBC_2.XX' not found" errors when users try to run the artifacts on older systems. 2. Simplifies CI: Merges the s390x toolchain into the multiarch image, reducing the number of Docker images the project needs to build and maintain. 3. Implements stopgap: Directly implements the choice of Ubuntu 20.04 suggested as a safer stopgap for the build. Fixes grpc#12797.
1 parent 28a8320 commit 0b62dce

4 files changed

Lines changed: 4 additions & 28 deletions

File tree

buildscripts/build_docker.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ set -eu -o pipefail
44
readonly buildscripts_dir="$(dirname "$(readlink -f "$0")")"
55
docker build -t grpc-java-artifacts-x86 "$buildscripts_dir"/grpc-java-artifacts
66
docker build -t grpc-java-artifacts-multiarch -f "$buildscripts_dir"/grpc-java-artifacts/Dockerfile.multiarch.base "$buildscripts_dir"/grpc-java-artifacts
7-
docker build -t grpc-java-artifacts-ubuntu2004 -f "$buildscripts_dir"/grpc-java-artifacts/Dockerfile.ubuntu2004.base "$buildscripts_dir"/grpc-java-artifacts
87

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
FROM ubuntu:24.04
2-
3-
# Redirect to the internal mirror to bypass the Kokoro network block
4-
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirror.bazel.build/archive.ubuntu.com/ubuntu/|g' /etc/apt/sources.list
1+
FROM ubuntu:20.04
52

63
RUN export DEBIAN_FRONTEND=noninteractive && \
74
apt-get update && \
@@ -12,8 +9,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
129
curl \
1310
g++-aarch64-linux-gnu \
1411
g++-powerpc64le-linux-gnu \
12+
g++-s390x-linux-gnu \
1513
openjdk-11-jdk \
16-
pkgconf \
14+
pkg-config \
1715
&& \
1816
rm -rf /var/lib/apt/lists/*
1917

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

Lines changed: 0 additions & 19 deletions
This file was deleted.

buildscripts/kokoro/linux_artifacts.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@ trap spongify_logs EXIT
1717
SKIP_TESTS=true ARCH=aarch_64 /grpc-java/buildscripts/kokoro/unix.sh
1818
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-multiarch env \
1919
SKIP_TESTS=true ARCH=ppcle_64 /grpc-java/buildscripts/kokoro/unix.sh
20-
# Use a newer GCC version. GCC 7 in multiarch has a bug:
21-
# internal compiler error: output_operand: invalid %-code
22-
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-ubuntu2004 env \
20+
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-multiarch env \
2321
SKIP_TESTS=true ARCH=s390_64 /grpc-java/buildscripts/kokoro/unix.sh

0 commit comments

Comments
 (0)