Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.detected.arch: unknown; org.apache.maven.MavenExecutionException: unknown os.arch: riscv #51

Closed
advancedwebdeveloper opened this issue Jan 22, 2021 · 6 comments
Milestone

Comments

@advancedwebdeveloper
Copy link
Contributor

Hi there.

How about if your would some support for 64bit RISC-V hardware?

Here is what I am using:

$ java -version && javac -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10-202007292333)
Eclipse OpenJ9 VM AdoptOpenJDK (build master-dc7cbe4bd, JRE 11 Linux riscv-64-Bit Compressed References 20200729_78 (JIT disabled, AOT disabled)
OpenJ9 - dc7cbe4bd
OMR - 1c0299f20
JCL - 94b9d6d2c6 based on jdk-11.0.8+10)
javac 11.0.8

on

$ uname -a && cat /proc/cpuinfo && cat /etc/release
Linux test-gdams-debian10-riscv64-1.adoptopenjdk.net 5.0.0-rc1-56210-g0a657e0d72f0 #1 SMP Fri May 15 18:05:26 EDT 2020 riscv64 GNU/Linux
processor : 0
hart : 1
isa : rv64imafdc
mmu : sv39
uarch : sifive,rocket0

processor : 1
hart : 2
isa : rv64imafdc
mmu : sv39
uarch : sifive,rocket0

processor : 2
hart : 3
isa : rv64imafdc
mmu : sv39
uarch : sifive,rocket0

processor : 3
hart : 4
isa : rv64imafdc
mmu : sv39
uarch : sifive,rocket0

PRETTY_NAME="Debian GNU/Linux bullseye/sid"
NAME="Debian GNU/Linux"
ID=debian
.

Here is what I was doing:

~/hadoop/hadoop-hdfs-project$ mvn -e clean install -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: unknown
[INFO] os.detected.version: 5.0
[INFO] os.detected.version.major: 5
[INFO] os.detected.version.minor: 0
[ERROR] unknown os.arch: riscv -> [Help 1]
org.apache.maven.MavenExecutionException: unknown os.arch: riscv
at kr.motd.maven.os.DetectExtension.afterProjectsRead (DetectExtension.java:95)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
. Exception seem to be raised at

public void afterProjectsRead(MavenSession session) throws MavenExecutionException {

.

@advancedwebdeveloper
Copy link
Contributor Author

I had to apply such a patch:

$ git diff
diff --git a/src/main/java/kr/motd/maven/os/Detector.java b/src/main/java/kr/motd/maven/os/Detector.java
index 377c6a1..b89131d 100644
--- a/src/main/java/kr/motd/maven/os/Detector.java
+++ b/src/main/java/kr/motd/maven/os/Detector.java
@@ -234,6 +234,9 @@ public abstract class Detector {
if ("s390x".equals(value)) {
return "s390_64";
}

  •   if ("riscv".equals(value)) {
    
  •        return "riscv";
    
  •    }
    
       return UNKNOWN;
    
    }

, for

private static String normalizeArch(String value) {

.

@trustin
Copy link
Owner

trustin commented Jan 23, 2021

Thanks a lot for reporting this issue, @advancedwebdeveloper! What do you think about sending a pull request if you already have a patch?

@advancedwebdeveloper
Copy link
Contributor Author

Well, I can tell that it allowed to build it.
I tired to run https://github.com/trustin/os-maven-plugin/blob/master/test - and it allowed to identify Debian 10, RISC-V arch. properly.
But there where some aside issues - that is not related to the functionality of your artifact.

I can try to make a pull request

advancedwebdeveloper pushed a commit to advancedwebdeveloper/os-maven-plugin that referenced this issue Jan 23, 2021
advancedwebdeveloper pushed a commit to advancedwebdeveloper/os-maven-plugin that referenced this issue Jan 23, 2021
@advancedwebdeveloper
Copy link
Contributor Author

Ping

advancedwebdeveloper pushed a commit to advancedwebdeveloper/os-maven-plugin that referenced this issue Jan 25, 2021
On behalf of trustin#51 : I didn't add it to the patch - but should.
Merging with 59b12da pool request would make sense.
trustin pushed a commit that referenced this issue Feb 6, 2021
trustin pushed a commit that referenced this issue Feb 6, 2021
@trustin
Copy link
Owner

trustin commented Feb 6, 2021

Fixed via #52 and #53.

@trustin trustin closed this as completed Feb 6, 2021
@trustin trustin added this to the 1.7.0 milestone Feb 6, 2021
@xswfantasy
Copy link

hi, I have a similar problem:

Here is what I am using:

#java -version && javac -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment (build 17.0.3+7-Ubuntu-0ubuntu0.22.04.1)
OpenJDK 64-Bit Zero VM (build 17.0.3+7-Ubuntu-0ubuntu0.22.04.1, interpreted mode)
javac 17.0.3

The error is as follows:

root@df8743386e44:/zeebe-1.3.5# mvn dependency:get -B
-DremoteRepositories="camunda-nexus::::https://app.camunda.com/nexus/content/repositories/public"
-DgroupId="io.camunda" -DartifactId="camunda-cloud-zeebe" \
-Dos.detected.name=linux -Dos.detected.arch=riscv -Dos.detected.classifier=linux-riscv
-Dversion="1.3.5" -Dpackaging="tar.gz" -Dtransitive=false

[INFO] Scanning for projects...
[INFO] Inspecting build with total of 40 modules...
[INFO] Not installing Nexus Staging features:
[INFO] * Preexisting staging related goal bindings found in 40 modules.
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: unknown
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 5.15
[INFO] os.detected.version.major: 5
[INFO] os.detected.version.minor: 15
[ERROR] unknown os.arch: riscv64 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants