Anuken / Arc

A Java game development framework based off of libGDX.
Apache License 2.0
318 stars 98 forks source link

We finally need ARM Support #167

Open BoKa33 opened 5 months ago

BoKa33 commented 5 months ago

ARM is rising and i wanna play mindustry on Asahi linux. (The linux for the new Macbooks). There are always coming more ARM based notebooks.

-> Raspberry Pi -> Pinebook -> M1/M2 Macs with Asahi

etc..

And there always comes this error: tuxi@TuxiFedAsahiLX:~/Downloads$ java -jar Mindustry-BE-Desktop-25023.jar [E] arc.util.ArcRuntimeException: Couldn't load shared library 'libarcarm64.so' for target: Linux, 64-bit at arc.util.SharedLibraryLoader.load(SharedLibraryLoader.java:84) at arc.util.ArcNativesLoader.load(ArcNativesLoader.java:14) at arc.backend.sdl.SdlApplication.init(SdlApplication.java:107) at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:35) at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39) Caused by: arc.util.ArcRuntimeException: Unable to read file for extraction: libarcarm64.so at arc.util.SharedLibraryLoader.readFile(SharedLibraryLoader.java:93)

Anuken commented 5 months ago

I don't have any ARM desktop devices, and I'm not interested in setting up VMs to test this. Feel free to make a PR.

thenameisluk commented 5 months ago

and if someone actually wants to go ahead and try what exactly is missing/broken? any pointers?

k8ieone commented 3 weeks ago

@Anuken I managed to make Arc compile on ARM in GitHub's CI. See the last workflow run desktop artifacts. I can open a pull request if you're interested.

I have a question though, how do the Arc natives get into Mindustry when releasing? I'm not a Java expert, I'm still getting my bearings here. I thought it downloads the CI artifacts from GitHub, but it doesn't look like it does.

Anuken commented 3 weeks ago

It uses the natives in the natives submodule (for example, the natives for the core submodule are here).

These natives can be automatically copied into the correct folders in the postJni gradle task for the relevant submodule.

If you would like, you can make a PR for the ARM build script changes, and I'll add the natives in a commit after that.


Side note: I know storing binary blobs in git repositories is generally considered 'bad practice', but I found it to be the simplest solution, and I haven't run into any issues relating to repo clone size yet, considering how infrequently these are updated.

k8ieone commented 2 weeks ago

I'd wait with the PR until someone has tested this with actual hardware rendering, I was only able to try with software rendering on my hardware because Mindustry uses some OpenGL feature that's not implemented on my hardware.

https://github.com/flathub/com.github.Anuken.Mindustry/issues/66#issuecomment-2441753223

k8ieone commented 3 days ago

@Anuken I'm happy to report that we were able to test on real hardware and it works!

I'll open a PR ASAP.