Running WASIp2 Components with crun+wasmtime supported?
Hi,
I am currently having trouble running a WASIp2 component via crun with WASM support via wasmtime. The setup in use is basically a copy&paste of docs/wasm-wasi-example.md.
Upon running the image with podman the following error is printed:
WARNING: image platform (wasi/wasm) does not match the expected platform (linux/amd64)
[libcrun:wasmtime]: failed to compile module: failed to parse WebAssembly module
Caused by:
expected a WebAssembly module but was given a WebAssembly component
I am not that proficient in C but it seems like the wasmtime handler only invokes functions compatible with WASIp1. Is WASIp2 with wasmtime supported by crun? Or could my instillation of libwasmtime.so be faulty?
Output of crun -V:
crun version 1.23.1
commit: d20b23dba05e822b93b82f2f34fd5dada433e0c2
rundir: /run/user/1000/crun
spec: 1.0.0
+SELINUX +APPARMOR +CAP +SECCOMP +EBPF +WASM:wasmtime +YAJL
Thanks for your help!
@flouthoc PTAL
Sorry that I wasn't patient enough to wait for flouthocs comment but I dug around a little in the wasmtime c-api and was able to get a basic WASM component running: https://github.com/t4chib4ne/crun/tree/wasip2
Maybe this could aid in creating a more proper implementation =)
would it make sense to open a PR for crun and get that merged?
Hm ... I guess it would make sense. I will do some cleanup and try implement missing features most notably argv is currently not passed to the component.