I have an issue where calling canonical_abi_realloc
from Python after linking causes an error: thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', crates/c-api/src/linker.rs:105:80
, anyone know what this could be? Version conflicts? I am running this in an linux arm64 vm on an arm mac
That is an error in wasmtime_linker_define_wasi
which seems to happen when the wasi context is not set. This field seems to be set by wasmtime_context_set_wasi
. It seems you have to call store.set_wasi(wasi)
on the python side before instantiating the linker. wasi
here is of the type WasiConfig
. See https://github.com/bytecodealliance/wasmtime-py/blob/7ebdf1cb0c792da8c6b4c9b54630ac0da1a6a655/examples/linking.py#L20
Thanks! This was indeed the issue, works perfectly now!
bjorn3 has marked this topic as resolved.
Last updated: Nov 22 2024 at 17:03 UTC