jakobkmar / pacmc

An easy-to-use package manager (and soon to be launcher) for Minecraft mods.
GNU Affero General Public License v3.0
121 stars 9 forks source link

Support Linux ARM64 #21

Open elvis-pereira opened 2 years ago

elvis-pereira commented 2 years ago
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/elvispereira/.cache/Kodein-DB/0.9.0-beta/libkodein-leveldb-jni.so: /home/elvispereira/.cache/Kodein-DB/0.9.0-beta/libkodein-leveldb-jni.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)
        at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
        at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
        at java.base/java.lang.Runtime.load0(Runtime.java:755)
        at java.base/java.lang.System.load(System.java:1953)
        at org.kodein.db.leveldb.jvm.AbstractLevelDBJvmLoader.load(AbstractLevelDBJvmLoader.kt:78)
        at org.kodein.db.leveldb.jvm.LevelDBJvm.<clinit>(LevelDBJvm.kt:29)
        at org.kodein.db.impl.kv.KeyValueDBJvm.getLdbFactory(KeyValueDBJvm.kt:11)
        at org.kodein.db.impl.kv.AbstractKeyValueDBFactory.open(AbstractKeyValueDBFactory.kt:20)
        at org.kodein.db.impl.kv.AbstractKeyValueDBFactory.open(AbstractKeyValueDBFactory.kt:12)
        at org.kodein.db.impl.data.AbstractDataDBFactory.open(AbstractDataDBFactory.kt:20)
        at org.kodein.db.impl.data.AbstractDataDBFactory.open(AbstractDataDBFactory.kt:12)
        at org.kodein.db.impl.model.AbstractModelDBFactory.open(AbstractModelDBFactory.kt:29)
        at org.kodein.db.impl.model.AbstractModelDBFactory.open(AbstractModelDBFactory.kt:9)
        at org.kodein.db.impl.AbstractDBFactory.open(AbstractDBFactory.kt:26)
        at org.kodein.db.impl.AbstractDBFactory.open(AbstractDBFactory.kt:10)
        at org.kodein.db.impl.DefaultKt.open(default.kt:7)
        at net.axay.pacmc.storage.DatabaseKt.<clinit>(Database.kt:14)
        at net.axay.pacmc.commands.Init$run$1.invokeSuspend(Init.kt:25)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

That's the result of using pacmc init version 0.4.2 on Ubuntu 20.04.3 (aarch64)

JDK

java -version
openjdk version "17" 2021-09-14 LTS
OpenJDK Runtime Environment Zulu17.28+13-CA (build 17+35-LTS)
OpenJDK 64-Bit Server VM Zulu17.28+13-CA (build 17+35-LTS, mixed mode)
jakobkmar commented 2 years ago

Hey, seems like you have got an issue with KodeinDB, the database pacmc is currently using. This database relies on JNI calls, which I want to get rid of. The problem probably is that this database does not support ARM64.

I don't know how to fix this issue in your case right now, but in the long term this will be fixed by pacmc using another form of storage.

(However, please check whether this is just a problem with permissions, I haven't tested pacmc on ARM64 yet.)

elvis-pereira commented 2 years ago

I just double checked and the permissions are all correct, KodeinDB problably just don't work ARM yet.

ls -la /home/elvispereira/.cache/Kodein-DB/0.9.0-beta
-rw-rw-r-- 1 elvispereira elvispereira     95 Dec 15 16:32 kodein-leveldb-jni.properties
-rw-rw-r-- 1 elvispereira elvispereira 404168 Dec 15 16:32 libkodein-leveldb-jni.so
jakobkmar commented 2 years ago

So I am planning to switch to https://realm.io/ for the database, but I need someone to test it on Linux ARM64, could you execute a small test jar made by me?

elvis-pereira commented 2 years ago

Sure, just tell me what you need.

jakobkmar commented 2 years ago

realm-test-0.0.1.zip (sorry it is quite large) Here is the test, navigate to the bin folder inside it and execute ./realm-test.

If it works, you should see the following:

Task(name='Test Task', status='Completed')

and a directory called realm should be created in the run dir of this test application.

Thanks in advance!

elvis-pereira commented 2 years ago

Didn't work, output:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at io.realm.internal.ConfigurationImpl.<init>(ConfigurationImpl.kt:63)
        at io.realm.internal.RealmConfigurationImpl.<init>(RealmConfigurationImpl.kt:38)
        at io.realm.RealmConfiguration$Builder.build(RealmConfiguration.kt:64)
        at net.axay.realmtest.RealmTestKt.main(RealmTest.kt:26)
        at net.axay.realmtest.RealmTestKt.main(RealmTest.kt)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.realm.internal.interop.RealmInterop.<clinit>(RealmInterop.kt:57)
        ... 5 more
Caused by: java.lang.UnsatisfiedLinkError: /home/elvispereira/.cache/io.realm.kotlin/74767a05284c3e2eeca7eb1eaa0fc5bdf6684c19/librealmc.so: /home/elvispereira/.cache/io.realm.kotlin/74767a05284c3e2eeca7eb1eaa0fc5bdf6684c19/librealmc.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)
        at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
        at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
        at java.base/java.lang.Runtime.load0(Runtime.java:755)
        at java.base/java.lang.System.load(System.java:1953)
        at io.realm.jvm.SoLoader.load(SoLoader.kt:69)
        at io.realm.jvm.SoLoader.load(SoLoader.kt:47)
        ... 10 more

librealmc.so permissions:

ls -l /home/elvispereira/.cache/io.realm.kotlin/74767a05284c3e2eeca7eb1eaa0fc5bdf6684c19/
-rw-rw-r-- 1 elvispereira elvispereira 29135904 Dec 22 22:47 librealmc.so
jakobkmar commented 2 years ago

Mh this is not great, but I am running out of alternatives here, seems like nothing really supports Linux Desktop ARM64. I will open an issue at the realm database to request support for this - I mean they support android so...

elvis-pereira commented 2 years ago

Ok, thanks @jakobkmar! pacmc is so awesome that want to use it everywhere xD

jakobkmar commented 2 years ago

So I got an answer on my issue already, and they said that they will add Linux ARM64 support in the near future, as it's

just a process of extending the CI

therefore pacmc will likely work on ARM64.