Coder Social home page Coder Social logo

Comments (7)

esoterra avatar esoterra commented on May 26, 2024 1

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.

esoterra avatar esoterra commented on May 26, 2024

What does your Cargo.toml look like?

from cargo-component.

sehz avatar sehz commented on May 26, 2024
[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.

esoterra avatar esoterra commented on May 26, 2024

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.

sehz avatar sehz commented on May 26, 2024

I am just running cargo component build.

from cargo-component.

peterhuene avatar peterhuene commented on May 26, 2024

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.

sehz avatar sehz commented on May 26, 2024

The explanation makes sense. Closing this

from cargo-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.