Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: Support multiple package in a single WIT #325

Open
Mossaka opened this issue Jul 28, 2024 · 4 comments
Open

request: Support multiple package in a single WIT #325

Mossaka opened this issue Jul 28, 2024 · 4 comments

Comments

@Mossaka
Copy link
Member

Mossaka commented Jul 28, 2024

relevent upstream work:

bytecodealliance/wasm-tools#1577
bytecodealliance/wit-bindgen#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 
@kate-goldenring
Copy link

I am happy to take a look at this

@macovedj
Copy link
Collaborator

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.

@macovedj
Copy link
Collaborator

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.

@kate-goldenring
Copy link

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:

pub fn package_name(&self) -> &PackageName {

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`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants