From 727474360ed1588f7a7c8f4c7db8d34404e46111 Mon Sep 17 00:00:00 2001 From: Dingli Zhang Date: Mon, 27 Oct 2025 06:22:36 +0000 Subject: [PATCH] Fix build error of protoc-gen-grpc-java --- spark.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/spark.spec b/spark.spec index b8916d2..724c7d6 100644 --- a/spark.spec +++ b/spark.spec @@ -4,7 +4,7 @@ Summary: A unified analytics engine for large-scale data processing. Name: spark Version: 3.5.0 -Release: 6 +Release: 7 License: Apache 2.0 URL: http://spark.apache.org/ Source0: https://github.com/apache/spark/archive/v%{version}.tar.gz @@ -25,13 +25,18 @@ Patch1003: 1003-Added-support-for-building-the-loongarch64-protoc-bi.patch Patch1004: 1004-Add-protoc-java-support-for-loongarch64.patch Patch1005: 1005-Added-support-for-building-the-loongarch64-protoc-ge.patch +BuildRequires: git maven %ifarch riscv64 loongarch64 BuildRequires: protobuf-devel protobuf-compiler BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static gcc-c++ %endif -BuildRequires: java-1.8.0-openjdk-devel git maven - +%ifarch riscv64 +BuildRequires: java-11-openjdk-devel +Requires: java-11-openjdk +%else +BuildRequires: java-1.8.0-openjdk-devel Requires: java-1.8.0-openjdk +%endif ExclusiveArch: x86_64 aarch64 ppc64le riscv64 loongarch64 @@ -47,12 +52,14 @@ Apache Spark achieves high performance for both batch and streaming data, using %ifarch riscv64 loongarch64 mkdir -p %{_builddir}/%{name}-%{version}/%{name}-prep_dir export PROTOC_VERSION="3."$(protoc --version | awk '{print $NF}') +pushd %{_builddir} %ifarch riscv64 mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=/usr/bin/protoc %endif %ifarch loongarch64 mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc %endif +popd # protoc tar -mxf %{SOURCE1} -C %{_builddir}/%{name}-%{version}/%{name}-prep_dir pushd %{_builddir}/%{name}-%{version}/%{name}-prep_dir/protobuf-3.21.7 @@ -94,6 +101,7 @@ pushd %{_builddir}/%{name}-%{version}/%{name}-prep_dir/grpc-java-1.56.0 sed -i "s,@HOME@,${HOME},g" build.gradle sed -i 's|https\\://services.gradle.org/distributions|file://%{_tmppath}/source|g' gradle/wrapper/gradle-wrapper.properties %ifarch riscv64 +export JAVA_HOME=%{_jvmdir}/java-11-openjdk SKIP_TESTS=true ARCH=riscv64 ./buildscripts/kokoro/unix.sh mvn install:install-file -DgroupId=io.grpc -DartifactId=protoc-gen-grpc-java -Dversion=1.56.0 -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=mvn-artifacts/io/grpc/protoc-gen-grpc-java/1.56.0/protoc-gen-grpc-java-1.56.0-linux-riscv64.exe %endif @@ -113,6 +121,7 @@ sed -i -e 's/3.23.4/'${PROTOC_VERSION}/'' po %build %ifarch riscv64 export MAVEN_OPTS="-Xms2048M -Xmx8000M" +export JAVA_HOME=%{_jvmdir}/java-11-openjdk %endif ./dev/make-distribution.sh --mvn mvn --name spark-3.5.0 --tgz -DskipTests -Dmaven.test.skip=true @@ -125,6 +134,10 @@ cp -rf ../%{name}-%{version} %{buildroot}/opt/apache-%{name}-%{version} %changelog +* Mon Oct 27 2025 Dingli Zhang - 3.5.0-7 +- Fix build error of protoc-gen-grpc-java +- Use jdk11 to build on riscv64 + * Wed Oct 15 2025 Wenlong Zhang - 3.5.0-6 - fix build error on loongarch64 -- Gitee