bytecodealliance / ComponentizeJS

JS -> WebAssembly Component
Apache License 2.0
242 stars 32 forks source link

Unable to disable wasi:io/poll #159

Closed logaan closed 4 days ago

logaan commented 1 week ago

When I run jco componentize with --disable all or

      --disable clocks \
      --disable random \
      --disable http \
      --disable stdio \
      --disable stdio \

I still end up with a wasm file that imports wasi:io/poll.

jco version is 1.7.2. Running on macos.

My source file is:

const core = {
    foo() {
        return "bar";
    }
}

wit is

package example:core;

world example {
    export core: interface {
        foo: func() -> result;
    }
}

and build call is

jco componentize \
    target/public/cljs-out/main-wrap.js \
    --disable clocks \
    --disable random \
    --disable http \
    --disable stdio \
    --disable stdio \
    --wit src/example/core.bare.wit \
    --world-name example \
    --out wasm/core.bare.wasm

I'm using wepl to check .imports and seeing poll that way.

guybedford commented 1 week ago

Thanks for posting, I've transferred this to ComponentizeJS - may be an issue with the latest WASI update that we don't strip all the imports. We should get this fixed for the next release.

guybedford commented 4 days ago

This should now be resolved by https://github.com/bytecodealliance/ComponentizeJS/pull/162.

logaan commented 3 days ago

Thank you! I'll test it out next time there's a release.