You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ wasm-tools compose root.wat -d dep.wat -o foo.wasm
[2023-07-26T20:54:37Z WARN ] instance `foo:bar/c` will be imported because a dependency named `foo:bar/c` could not be found
thread 'main' panicked at 'failed to find alias of TypeId { index: 0, type_size: 1, unique_id: 1 }', /Users/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-compose-0.4.0/src/encoding.rs:660:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The problem here is that despite A/B being virtualized the final component needs to import C which depends on A, which means that at least the type information from A needs to be imported. Currently though wasm-compose deduces that A/B are provided by the component instantiation, so only C is imported. This means that during the import of C it asserts that its type information was already imported, which isn't true in this case, thus the panic.
Fixing this will require updates to the dependency graph in wasm-compose and probably the encoding phase too because only the types from A need to be imported to import C.
The text was updated successfully, but these errors were encountered:
This also has first become evident after my refactoring in #1141
guybedford
changed the title
Panic on "failed to find alias" during composition
Better error message for panic on "failed to find alias" during composition
Aug 9, 2023
I've renamed the title of this issue to be "better error message", as the implementation seems correct, but having debugging information available as to what subsystem needs to be included would be very helpful to be able to debug this in wasi virt workflows.
Given this input as
root.wat
:and this input as
dep.wat
:then the panic is with:
The problem here is that despite A/B being virtualized the final component needs to import C which depends on A, which means that at least the type information from A needs to be imported. Currently though
wasm-compose
deduces that A/B are provided by the component instantiation, so only C is imported. This means that during the import of C it asserts that its type information was already imported, which isn't true in this case, thus the panic.Fixing this will require updates to the dependency graph in
wasm-compose
and probably the encoding phase too because only the types from A need to be imported to import C.The text was updated successfully, but these errors were encountered: