WAB plug and compose fails?
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...)
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
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
I get this same error too.
Is there any fix for this
Getting the same error. Defining --registry wa.dev solved it https://github.com/bytecodealliance/wac/issues/122.
Edit: This was another issue I was facing and caused the error to occur https://github.com/bytecodealliance/wac/issues/136