Hi, I originally posted this in https://bytecodealliance.zulipchat.com/#narrow/stream/356481-wasi-cloud/topic/Runtime.20panic.20building.20a.20component.20utilizing.20.60wasi-http.60, but after further inspection it seems that this stream may be a better fit, in fact.
I'm trying to build a component exporting wasi-http
incoming-handler
, any mention of that interface in the world causes a runtime panic in wit-component
. On further inspection I see that it fails to encode write-via-stream
.
Note, that building a component only using other interfaces, e.g. random
or logging
works just fine. I am currently trying to trim down the interface to see what exactly is causing this import encoding and failure to do so.
Meanwhile, maybe someone has an idea about what could be wrong?
Issue: https://github.com/bytecodealliance/wasm-tools/issues/967
Repro: https://github.com/rvolosatovs/wasi-http-guest-repro
Ok, that turned out to be simpler than I thought:
default interface streams {}
default world guest {
import streams: self.streams
}
This is an example causing a panic
Filed a PR with a (temporary) fix https://github.com/WebAssembly/wasi-http/pull/21
@Roman Volosatovs thanks for filing the wasm-tools issue; hopefully we can implement a fix for it soon. I think the best thing to do here is, rather than modifying anything in WASI preview2 to work around it, don't mix a preview2 adapter with a component that also directly uses preview2 in its world (or any conflicting names...). i know that's pretty inconvenient, but it should work around the issue in wit-component until a proper fix can be made
Last updated: Nov 22 2024 at 16:03 UTC