haveno
haveno copied to clipboard
Support ARM64 / aarch64 [1 XMR]
This issue requests running Haveno in ARM64 / aarch64.
Currently, running in Ubuntu 22.04.2 ARM64 gives this error:
Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /home/woodser/.openjfx/cache/16/libprism_es2.so: /home/woodser/.openjfx/cache/16/libprism_es2.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
java.lang.UnsatisfiedLinkError: /home/woodser/.openjfx/cache/16/libprism_es2.so: /home/woodser/.openjfx/cache/16/libprism_es2.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2450)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2506)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2705)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2635)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1850)
at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
at com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:69)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:51)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:829)
See related issue running Haveno in Manjaro aarch64: https://github.com/haveno-dex/haveno/issues/790
There is a bounty on this issue, the amount is in the title. The reward will be awarded to the first person or group of people who resolves this issue.
If you are starting to work on this bounty, please write a comment, so that we can assign the issue to you. We expect contributors to provide a PR in a reasonable time frame or, in case of an extensive work, updates on their progresses. We will unassign the issue if we feel the assignee is not responsive or has abandoned the task.
Read the full conditions and details of our bounty system.
I believe upgrading JavaFX to a version above version 17-ea+8 will fix this issue, assuming it doesn’t break anything else in the project (the current version of JavaFX in the project is 16)
(The reason for this is that javafx just doesn't exist for arm64 before 17)
Another large note is that JFoenix doesn't support any javafx version after 16 (what a coincidence). There appears to be some attempts to continue it past 17, (the most promising one I see is (this one)[https://github.com/ihmcrobotics/JFoenix-Group]; however I can't currently get it to work using jitpack
FYI we've updated to JDK and JFX 21 on the master branch.
The app is working for me as a native ARM64 app on macOS.
However getting an error on Ubuntu ARM64 VM running on macOS (even after updating TOR with #794):
Mar-12 13:04:36.567 [StartTor] INFO o.b.netlayer.tor.Tor: Starting Tor
Mar-12 13:04:36.585 [ERR] ERROR o.b.netlayer.tor.Tor: rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
Mar-12 13:04:36.685 [ERR] ERROR o.b.netlayer.tor.Tor:
Mar-12 13:04:36.686 [StartTor] ERROR h.n.p2p.network.TorNetworkNode: Starting tor node failed org.berndpruenster.netlayer.tor.TorCtlException: Could not setup Tor
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:106)
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:55)
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt)
at haveno.network.p2p.network.NewTor.getTor(NewTor.java:107)
at haveno.network.p2p.network.TorNetworkNode.lambda$createTorAndHiddenService$10(TorNetworkNode.java:172)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: java.io.IOException: Tor exited with value 133
at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp(TorContext.kt:392)
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:66)
... 8 common frames omitted
Caused by: java.io.IOException: Tor exited with value 133
at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp(TorContext.kt:354)
... 9 common frames omitted
This suggests something in the app is still using x86 version?
I created a new VM without x86 emulation, and now I'm getting this error on Ubuntu ARM64 from the master branch. Hopefully others will see the same:
Mar-14 19:19:40.523 [ERR] ERROR o.b.netlayer.tor.Tor: /home/woodser/.local/share/Haveno/xmr_stagenet/tor/tor: 2: Syntax error: Unterminated quoted string
Mar-14 19:19:40.524 [StartTor] ERROR h.n.p2p.network.TorNetworkNode: Starting tor node failed org.berndpruenster.netlayer.tor.TorCtlException: Could not setup Tor
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:106)
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:55)
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt)
at haveno.network.p2p.network.NewTor.getTor(NewTor.java:107)
at haveno.network.p2p.network.TorNetworkNode.lambda$createTorAndHiddenService$10(TorNetworkNode.java:172)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: java.io.IOException: Tor exited with value 2
at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp(TorContext.kt:392)
at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:66)
... 8 common frames omitted
Caused by: java.io.IOException: Tor exited with value 2
at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp(TorContext.kt:354)
... 9 common frames omitted
Interesting; is that file (...../xmr_stagenet/tor/tor) a bash script? The reason I ask is that the error strongly implies that it is, but the equivalent file on my system is not a bash script.
Interesting; is that file (...../xmr_stagenet/tor/tor) a bash script? The reason I ask is that the error strongly implies that it is, but the equivalent file on my system is not a bash script.
It's a binary.
Very likely the wrong tor binary is being downloaded for arm64.
Looking into it, there actually isn't an official ARM64 tor-binary (see here).
There have been unofficial builds, and there have been several PRs attempting to add it, with none of them being accepted. Sadly, it seems the tor project has had reasons to avoid adding arm64 support in the past.
MacOS ARM64 is supported, and since the current tor-binary implementation grabs the universal binary, there (shouldn't) be any issues for MacOS Apple Silicon.
Can confirm it's working on macOS ARM64, but didn't know if the in-built rosetta translation is helping it work.
Whereas we get an error on Ubuntu ARM64 (virtualized on macOS), and yeah it seems they don't release the tor binary for that platform.
Most linux distributions have a tor daemon binary package already in the repos, including on arm64. Maintaining just the tor daemon is much easier than porting and packaging the entire Tor Browser.
Instead of getting your own copy directly from the Tor Project, you can make tor daemon a build/install dependency, have your install script set up the environment for the private instance you're going to be running, with your own data directory and torrc file, then at runtime invoke the system binary with --torrc-file <your torrc>
to run your private instance with the config you need. I think that's the way you're supposed to be doing it.
FYI we've updated to JDK and JFX 21 on the master branch.
The app is working for me as a native ARM64 app on macOS.
However getting an error on Ubuntu ARM64 VM running on macOS (even after updating TOR with #794):
Mar-12 13:04:36.567 [StartTor] INFO o.b.netlayer.tor.Tor: Starting Tor Mar-12 13:04:36.585 [ERR] ERROR o.b.netlayer.tor.Tor: rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2 Mar-12 13:04:36.685 [ERR] ERROR o.b.netlayer.tor.Tor: Mar-12 13:04:36.686 [StartTor] ERROR h.n.p2p.network.TorNetworkNode: Starting tor node failed org.berndpruenster.netlayer.tor.TorCtlException: Could not setup Tor at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:106) at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:55) at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt) at haveno.network.p2p.network.NewTor.getTor(NewTor.java:107) at haveno.network.p2p.network.TorNetworkNode.lambda$createTorAndHiddenService$10(TorNetworkNode.java:172) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.io.IOException: java.io.IOException: Tor exited with value 133 at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp(TorContext.kt:392) at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:66) ... 8 common frames omitted Caused by: java.io.IOException: Tor exited with value 133 at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp(TorContext.kt:354) ... 9 common frames omitted
This suggests something in the app is still using x86 version?
The commit to upgrade to jfx 21 did not resolve the prism error for me.
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @66f57048' Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib: dlopen(/Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib, 0x0001): tried: '/Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib' (no such file), '/Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
However, the file seems to be aarm64
$ otool -h /Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib /Users/user/.openjfx/cache/21.0.2+5/aarch64/libprism_es2.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 0xfeedfacf 16777223 3 0x00 6 23 2560 0x00100085