request: Support multiple package in a single WIT
relevent upstream work:
https://github.com/bytecodealliance/wasm-tools/pull/1577 https://github.com/bytecodealliance/wit-bindgen/pull/978
It seems like the latest research of cargo-component does not support multi-packages in WITs.
Caused by:
0: failed to parse local target from directory `/Users/mossaka/Developer/mossaka/hello-component-wasi-http-part2/wit`
1: expected ';', found '{'
--> /Users/mossaka/Developer/mossaka/hello-component-wasi-http-part2/wit/wasi_http.wit:1:23
|
1 | package wasi:[email protected] {
| ^
(base) ➜ hello-component-wasi-http-part2
I am happy to take a look at this
Also happy to help out with this. I helped a bit with some of the more recent changes for multi-package WIT stuff. I wouldn't be surprised if there are additional changes that need to be made in wit-bindgen.
Also looking again, I'm curious if the example was written before or after this change. It looks like this example may not have a root package declaration, which is required after the linked change.
It may have been from before; however, even with the root package declaration, cargo component fails to compile the app, in part because it assumes the name of each dependency is that of the package group's root package: https://github.com/bytecodealliance/cargo-component/blob/faf251f74909f086ae3ef85858e11c612ae25b94/crates/core/src/registry.rs#L387
error: failed to create a target world for package `baz` (/Users/kagold/Programs/cargo-component/_scratch/baz/Cargo.toml)
Caused by:
duplicate definitions of package `root:root` found while decoding target dependency `bar:baz`