wasmtime-java
wasmtime-java copied to clipboard
Include aarch64-apple-darwin builds of libwasmtime_jni
Currently, only x86_64 darwin builds of libwasmtime_jni are included in the package. This causes issues on M1 Macs in which the library needs to be manually built for aarch64 darwin. Could aarch64 darwin builds also be included?
It's not easy for now as github actions doesn't provide M1 mac as an execution environment.
We might be able to cross-build a shared library for aarch64 without any tests executed, but as far as I tried the build now fails due to the compilation errors from the stage building C library for zstd-sys
which is transitively dependent by wasmtime
crate. (cargo build --target aarch64-apple-darwin
)
So for now, there's no easy way to build a shared library for aarch64-apple-darwin on github actions.
@kawamuray is there any workaround?
@syedfaizanalef The situation remain the same. Github actions still does not support aarch64 mac, and compiling for the aarch64-apple-drawin on an intel mac fails by zstd-sys, even with latest dependency versions.
The workaround is to build this project (precisely, wasmtime-jni subproject. Just run cargo build --release
) on an apple silicon mac by yourself, and use a built shared object (by -Djava.library.path
) instead of those shipped with the official jar.
Is it possible to use something like this to build on more architectures? https://github.com/marketplace/actions/run-on-architecture
Also, this Mozilla Gradle plugin makes it easier to build for Android: https://github.com/mozilla/rust-android-gradle
Is it possible to use something like this to build on more architectures? https://github.com/marketplace/actions/run-on-architecture
Looks like an option, but it seems that we need to write entire build process as shell script, requiring some effort as in currently the ci.yml is written with leveraging a lot of actions.
When i get time, i will look at it and see if i can update the build script to build to work seamlessly with arm architectures
I haven't tried it yet, but this sounds promising:
https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work/
I am also interested in this subject since I am using M1 for development but need to use this library for other OS and platforms.
What I have tried and found out is that we can still use ubuntu-22.04
and macos-12
to build for targets such as aarch64-unknown-linux-gnu
and aarch64-apple-darwin
, respectively.
The other tool I also looked at is cross.