Hey everyone!
I have sort of a niche use case, and I'm trying to build a component, which would essentially re-export the host exports (i.e. the component itself would export the wasi:cli/imports
world etc.)
Unfortunately, I hit:
interface transitively depends on an interface in incompatible ways
in Rust bindgen version 0.30 with:
package repro:component@0.1.0;
world component {
export wasi:io/poll@0.2.1;
export wasi:http/types@0.2.1;
}
I've summed up by observations here: https://github.com/bytecodealliance/wit-bindgen/issues/1043 and added a repro here: https://github.com/rvolosatovs/wit-bindgen-export-bug-repro
Curious is anyone has an idea of what might be going wrong here and if there's some way to fix it apart from manually implementing exports in the component?
Looks like perhaps I'm hitting an instance of https://github.com/WebAssembly/component-model/issues/208 ?
interestingly, this seems to work for wasi-virt: https://github.com/bytecodealliance/WASI-Virt/blob/c4512614d0bbe50044b93577099232c1701b06e2/wit/virt.wit#L5-L45 https://github.com/bytecodealliance/WASI-Virt/blob/c4512614d0bbe50044b93577099232c1701b06e2/virtual-adapter/src/lib.rs#L9-L13
:thinking:
The fix for this is to basically export more things. The problem is that the transitive dependencies of wasi:http/types
are imported. What ends up happening though is that wasi:io/poll
is both an import and an export in that case, but various types are wired up to the wrong places. What you're describing in theory could work but probably won't work the way you'd like it to.
In any case the interim solution is to export more interfaces so the transitive dependencies of wasi:http/types
are all exports as opposed to becoming implicitly imports
Thanks! I'll try that out
Last updated: Dec 23 2024 at 12:05 UTC