cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

Make composing packages with dependencies easier?

Open MarinPostma opened this issue 5 months ago • 3 comments

I am just getting started with components, I and find it quite cumbersome to import other components. Let me try to illustrate my problem.

I am creating a component, depending on wasi-http, as such:

package component:adhoc;

/// An example world for the component to target.
world my-component {
    include wasi:http/proxy;
}

and I'm importing the http component like that:

[package.metadata.component.target.dependencies]
"wasi:http" = { path = "../wasi-http/wit" }

Now the http component itself depends on other components:

wit
└── deps
    ├── cli
    ├── clocks
    ├── filesystem
    ├── io
    ├── random
    └── sockets

I would expect that importing wasi:http would recursively import its dependency, but I instead need to individually specify paths to all my dependency's dependencies.

Is that a current rough edge, or am I misusing cargo component completely?

MarinPostma avatar Sep 24 '24 19:09 MarinPostma