!22 [sync] PR-21: Fix riscv64 support

From: @openeuler-sync-bot 
Reviewed-by: @wenwj0 
Signed-off-by: @wenwj0
This commit is contained in:
openeuler-ci-bot 2024-06-07 15:54:07 +00:00 committed by Gitee
commit 3093c90ccf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 44 additions and 23 deletions

13
fix-riscv64-support.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
index fbad0da..4897e7f 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
@@ -54,6 +54,8 @@ public class JVM {
System.getProperty("os.arch") != null && System.getProperty("os.arch").contains("amd64");
private static final boolean aarch64 =
System.getProperty("os.arch") != null && System.getProperty("os.arch").contains("aarch64");
+ private static final boolean riscv64 =
+ System.getProperty("os.arch") != null && System.getProperty("os.arch").contains("riscv64");
private static final String JVMVersion = System.getProperty("java.version");

View File

@ -8,7 +8,7 @@
Name: hbase
Version: 2.5.0
Release: 2
Release: 3
Summary: A database for Apache Hadoop
License: Apache-2.0 and BSD and CPL-1.0 and EPL-1.0 and MIT
URL: http://hbase.apache.org/
@ -17,7 +17,9 @@ Source1: %{name}.logrotate
Source2: %{name}-site.xml
Source3: %{name}.service.template
Source4: xmvn-reactor
Source5: settings.xml
Source5: protoc-3.21.1-linux-riscv64.exe
Patch0: upgrade_os-maven_plugin_to_1.7.1.patch
Patch1: fix-riscv64-support.patch
BuildArch: noarch
BuildRequires: cmake
@ -59,6 +61,12 @@ This package contains the API documentation for %{name}.
%prep
%setup -qn %{name}-rel-%{version}
%patch0 -p1
%if "%{_arch}" == "riscv64"
%patch1 -p1
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=2.5.0 -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=/usr/bin/protoc
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.21.1 -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=%{SOURCE5}
%endif
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=2.5.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc
cp %{SOURCE4} ./.xmvn-reactor
echo `pwd` > absolute_prefix.log
@ -67,6 +75,9 @@ absolute_prefix=`head -n 1 absolute_prefix.log`
sed -i 's/absolute-prefix/'"$absolute_prefix"'/g' .xmvn-reactor
%build
%if "%{_arch}" == "riscv64"
export MAVEN_OPTS="-Xms2048M -Xmx8000M"
%endif
mvn -Pnative clean install -DskipTests assembly:single -Prelease -Dmaven.javadoc.skip=true -Drat.skip=true
%if %{with tests}
@ -262,6 +273,11 @@ fi
%endif
%changelog
* Wed May 29 2024 Dingli Zhang <dingli@iscas.ac.cn> - 2.5.0-3
- Fix riscv64 support
- Upgrade os-maven-plugin to 1.7.1
- Remove useless settings.xml
* Wed May 8 2024 xiexing <xiexing4@hisilicon.com> - 2.5.0-2
- remove unnecessary require

Binary file not shown.

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<mirror>
<id>big</id>
<mirrorOf>*</mirrorOf>
<name>huaweicloud</name>
<url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>
</mirrors>
<profiles>
</profiles>
</settings>

View File

@ -0,0 +1,13 @@
diff --git a/pom.xml b/pom.xml
index b603ca4..dcd21fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -621,7 +621,7 @@
<maven.javadoc.version>3.4.0</maven.javadoc.version>
<maven.warbucks.version>1.1.0</maven.warbucks.version>
<maven.project.info.report.version>3.1.2</maven.project.info.report.version>
- <os.maven.version>1.5.0.Final</os.maven.version>
+ <os.maven.version>1.7.1</os.maven.version>
<findbugs-annotations.version>1.3.9-1</findbugs-annotations.version>
<spotbugs.version>4.2.2</spotbugs.version>
<spotbugs.maven.version>4.2.0</spotbugs.maven.version>