Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAB plug and compose fails? #148

Open
Bab64 opened this issue Jan 14, 2025 · 2 comments
Open

WAB plug and compose fails? #148

Bab64 opened this issue Jan 14, 2025 · 2 comments

Comments

@Bab64
Copy link

Bab64 commented Jan 14, 2025

Hi,
I've tested the 'hello' example with my installation and it works... Thanks for building WAC! However, I'm not able to run the following example:

package bab:compound; // Compound.wit
world compound-world {
    export compound-interface: interface { // Inline def. of interface...
        compound-function: func();
    }
}

/**/

package bab:composite; // 'Composite.wit'
world composite-world { // a.k.a. "socket" component
    import compound-interface: interface { // Inline def. of interface...
        compound-function: func();
    }
}

/ Transform wit into wasm: /

wasm-tools component wit --wasm -o ./composition/Compound.wasm ./composition/Compound.wit
wasm-tools component wit --wasm -o ./composition/Composite.wasm ./composition/Composite.wit

/ Compose with 'plug': /
wac plug --plug ./composition/Compound.wasm ./composition/Composite.wasm -o ./composition/Composition.wasm
/* Error message is: */
error: the socket component had no matching imports for the plugs that were provided

I've feeling that the error message is "wrong" because the "compound-interface" matches? Thanks for any help... Regards.
PS: wac compose does NOT work as well (open an other issue on that...)

@Bab64
Copy link
Author

Bab64 commented Jan 14, 2025

Here is the scenario with wac compose:
wac compose ./composition/Composition.wac --deps-dir . -o ./composition/Composition.wasm
WAC config. file:

package barbierdarnal-com:composition; // 'Composition.wac'
// Instantiate `compound`:
let compound = new composition:compound-world { ... }; // '...' is syntax! => import
// Instantiate `composite` by stuffing imported `compound-interface` by means of exported `compound-interface` of `compound`:
let composite = new composition:composite-world {compound-interface: compound.compound-interface, ... };

/* Error message: */
error: failed to resolve document

× failed to create registry client: no home registry registry server URL is configured

1 similar comment
@Bab64
Copy link
Author

Bab64 commented Jan 14, 2025

Here is the scenario with wac compose:
wac compose ./composition/Composition.wac --deps-dir . -o ./composition/Composition.wasm
WAC config. file:

package barbierdarnal-com:composition; // 'Composition.wac'
// Instantiate `compound`:
let compound = new composition:compound-world { ... }; // '...' is syntax! => import
// Instantiate `composite` by stuffing imported `compound-interface` by means of exported `compound-interface` of `compound`:
let composite = new composition:composite-world {compound-interface: compound.compound-interface, ... };

/* Error message: */
error: failed to resolve document

× failed to create registry client: no home registry registry server URL is configured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant