Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include aarch64-apple-darwin builds of libwasmtime_jni #36

Open
dakota-doordash opened this issue Jun 22, 2022 · 8 comments
Open

Include aarch64-apple-darwin builds of libwasmtime_jni #36

dakota-doordash opened this issue Jun 22, 2022 · 8 comments

Comments

@dakota-doordash
Copy link

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?

@kawamuray
Copy link
Owner

kawamuray commented Jun 24, 2022

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.

@syedfaizanalef
Copy link

@kawamuray is there any workaround?

@kawamuray
Copy link
Owner

kawamuray commented Sep 7, 2022

@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.

@krisbitney
Copy link

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

@kawamuray
Copy link
Owner

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.

@krisbitney
Copy link

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

@krisbitney
Copy link

I haven't tried it yet, but this sounds promising:

https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work/

@cch0
Copy link

cch0 commented Jun 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants