00-Evan / shattered-pixel-dungeon

Shattered Pixel Dungeon is an open-source traditional roguelike dungeon crawler with randomized levels and enemies, and hundreds of items to collect and use. It's based on the source code of Pixel Dungeon, by Watabou.
https://shatteredpixel.com/shatteredpd/
GNU General Public License v3.0
4.71k stars 1.1k forks source link

Not launching on postmarketos. #1052

Closed Spagett1 closed 2 years ago

Spagett1 commented 2 years ago

On postmarketOs (linux, aarch64, musl) it wont launch, i have tried the flatpak version aswell as the desktop jar with openjdk 18,17 and 8.

this is the launch error message

com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: Couldn't load shared library 'libgdxarm64.so' for target: Linux, ARM, 64-bit
    at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:128)
    at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:30)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3NativesLoader.load(Lwjgl3NativesLoader.java:28)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:83)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration.getDisplayMode(Lwjgl3ApplicationConfiguration.java:219)
    at com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher.main(DesktopLauncher.java:177)
Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: java.lang.UnsatisfiedLinkError: /tmp/libgdxspagett/8c18a7e6/libgdxarm64.so: Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /tmp/libgdxspagett/8c18a7e6/libgdxarm64.so)
    at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:325)
    at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:124)
    ... 5 more
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libgdxspagett/8c18a7e6/libgdxarm64.so: Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /tmp/libgdxspagett/8c18a7e6/libgdxarm64.so)
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:395)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:234)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:176)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
    at java.base/java.lang.Runtime.load0(Runtime.java:785)
    at java.base/java.lang.System.load(System.java:1979)
    at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:331)
    at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:300)
    ... 6 more

Exception: java.lang.UnsatisfiedLinkError thrown from the UncaughtExceptionHandler in thread "main"
00-Evan commented 2 years ago

The latest .jar release does include the correct natives to run on aarch64 linux. As you can see from the error, the game is attempting to unzip those natives into a temporary directory (/tmp/libgdxspagett/8c18a7e6/), but is unable to read them after doing so (file does not seem to exist). This is probably due to something on your system in particular, as the libGDX natives loading process is well-tested.

Spagett1 commented 2 years ago

could this have something to do with pmos using musl instead of glibc? if so would building it manually work?

00-Evan commented 2 years ago

Afraid I have no idea. You could certainly try building it yourself but I don't imagine that's likely to change much as the Java code seems to be running, its just not able to do the file operations it expects to. You might also consider trying to run other libGDX JAR applications and see if they also encounter errors. Just as a simple starting point you could try older desktop builds of Shattered.

00-Evan commented 2 years ago

Closing this for now due to inactivity, feel free to comment if you have any more info and I'll reopen this.