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
{{ message }}
Repository navigation
Cannot specify world to target for package referenced from a registry #399
I have a component that adds two numbers. It uses the adder world defined in ghcr.io/bytecodealliance/docs/adder:0.1.0. In my Cargo.toml, I get an error if I specify the world within the package i want to target. This happens to be redundant in this case as only the adder world exists in the package, but I would expect it to still be permitted.
[package.metadata.component.target]
# The registry which contains the packageregistry = "ghcr.io/bytecodealliance"# The package namepackage = "docs:adder"# The package versionversion = "0.1.0"# Adding the following incurs an erroworld = "adder"
Error during cargo component build --release:
error: failed to create a target world for package `adder` (/Users/kagold/Programs/component-docs/component-model/examples/tutorial/adder/Cargo.toml)
Caused by:
0: failed to selectworld from target package `docs:adder`
1: no world named `adder`in package
For now, i'll leave the world out but ill file an issue with cargo-component
WIT can be fetched
wkg get --format wit docs:adder@0.1.0 --output adder.wit --registry ghcr.io
So it looks to me like the issue might be that the wit you provided is different from the wit in the registry. When I look at the thing being fetched here, I see the following wit:
Activity
kate-goldenring commentedon May 1, 2025
I am using
cargo-component0.21.1macovedj commentedon May 8, 2025
So it looks to me like the issue might be that the wit you provided is different from the wit in the registry. When I look at the thing being fetched here, I see the following wit:
I am able to properly scaffold out a component using that world with the following command though:
cargo component new --lib --target docs:adder/root foowhere I had to use
rootto specify the world I wanted to target.After some discussion about how config should be addressed, we could probably use this when handling bytecodealliance/component-docs#255