It's been a while since this project was sync'ed with wit-bindgen project. There was a couple of changes, but the most important are:
- wit-bindgen-host-wasmtime-rust was moved to wasmtime
- We have a new syntax for wit files
This lead to some problems:
- When starting the server, the compiled wasm example plugin does not work error:
failed to parse WebAssembly module caused by: attempted to parse a wasm module with a component parser
Solution:
cargo build --target wasm32-wasi
wasm-tools component new ./target/wasm32-wasi/debug/my-project.wasm \
-o my-component.wasm --adapt ./wasi_snapshot_preview1.wasm
- Wasi context
The linker changed to use wasmtime::component::Linker which is not compatible with wasmtime::Linker needed to link the default WasiCtx. Currently there is some work to handle this in a preview repo from Wasmtime, but that repo is very much unstable: https://bytecodealliance.zulipchat.com/#narrow/stream/217126-wasmtime/topic/WasiCtx.20and.20component.3A.3ALinker
It's been a while since this project was sync'ed with wit-bindgen project. There was a couple of changes, but the most important are:
1. wit-bindgen-host-wasmtime-rust was moved to wasmtime
2. We have a new syntax for wit files
This lead to some problems:
1. When starting the server, the compiled wasm example plugin does not work error: `failed to parse WebAssembly module caused by: attempted to parse a wasm module with a component parser`
Solution:
```
cargo build --target wasm32-wasi
wasm-tools component new ./target/wasm32-wasi/debug/my-project.wasm \
-o my-component.wasm --adapt ./wasi_snapshot_preview1.wasm
```
2. Wasi context
The linker changed to use `wasmtime::component::Linker` which is not compatible with `wasmtime::Linker` needed to link the default WasiCtx. Currently there is some work to handle this in a preview repo from Wasmtime, but that repo is very much unstable: https://bytecodealliance.zulipchat.com/#narrow/stream/217126-wasmtime/topic/WasiCtx.20and.20component.3A.3ALinker