Stream: wasmtime

Topic: Debugging new wasi-interfaces


view this post on Zulip Mats Brorsson (Jun 17 2025 at 18:49):

So, I have written an experimental wasi interface and integrated it in wasmtime. I took wasi-keyvalue as an example and tried to replicate it.

I have built a component that imports that interface. I copied the wit from the wasmtime crate that implements the host and am trying to run it the following way, and with the resulting error message:

$ wasmtime run --invoke 'run-matrix-example()' target/wasm32-wasip2/debug/matrix_client.wasm
Error: failed to run main module `target/wasm32-wasip2/debug/matrix_client.wasm`

Caused by:
    0: component imports instance `wasi:acc/host-allocator@0.2.0-draft`, but a matching implementation was not found in the linker
    1: instance export `allocate-buffer` has the wrong type
    2: function implementation is missing

I need help in how to debug the linking of functions between the component and the host implementation in wasmtime.

view this post on Zulip Alex Crichton (Jun 17 2025 at 19:24):

I think this may mean that src/commands/run.rs needs to be updated with an add_to_linker of the API you added?

view this post on Zulip Alex Crichton (Jun 17 2025 at 19:25):

e.g. something like this

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant - bytecodealliance/wasmtime

Last updated: Dec 06 2025 at 06:05 UTC