Coder Social home page Coder Social logo

Comments (5)

FrankReh avatar FrankReh commented on June 16, 2024

I was hoping to learn something by looking at this problem. For now, all I can do is confirm the cargo component build step from the binary importer directory fails, as stated above, confirm that the command wasm-tools validate <exporter wasm> succeeds, show the two wit files involved, and ask a question about the cargo-component test harness.

The exporter library's wit file:

exporter $ cat wit/test.wit 
package test:[email protected];

interface exports {
    resource my-resource {
        get-static: static func() -> string;
    }
}

world example {
    export exports;
}

The importer binary's wit file:

importer $ cat wit/test.wit 
package test:[email protected];

world my-world {
    import test:exporter/[email protected];
}

Can the cargo-component test harness be used to create and test this kind of scenario, where one build creates a Wasm component library, and another build would have to compose using it?

from cargo-component.

FrankReh avatar FrankReh commented on June 16, 2024

I've gotten as far as seeing where the deepest code check is failing.

Here a field that is still empty is checked whether it contains the resource name. If I comment out this test, the component builds successfully.

https://github.com/bytecodealliance/wasm-tools/blob/df542a839b1fc6c1345c68abf5da21ca9ef5f9fe/crates/wasmparser/src/validator/component.rs#L3162-L3170

I don't know why the all_resource_names field is empty so maybe the test is wrong but maybe something should have gotten the "my-resource" name added.

from cargo-component.

peterhuene avatar peterhuene commented on June 16, 2024

This should be fixed once cargo-component updates to a wit-component containing bytecodealliance/wasm-tools#1530

from cargo-component.

FrankReh avatar FrankReh commented on June 16, 2024

@toadslop Nice reproducer. Made it very easy to look into.

from cargo-component.

toadslop avatar toadslop commented on June 16, 2024

You're welcome! Thanks for all the hard work on this great project!

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.