Comments (7)
Not including the components own identity in the Wasm is, from the view of the registry security design, intentional and a feature. A given component binary can't be trusted to assert its own identity without context/verification and many kinds of vulnerabilities can arise from trusting them to do so.
from cargo-component.
What does your Cargo.toml look like?
from cargo-component.
[package]
name = "operator-guest"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[package.metadata.component]
package = "component:my-component"
[package.metadata.component.dependencies]
[dependencies]
cargo-component-bindings = { git = "https://github.com/bytecodealliance/cargo-component" }
from cargo-component.
I would bet that whatever tool you're using to generate the WIT that corresponds to your components type is choosing the root:component
package name for it arbitrarily.
Components don't intrinsically know their own name or the name of the world they were built against because the name of a component depends on how/where it's published and a given component is compatible with any world matching its type not just the one it was built against. What they do record internally is the identity of the interfaces they import and export, which is why the interfaces in the generated WIT do track your original identifiers.
from cargo-component.
I am just running cargo component build
.
from cargo-component.
I would bet that whatever tool you're using to generate the WIT that corresponds to your components type is choosing the root:component package name for it arbitrarily.
That's correct. wit-component
chooses an arbitrary name for the package when decoding a component because the original package name is not encoded in the wasm.
I think we should probably be encoding the package name in the file header of the wasm (as opposed to, say, the names
custom section), as technically the package
directive in WIT has semantic meaning.
We should probably file an issue with the component model proposal.
from cargo-component.
The explanation makes sense. Closing this
from cargo-component.
Related Issues (20)
- Error building when using cargo-component `bindings` instead of `wit-bindgen` HOT 1
- `cargo component check --workspace` should not generate bindings for workspace members without `[package.metadata.component]` set HOT 2
- `cargo-component` is not acquring a file lock for componentization
- Document the schema of the cargo-component Cargo.toml configuration HOT 1
- Hello world example fails when project name contains underscore HOT 1
- Add a `cargo component serve` subcommand that uses a default runner of `wasmtime serve`
- wit pubilsh --init fails to register the WIT package to wa.dev, while it successfully create a pacakge on the registry HOT 4
- Build fails with 'failed to create a target world for package ...' HOT 2
- Use something like nightly.link or a non-re-published release to avoid excess notifications
- Build error: `error: string size out of bounds (at offset {offset})` HOT 10
- Additional `import`s in generated component HOT 2
- Resource Static Methods Cause Build Failure When Imported HOT 5
- Wit package name/version validated against registry publishes
- Some wasi imports added per default into wit HOT 2
- cargo install cargo-component error HOT 5
- Compile error when installing cargo component HOT 7
- Minimum Supported Rust Version (MSRV)
- Bindings are sometimes incorrectly generated type + `Borrow` suffix vs `&` type HOT 2
- `cargo component add` not producing runnable/usable binaries
- Cargo Component install give error in RPI 4 (ARM CORTEX-A72) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-component.