community/prismlauncher: Minecraft 1.19.3 and above do not launch
Related issue: https://github.com/PolyMC/PolyMC/issues/779, where older LWJGL versions would not launch with gcompat installed due to some missing instructions. This is a new issue, started when LWJGL 3.3.1 was introduced.
So far, it was enough to revert to LWJGL 3.2.2 to get Minecraft to run. This no longer works starting from Minecraft 1.19.3, and Minecraft will complain about a missing method:
java.lang.NoSuchMethodError: 'org.lwjgl.glfw.GLFWImage$Buffer org.lwjgl.glfw.GLFWImage.malloc(int, org.lwjgl.system.MemoryStack)'
at net.minecraft.class_1041.method_4491(class_1041.java:157)
at net.minecraft.class_310.<init>(class_310.java:497)
at net.minecraft.client.main.Main.method_44604(Main.java:205)
at net.minecraft.client.main.Main.main(Main.java:51)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
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 org.prismlauncher.impl.OneSixLauncher.invokeMain(OneSixLauncher.java:104)
at org.prismlauncher.impl.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:176)
at org.prismlauncher.impl.OneSixLauncher.launch(OneSixLauncher.java:186)
at org.prismlauncher.EntryPoint.listen(EntryPoint.java:144)
at org.prismlauncher.EntryPoint.main(EntryPoint.java:74)
Switching to LWJGL 3.3.1 instead results in a SIGSEGV. A crash log has been attached below:
I also observed the following error when trying LWJGL 3.3.1 on 1.18.2 with mods (but not without mods):
...
Caused by: java.lang.UnsatisfiedLinkError: /tmp/lwjglknuxify/3.3.1-build-7/liblwjgl_stb.so: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/lwjglknuxify/3.3.1-build-7/liblwjgl_stb.so)
What now?
This isn't a Prism issue as much as it's an LWJGL issue. I'm filing it under community/prismlauncher because it's directly affected (and I'm the maintainer of that package).
Some of the issues with linking to glibc libraries would be solved by rebuilding LWJGL under a Musl system. I'm not sure what to do about the crash in the provided crash log, though. Nonetheless, fixing it would likely involve forking LWJGL and figuring out how to build and patch it.
I've tried to make an LWJGL3 package, and my work can be found here: https://gitlab.alpinelinux.org/knuxify/aports/-/blob/lwjgl/testing/lwjgl3/
However, this is an incredibly janky solution, as many of the modules in LWJGL link against forks of various libraries - see the repositories in https://github.com/LWJGL-CI. My package tries to link to some system libraries, but this probably isn't how LWJGL was meant to be built.
The more correct option would be to build all of the forked libraries and LWJGL itself separately, upload the resulting .jar files to a server somewhere, then modify Prism to load a modified version of https://github.com/PrismLauncher/meta-launcher/blob/master/org.lwjgl3/3.3.1.json which downloads the musl packages instead (or figure out how the OS is detected here, add a "musl" target and add the links upstream).
There might also be the option of asking upstream LWJGL to consider adding musl builds, but I'm not sure if there's enough of an userbase for them to consider it.
I'm opening this issue in case anybody would like to look into this. I currently don't really have the time for it, but might try to do it over the christmas break.