Stream: wasmtime

Topic: iOS / aarch64-apple-ios platform support


view this post on Zulip Jack Qi (Nov 04 2023 at 22:36):

I've got the beginnings of a Swift wrapper for wasmtime using the C API, as suggested by @Alex Crichton the https://github.com/bytecodealliance/wasmtime-py repo has been very helpful in getting this working. The Swift wrapper Package runs on macOS when wasmtime is built for the aarch64-apple-darwin and x86_64-apple-darwin targets, however wasmtime doesn't yet appear to compile to iOS / aarch64-apple-ios. Would there be any interest in patches to get wasmtime building on aarch64-apple-ios, and is there a sense of how involved this task would be and if there would be any major barriers to getting this working?

Python WebAssembly runtime powered by Wasmtime. Contribute to bytecodealliance/wasmtime-py development by creating an account on GitHub.

view this post on Zulip Alex Crichton (Nov 05 2023 at 21:31):

Patches would definitely be welcome!

view this post on Zulip Alex Crichton (Nov 05 2023 at 21:32):

The main thing that's probably a blocker is the need to map executable memory at runtime (e.g. a JIT) which IIRC iOS heavily regulates and basically doesn't allow us to do

view this post on Zulip bjorn3 (Nov 06 2023 at 12:34):

Precompiling wasm modules and shipping them as part of the app bundle would be allowed, right? It would be much less useful as you can't download new wasm modules at runtime, but at least work in some cases.

view this post on Zulip Alex Crichton (Nov 06 2023 at 15:47):

Yeah that should work in theory, but that's not quite fully integrated into Wasmtime today and would require some further work postprocessing a *.cwasm into a linkable object file to go into an application for example.

view this post on Zulip Jack Qi (Nov 06 2023 at 19:44):

Alex Crichton said:

Yeah that should work in theory, but that's not quite fully integrated into Wasmtime today and would require some further work postprocessing a *.cwasm into a linkable object file to go into an application for example.

Ok thanks for the explanation. It sounds like building wasmtime on iOS wouldn't be sufficient to be able to publish apps using *.cwasm, and we would need to fully implement the *.cwasm postprocessing to make this more broadly useful. For now I'm going to start looking into the build issues for the aarch64-apple-ios target as a first step. It would be good to understand in more detail what work is needed on the postprocessing front and how much of a lift this would be, and if there is interest from the wasmtime team in getting this integrated.

view this post on Zulip Alex Crichton (Nov 06 2023 at 19:47):

Sounds good! I'd be happy to try to help sketch something out when things are closer to working

view this post on Zulip Jack Qi (Nov 08 2023 at 21:58):

@Alex Crichton I have a draft PR up just to get wasmtime compiling for the iOS target: https://github.com/bytecodealliance/wasmtime/pull/7506. I haven't done any testing of this yet, my goal for this PR was to get the crate compiling as a first step . Please let me know if you have any feedback.

As discussed with @alexcrichton on zulip, there appears to be some interest in supporting iOS as a platform. This PR makes the necessary changes for wasmtime to build when targeting aarch64-apple-i...

view this post on Zulip Alex Crichton (Nov 08 2023 at 22:04):

Thanks! I'll take a look


Last updated: Nov 22 2024 at 17:03 UTC