Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildscripts/grpc-java-artifacts/Dockerfile.multiarch.base
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
curl \
g++-aarch64-linux-gnu \
g++-powerpc64le-linux-gnu \
g++-riscv64-linux-gnu \
openjdk-8-jdk \
pkg-config \
&& \
Expand Down
2 changes: 2 additions & 0 deletions buildscripts/kokoro/linux_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ trap spongify_logs EXIT
# internal compiler error: output_operand: invalid %-code
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-ubuntu2004 env \
SKIP_TESTS=true ARCH=s390_64 /grpc-java/buildscripts/kokoro/unix.sh
"$GRPC_JAVA_DIR"/buildscripts/run_in_docker.sh grpc-java-artifacts-multiarch env \
SKIP_TESTS=true ARCH=riscv64 /grpc-java/buildscripts/kokoro/unix.sh
4 changes: 3 additions & 1 deletion buildscripts/kokoro/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# ARCH=ppcle_64 ./buildscripts/kokoro/unix.sh
# For s390x arch:
# ARCH=s390_64 ./buildscripts/kokoro/unix.sh
# For riscv64 arch:
# ARCH=riscv_64 ./buildscripts/kokoro/unix.sh

# This script assumes `set -e`. Removing it may lead to undefined behavior.
set -exu -o pipefail
Expand Down Expand Up @@ -89,7 +91,7 @@ fi
LOCAL_MVN_TEMP=$(mktemp -d)
# Note that this disables parallel=true from GRADLE_FLAGS
if [[ -z "${ALL_ARTIFACTS:-}" ]]; then
if [[ "$ARCH" = "aarch_64" || "$ARCH" = "ppcle_64" || "$ARCH" = "s390_64" ]]; then
if [[ "$ARCH" = "aarch_64" || "$ARCH" = "ppcle_64" || "$ARCH" = "s390_64" || "$ARCH" = "riscv64" ]]; then
GRADLE_FLAGS+=" -x grpc-compiler:generateTestProto -x grpc-compiler:generateTestLiteProto"
GRADLE_FLAGS+=" -x grpc-compiler:testGolden -x grpc-compiler:testLiteGolden"
GRADLE_FLAGS+=" -x grpc-compiler:testDeprecatedGolden -x grpc-compiler:testDeprecatedLiteGolden"
Expand Down
3 changes: 3 additions & 0 deletions buildscripts/kokoro/upload_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ LOCAL_OTHER_ARTIFACTS="$KOKORO_GFILE_DIR"/github/grpc-java/artifacts/
# for linux s390x platform
[[ "$(find "$LOCAL_MVN_ARTIFACTS" -type f -iname 'protoc-gen-grpc-java-*-linux-s390_64.exe' | wc -l)" != '0' ]]

# for linux riscv64 platform
[[ "$(find "$LOCAL_MVN_ARTIFACTS" -type f -iname 'protoc-gen-grpc-java-*-linux-riscv64.exe' | wc -l)" != '0' ]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AgraVator, FYI, the important part about the output file name is it matches what will be generated by os-maven-plugin, in particular "riscv64" here. It does match, so this looks good.


# from macos job:
[[ "$(find "$LOCAL_MVN_ARTIFACTS" -type f -iname 'protoc-gen-grpc-java-*-osx-x86_64.exe' | wc -l)" != '0' ]]
# copy all x86 artifacts to aarch until native artifacts are built
Expand Down
2 changes: 2 additions & 0 deletions buildscripts/make_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ else
GCC_ARCH=s390x-linux-gnu
elif [[ "$ARCH" == loongarch_64 ]]; then
GCC_ARCH=loongarch64-unknown-linux-gnu
elif [[ "$ARCH" == riscv* ]]; then
GCC_ARCH=riscv64-linux-gnu
else
echo "Unknown architecture: $ARCH"
exit 1
Expand Down
5 changes: 4 additions & 1 deletion compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ model {
linker.executable = 's390x-linux-gnu-g++'
}
target("loongarch_64")
target("riscv64")
}
clang(Clang) {
target("aarch_64") {}
Expand All @@ -76,6 +77,7 @@ model {
aarch_64 { architecture "aarch_64" }
s390_64 { architecture "s390_64" }
loongarch_64 { architecture "loongarch_64" }
riscv64 { architecture "riscv64" }
}

components {
Expand All @@ -86,7 +88,8 @@ model {
'ppcle_64',
'aarch_64',
's390_64',
'loongarch_64'
'loongarch_64',
'riscv64'
]) {
// If arch is not within the defined platforms, we do not specify the
// targetPlatform so that Gradle will choose what is appropriate.
Expand Down
4 changes: 4 additions & 0 deletions compiler/check-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ checkArch ()
assertEq "$format" "elf64-x86-64" $LINENO
elif [[ "$ARCH" == aarch_64 ]]; then
assertEq "$format" "elf64-little" $LINENO
elif [[ "$ARCH" == riscv64 ]]; then
assertEq "$format" "elf64-littleriscv" $LINENO
elif [[ "$ARCH" == loongarch_64 ]]; then
echo $format
assertEq "$format" "elf64-loongarch" $LINENO
Expand Down Expand Up @@ -121,6 +123,8 @@ checkDependencies ()
white_list="${white_list}\|libm\.so\.6"
elif [[ "$ARCH" == aarch_64 ]]; then
white_list="${white_list}\|ld-linux-aarch64\.so\.1"
elif [[ "$ARCH" == riscv64 ]]; then
white_list="libm\.so\.6\|libc\.so\.6\|ld-linux-riscv64-lp64d\.so\.1"
fi
elif [[ "$OS" == osx ]]; then
dump_cmd='otool -L '"$1"' | fgrep dylib'
Expand Down