Make host callback import opt-in#24
Conversation
|
/claim #23 |
|
Thanks for your changes. |
|
Thanks for testing it and for catching the |
|
Thanks again for the changes. |
|
Thanks for retesting. I pushed another follow-up for the The previous The latest commit changes On the size difference: I think that is separate from this PR, since you saw it before these changes too. This patch is focused on matching the hosted artifact's loader behavior more closely: no extra |
|
Hi, unfortunately, there is a different error now: |
|
Thanks for testing again, and thanks for the kind note. I pushed another fix that targets the The latest commits track rewind locally around I verified the branch with a temporary GitHub-hosted Docker workflow: it built the image, extracted While wiring that up I also fixed the build blockers that were preventing the workflow path from reaching the runtime smoke test ( |
|
Thanks again. Now there is another error: |
|
I opened #28 as a clean follow-up branch for the latest |
Summary
Fixes #23.
The current default build always imports env.call_host_function, because host_call_function is declared as a required import even when the browser/runtime never uses zeroperl_register_function or zeroperl_register_method.
That makes a README-built zeroperl.wasm fail in wrappers that instantiate the hosted zeroperl-1.0.0.wasm with only WASI imports, including the metadata.jp wrapper path described in the issue.
This PR makes host callbacks opt-in:
Verification
I compared the known-working hosted artifact used by the browser wrapper:
js const bytes = fs.readFileSync('C:/tmp/zeroperl-1.0.0.wasm'); const mod = new WebAssembly.Module(bytes); console.log(WebAssembly.Module.imports(mod));It imports only wasi_snapshot_preview1.* functions and no env.call_host_function.
I also ran:
�ash git diff --checkI could not run the full Docker build locally in this Windows environment because Docker is not installed here, but the change is limited to the existing build flags and C preprocessor guards.