已开启
Fix build error of protoc-gen-grpc-java #75
Dingli Zhang创建于 2025年10月28日
Fix build error of protoc-gen-grpc-java #75
已开启
从refs/pull/75/head合入到openEuler-24.03-LTS-Next
共 1 个文件变更+16-3
| @@ -4,7 +4,7 @@ | |||
| 4 | Summary: A unified analytics engine for large-scale data processing. | 4 | Summary: A unified analytics engine for large-scale data processing. |
| 5 | Name: spark | 5 | Name: spark |
| 6 | Version: 3.5.0 | 6 | Version: 3.5.0 |
| 7 | -Release: 6 | 7 | +Release: 7 |
| 8 | License: Apache 2.0 | 8 | License: Apache 2.0 |
| 9 | URL: http://spark.apache.org/ | 9 | URL: http://spark.apache.org/ |
| 10 | Source0: https://github.com/apache/spark/archive/v%{version}.tar.gz | 10 | 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 | |||
| 25 | Patch1004: 1004-Add-protoc-java-support-for-loongarch64.patch | 25 | Patch1004: 1004-Add-protoc-java-support-for-loongarch64.patch |
| 26 | Patch1005: 1005-Added-support-for-building-the-loongarch64-protoc-ge.patch | 26 | Patch1005: 1005-Added-support-for-building-the-loongarch64-protoc-ge.patch |
| 27 | 27 | ||
| 28 | +BuildRequires: git maven | ||
| 28 | %ifarch riscv64 loongarch64 | 29 | %ifarch riscv64 loongarch64 |
| 29 | BuildRequires: protobuf-devel protobuf-compiler | 30 | BuildRequires: protobuf-devel protobuf-compiler |
| 30 | BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static gcc-c++ | 31 | BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static gcc-c++ |
| 31 | %endif | 32 | %endif |
| 32 | -BuildRequires: java-1.8.0-openjdk-devel git maven | 33 | +%ifarch riscv64 |
| 33 | - | 34 | +BuildRequires: java-11-openjdk-devel |
| 35 | +Requires: java-11-openjdk | ||
| 36 | +%else | ||
| 37 | +BuildRequires: java-1.8.0-openjdk-devel | ||
| 34 | Requires: java-1.8.0-openjdk | 38 | Requires: java-1.8.0-openjdk |
| 39 | +%endif | ||
| 35 | 40 | ||
| 36 | ExclusiveArch: x86_64 aarch64 ppc64le riscv64 loongarch64 | 41 | ExclusiveArch: 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 loongarch64 | 52 | %ifarch riscv64 loongarch64 |
| 48 | mkdir -p %{_builddir}/%{name}-%{version}/%{name}-prep_dir | 53 | mkdir -p %{_builddir}/%{name}-%{version}/%{name}-prep_dir |
| 49 | export PROTOC_VERSION="3."$(protoc --version | awk '{print $NF}') | 54 | export PROTOC_VERSION="3."$(protoc --version | awk '{print $NF}') |
| 55 | +pushd %{_builddir} | ||
| 50 | %ifarch riscv64 | 56 | %ifarch riscv64 |
| 51 | mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=/usr/bin/protoc | 57 | mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=/usr/bin/protoc |
| 52 | %endif | 58 | %endif |
| 53 | %ifarch loongarch64 | 59 | %ifarch loongarch64 |
| 54 | mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc | 60 | mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOC_VERSION} -Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc |
| 55 | %endif | 61 | %endif |
| 62 | +popd | ||
| 56 | # protoc | 63 | # protoc |
| 57 | tar -mxf %{SOURCE1} -C %{_builddir}/%{name}-%{version}/%{name}-prep_dir | 64 | tar -mxf %{SOURCE1} -C %{_builddir}/%{name}-%{version}/%{name}-prep_dir |
| 58 | pushd %{_builddir}/%{name}-%{version}/%{name}-prep_dir/protobuf-3.21.7 | 65 | 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 | |||
| 94 | sed -i "s,@HOME@,${HOME},g" build.gradle | 101 | sed -i "s,@HOME@,${HOME},g" build.gradle |
| 95 | sed -i 's|https\\://services.gradle.org/distributions|file://%{_tmppath}/source|g' gradle/wrapper/gradle-wrapper.properties | 102 | sed -i 's|https\\://services.gradle.org/distributions|file://%{_tmppath}/source|g' gradle/wrapper/gradle-wrapper.properties |
| 96 | %ifarch riscv64 | 103 | %ifarch riscv64 |
| 104 | +export JAVA_HOME=%{_jvmdir}/java-11-openjdk | ||
| 97 | SKIP_TESTS=true ARCH=riscv64 ./buildscripts/kokoro/unix.sh | 105 | SKIP_TESTS=true ARCH=riscv64 ./buildscripts/kokoro/unix.sh |
| 98 | 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 | 106 | 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 |
| 99 | %endif | 107 | %endif |
| @@ -113,6 +121,7 @@ sed -i -e 's/<protobuf.version>3.23.4/<protobuf.version>'${PROTOC_VERSION}/'' po | |||
| 113 | %build | 121 | %build |
| 114 | %ifarch riscv64 | 122 | %ifarch riscv64 |
| 115 | export MAVEN_OPTS="-Xms2048M -Xmx8000M" | 123 | export MAVEN_OPTS="-Xms2048M -Xmx8000M" |
| 124 | +export JAVA_HOME=%{_jvmdir}/java-11-openjdk | ||
| 116 | %endif | 125 | %endif |
| 117 | ./dev/make-distribution.sh --mvn mvn --name spark-3.5.0 --tgz -DskipTests -Dmaven.test.skip=true | 126 | ./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 | %changelog | 136 | %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-6 | 141 | * Wed Oct 15 2025 Wenlong Zhang <zhangwenlong@loongson.cn> - 3.5.0-6 |
| 129 | - fix build error on loongarch64 | 142 | - fix build error on loongarch64 |
| 130 | 143 | ||