Stream: git-wasmtime

Topic: wasmtime / issue #5852 Compile error on Android Emulator


view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2023 at 17:16):

nathanprat opened issue #5852:

Hello,

My goal is to run a Substrate client[Integritee to be precise] on Android(and soon iOs).
The issue is that integritee-cli pulls a lot of dependencies, including this crate.
Unfortunately, it does not compile on Android Emulator.

See this for a bit more context.

I know these targets are not supposed to be supported, but as I created a fork (and used a cargo [patch]), I thought I might as well share it.

Benefit

Allow this crate to compile on Android Emulator(and Android aarch64).
While I'm at it, I can probably add iOs Simulator and aarch64 too?

Implementation

I have started a branch (based on v5 b/c of transitive deps) here: https://github.com/Interstellar-Network/wasmtime/tree/v5-fix-android-emulator-build-for-substrate-client [still WIP, CI pass for Android but breaks for other targets... I need to improve the #[cfg])

Note: this project is way beyond my Rust skills so:

view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2023 at 17:23):

afonso360 commented on issue #5852:

We currently have a CI job that checks the aarch64-android build using cargo-ndk. Are you encountering issues that it did not catch?

https://github.com/bytecodealliance/wasmtime/blob/6e6a1034d73b10775f41b7bcd5675815021d3510/.github/workflows/main.yml#L282-L292

view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2023 at 17:32):

nathanprat commented on issue #5852:

Ah, I did not see it b/c I am using v5.0.0 b/c of Substrate.

But the issue should still be there on master: I want to compile for Android Emulator(ie target x86_64-linux-android).
The problem being that it is target_arch = "x86_64" + target_os = "linux" but does not support VTune etc so some #[cfg] logics fall off.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2023 at 17:33):

nathanprat edited a comment on issue #5852:

Ah, I did not see it b/c I am using v5.0.0 b/c of Substrate.

But the issue should still be there on master: I want to compile for Android Emulator(ie target x86_64-linux-android).
The problem being that it is target_arch = "x86_64" + target_os = "linux" but does not support VTune etc so some #[cfg] logics fall off.

Edit: this is more a nice-to-have than anything else; ie in prod I only need aarch64-linux-android but having the whole stack run an Emulator is definitely easier to dev

view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2023 at 19:37):

jameysharp commented on issue #5852:

When you get to working on iOS, note that, as I understand it, iOS App Store policy prohibits JIT compilers. In theory Wasmtime could work on iOS as long as you have your WebAssembly input available already when compiling your app and precompile it to native code at that point. But as far as I know nobody has yet tried that on iOS.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2023 at 10:26):

nathanprat commented on issue #5852:

Thanks for the heads-up!

I am 50% sure that this crate is not used in practice with my use case and could be behind a feature. I definitely need to investigate how the dependency tree works

view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2023 at 03:58):

alexcrichton added the wasmtime:platform-support label to Issue #5852.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2024 at 17:08):

alexcrichton closed issue #5852:

Hello,

My goal is to run a Substrate client[Integritee to be precise] on Android(and soon iOs).
The issue is that integritee-cli pulls a lot of dependencies, including this crate.
Unfortunately, it does not compile on Android Emulator.

See this for a bit more context.

I know these targets are not supposed to be supported, but as I created a fork (and used a cargo [patch]), I thought I might as well share it.

Benefit

Allow this crate to compile on Android Emulator(and Android aarch64).
While I'm at it, I can probably add iOs Simulator and aarch64 too?

Implementation

I have started a branch (based on v5 b/c of transitive deps) here: https://github.com/Interstellar-Network/wasmtime/tree/v5-fix-android-emulator-build-for-substrate-client [still WIP, CI pass for Android but breaks for other targets... I need to improve the #[cfg])

Note: this project is way beyond my Rust skills so:

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2024 at 17:08):

alexcrichton commented on issue #5852:

I believe that this has since been fixed, so I'm going to close this.


Last updated: Nov 22 2024 at 17:03 UTC