bytecodealliance / bytecodealliance/cargo-component

Secondary target dependencies

Open
#259 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
593
Forks
68
PR merge metrics
No merged PRs in 30d

Description

Is it expected that the user need to add `wit` files of secondary dependencies into `Cargo.toml`?

For example, in this modified tutorial example (https://github.com/minghuaw/wasm-component-tutorial), `package component:calculator` imports `component:add/add` and `component:sub/sub`, and the corresponding wit files are included in the `Cargo.toml` file as follows

```toml
# calculator/Cargo.toml
[package.metadata.component.target.dependencies]
"component:add" = { path = "../add/wit/world.wit" }
"component:sub" = { path = "../sub/wit/world.wit" }
```

However, when importing `component:calculator/calculate` into `package component:command`, it would generate an error with

```toml
# command/Cargo.toml
[package.metadata.component.target.dependencies]
"component:calculator" = { path = "../calculator/wit/world.wit" }
```

but works fine if the above section is changed to

```toml
[package.metadata.component.target.dependencies]
"component:add" = { path = "../add/wit/world.wit" }
"component:sub" = { path = "../sub/wit/world.wit" }
"component:calculator" = { path = "../calculator/wit/world.wit" }
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.