grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

feat(proctoc): Adds support for building protoc-gen-grpc-java on the RISC-V platform and provides protoc-gen-grpc-java prebuilt binaries

Open zhanchangbao-sanechips opened this issue 4 months ago • 1 comments

Summary

This PR adds support for building protoc-gen-grpc-java on the RISC-V platform and provides prebuilt binaries, addressing the lack of official RISC-V support and prebuilts for protoc-gen-grpc-java.

Changes

Updated build scripts to detect and recognize riscv64 as a supported target platform. Extended architecture-specific logic in compiler/build.gradle and compiler/check-artifact.sh to include the riscv64 architecture, enabling proper compilation for RISC-V. Ensured all newly added code paths are conditionally compiled—this modification does not impact existing supported architectures (e.g., x86_64, ARM).

Motivation

RISC-V is an open, rapidly evolving CPU architecture with growing adoption. Prior to this PR: protoc-gen-grpc-java lacked official build support for RISC-V, leading to compilation failures when attempting to build natively or cross-compile for the platform. No protoc-gen-grpc-java prebuilt binaries for RISC-V exist in Maven Central Repository (https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/), which blocked direct use of protoc-gen-grpc-java prebuilts for Maven-based projects (e.g., Hadoop, Spark, and related plugins) on RISC-V. This PR resolves both gaps to unblock RISC-V adoption for protoc-gen-grpc-java dependent projects.

Testing

Successfully built protoc-gen-grpc-java natively on a Sophgo SG2042 RISC-V CPU running Linux. Used the RISC-V-built protoc-gen-grpc-java to compile Spark on riscv64 successfully.

Additional Notes protoc prebuilt binaries:https://github.com/zhanchangbao-sanechips/plugin-repo/protoc-gen-grpc-java-1.47.0-linux-riscv64.exe.

zhanchangbao-sanechips avatar Aug 21 '25 09:08 zhanchangbao-sanechips