Skip to content

Commit 3585213

Browse files
committed
buildscripts: Cross-compile in Docker
Previously builds were done with Ubuntu 16.04, and now we are using 18.04. Thus the generated binaries will no longer work for Ubuntu 16.04 and Debian 9 users, both of which are outside of their support window and aren't supported by Abseil. RHEL users are unaffected, as the binaries already didn't work on RHEL 7 and they will remain working with RHEL 8. FWIW, Ubuntu 18.04 will leave its support window in June.
1 parent 4fec5bb commit 3585213

File tree

5 files changed

+33
-35
lines changed

5 files changed

+33
-35
lines changed

buildscripts/build_docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ 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
78

buildscripts/build_s390x_artifacts_in_docker.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:18.04
22

3-
# make sure apt-get works in unattended mode
4-
ENV DEBIAN_FRONTEND=noninteractive
5-
6-
# install the OS-level prerequisites for building protobuf and running the gradle build
7-
RUN apt-get update && \
3+
RUN export DEBIAN_FRONTEND=noninteractive && \
4+
apt-get update && \
85
apt-get upgrade -y && \
9-
apt-get install -y --no-install-recommends ca-certificates build-essential wget curl openjdk-8-jdk && \
10-
apt-get autoclean -y && \
11-
apt-get autoremove -y && \
6+
apt-get install -y --no-install-recommends \
7+
build-essential \
8+
ca-certificates \
9+
curl \
10+
g++-aarch64-linux-gnu \
11+
g++-powerpc64le-linux-gnu \
12+
openjdk-8-jdk \
13+
&& \
1214
rm -rf /var/lib/apt/lists/*
13-
14-
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
15-
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:20.04
2+
3+
RUN export DEBIAN_FRONTEND=noninteractive && \
4+
apt-get update && \
5+
apt-get upgrade -y && \
6+
apt-get install -y --no-install-recommends \
7+
build-essential \
8+
ca-certificates \
9+
curl \
10+
g++-s390x-linux-gnu \
11+
openjdk-8-jdk \
12+
&& \
13+
rm -rf /var/lib/apt/lists/*

buildscripts/kokoro/linux_artifacts.sh

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,11 @@ readonly MVN_ARTIFACT_DIR="${MVN_ARTIFACT_DIR:-$GRPC_JAVA_DIR/mvn-artifacts}"
5252
mkdir -p "$MVN_ARTIFACT_DIR"
5353
cp -r "$LOCAL_MVN_TEMP"/* "$MVN_ARTIFACT_DIR"/
5454

55-
# for aarch64 platform
56-
sudo apt-get install -y g++-aarch64-linux-gnu
57-
SKIP_TESTS=true ARCH=aarch_64 "$GRPC_JAVA_DIR"/buildscripts/kokoro/unix.sh
58-
59-
# for ppc64le platform
60-
sudo apt-get install -y g++-powerpc64le-linux-gnu
61-
SKIP_TESTS=true ARCH=ppcle_64 "$GRPC_JAVA_DIR"/buildscripts/kokoro/unix.sh
62-
63-
# for s390x platform
64-
# building these artifacts inside a Docker container as we have specific requirements
65-
# for GCC (version 11.x needed) which in turn requires Ubuntu 22.04 LTS
66-
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-multiarch /grpc-java/buildscripts/build_s390x_artifacts_in_docker.sh
67-
55+
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-multiarch env \
56+
SKIP_TESTS=true ARCH=aarch_64 /grpc-java/buildscripts/kokoro/unix.sh
57+
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-multiarch env \
58+
SKIP_TESTS=true ARCH=ppcle_64 /grpc-java/buildscripts/kokoro/unix.sh
59+
# Use a newer GCC version. GCC 7 in multiarch has a bug:
60+
# internal compiler error: output_operand: invalid %-code
61+
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-ubuntu2004 env \
62+
SKIP_TESTS=true ARCH=s390_64 /grpc-java/buildscripts/kokoro/unix.sh

0 commit comments

Comments
 (0)