已开启
Fix build error of protoc-gen-grpc-java #75
Dingli Zhang创建于 2025年10月28日
Fix build error of protoc-gen-grpc-java #75
已开启
Dingli Zhang创建于 2025年10月28日
从refs/pull/75/head合入到openEuler-24.03-LTS-Next
共 1 个文件变更+16-3
@@ -4,7 +4,7 @@
4Summary: A unified analytics engine for large-scale data processing.4Summary: A unified analytics engine for large-scale data processing.
5Name: spark5Name: spark
6Version: 3.5.06Version: 3.5.0
7-Release: 67+Release: 7
8License: Apache 2.08License: Apache 2.0
9URL: http://spark.apache.org/9URL: http://spark.apache.org/
10Source0: https://github.com/apache/spark/archive/v%{version}.tar.gz10Source0: 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
25Patch1004: 1004-Add-protoc-java-support-for-loongarch64.patch25Patch1004: 1004-Add-protoc-java-support-for-loongarch64.patch
26Patch1005: 1005-Added-support-for-building-the-loongarch64-protoc-ge.patch26Patch1005: 1005-Added-support-for-building-the-loongarch64-protoc-ge.patch
27 27 
28+BuildRequires: git maven
28%ifarch riscv64 loongarch6429%ifarch riscv64 loongarch64
29BuildRequires: protobuf-devel protobuf-compiler30BuildRequires: protobuf-devel protobuf-compiler
30BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static gcc-c++31BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static gcc-c++
31%endif32%endif
32-BuildRequires: java-1.8.0-openjdk-devel git maven33+%ifarch riscv64
33- 34+BuildRequires: java-11-openjdk-devel
35+Requires: java-11-openjdk
36+%else
37+BuildRequires: java-1.8.0-openjdk-devel
34Requires: java-1.8.0-openjdk38Requires: java-1.8.0-openjdk
39+%endif
35 40 
36ExclusiveArch: x86_64 aarch64 ppc64le riscv64 loongarch6441ExclusiveArch: x86_64 aarch64 ppc64le riscv64 loongarch64
37 42 
@@ -47,12 +52,14 @@ Apache Spark achieves high performance for both batch and streaming data, using
47%ifarch riscv64 loongarch6452%ifarch riscv64 loongarch64
48mkdir -p %{_builddir}/%{name}-%{version}/%{name}-prep_dir53mkdir -p %{_builddir}/%{name}-%{version}/%{name}-prep_dir
49export PROTOC_VERSION="3."$(protoc --version | awk '{print $NF}')54export PROTOC_VERSION="3."$(protoc --version | awk '{print $NF}')
55+pushd %{_builddir}
50%ifarch riscv6456%ifarch riscv64
51mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=/usr/bin/protoc57mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=/usr/bin/protoc
52%endif58%endif
53%ifarch loongarch6459%ifarch loongarch64
54mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc60mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc
55%endif61%endif
62+popd
56# protoc63# protoc
57tar -mxf %{SOURCE1} -C %{_builddir}/%{name}-%{version}/%{name}-prep_dir64tar -mxf %{SOURCE1} -C %{_builddir}/%{name}-%{version}/%{name}-prep_dir
58pushd %{_builddir}/%{name}-%{version}/%{name}-prep_dir/protobuf-3.21.765pushd %{_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
94sed -i "s,@HOME@,${HOME},g" build.gradle101sed -i "s,@HOME@,${HOME},g" build.gradle
95sed -i 's|https\\://services.gradle.org/distributions|file://%{_tmppath}/source|g' gradle/wrapper/gradle-wrapper.properties102sed -i 's|https\\://services.gradle.org/distributions|file://%{_tmppath}/source|g' gradle/wrapper/gradle-wrapper.properties
96%ifarch riscv64103%ifarch riscv64
104+export JAVA_HOME=%{_jvmdir}/java-11-openjdk
97SKIP_TESTS=true ARCH=riscv64 ./buildscripts/kokoro/unix.sh105SKIP_TESTS=true ARCH=riscv64 ./buildscripts/kokoro/unix.sh
98mvn 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.exe106mvn 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
99%endif107%endif
@@ -113,6 +121,7 @@ sed -i -e 's/<protobuf.version>3.23.4/<protobuf.version>'${PROTOC_VERSION}/'' po
113%build121%build
114%ifarch riscv64122%ifarch riscv64
115export MAVEN_OPTS="-Xms2048M -Xmx8000M"123export MAVEN_OPTS="-Xms2048M -Xmx8000M"
124+export JAVA_HOME=%{_jvmdir}/java-11-openjdk
116%endif125%endif
117./dev/make-distribution.sh --mvn mvn --name spark-3.5.0 --tgz -DskipTests -Dmaven.test.skip=true126./dev/make-distribution.sh --mvn mvn --name spark-3.5.0 --tgz -DskipTests -Dmaven.test.skip=true
118 127 
@@ -125,6 +134,10 @@ cp -rf ../%{name}-%{version} %{buildroot}/opt/apache-%{name}-%{version}
125 134 
126 135 
127%changelog136%changelog
137+* Mon Oct 27 2025 Dingli Zhang <dingli@iscas.ac.cn> - 3.5.0-7
138+- Fix build error of protoc-gen-grpc-java
139+- Use jdk11 to build on riscv64
140+ 
128* Wed Oct 15 2025 Wenlong Zhang <zhangwenlong@loongson.cn> - 3.5.0-6141* Wed Oct 15 2025 Wenlong Zhang <zhangwenlong@loongson.cn> - 3.5.0-6
129- fix build error on loongarch64142- fix build error on loongarch64
130 143