wac icon indicating copy to clipboard operation
wac copied to clipboard

WAB plug and compose fails?

Open Bab64 opened this issue 1 year ago • 5 comments

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 avatar Jan 14 '25 07:01 Bab64

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

Bab64 avatar Jan 14 '25 08:01 Bab64

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

Bab64 avatar Jan 14 '25 08:01 Bab64

I get this same error too.

celinesantosh98 avatar Mar 06 '25 16:03 celinesantosh98

Is there any fix for this

celinesantosh98 avatar Mar 06 '25 16:03 celinesantosh98

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

Back0fnGurke avatar Aug 05 '25 19:08 Back0fnGurke