You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When rust wrappers include dependencies that use wasm-bindgen, even if these wasm-bindgen types do not cross the wasm/host boundary, they still make their way into the resulting wasm binary. This has been discussed and a proposed solution has been described here: polywrap/wrap-integrations#71
The "fix" that was described was implemented in this PR here: #988
This "fix" tells the wasm-bindgen CLI to remove itself from the module, and use wasm-interface-types in its place. These wasm-interface-types never make their way into the resulting wasm binary though, because again they do not cross the boundary. One final artifact of this though is that the wasm module has a "custom section" added to it that effectively says "wasm-interface-types has been used in this module". This is causing the following error to occur when running these wasm modules with Wasmtime: polywrap/python-client#39
Expected behavior
The module does not need the "wasm-interface-types" custom section, as it does not need interface types. This is simply an artifact from wasm-bindgen.
The text was updated successfully, but these errors were encountered:
Describe the bug
When rust wrappers include dependencies that use wasm-bindgen, even if these wasm-bindgen types do not cross the wasm/host boundary, they still make their way into the resulting wasm binary. This has been discussed and a proposed solution has been described here:
polywrap/wrap-integrations#71
The "fix" that was described was implemented in this PR here:
#988
This "fix" tells the wasm-bindgen CLI to remove itself from the module, and use wasm-interface-types in its place. These wasm-interface-types never make their way into the resulting wasm binary though, because again they do not cross the boundary. One final artifact of this though is that the wasm module has a "custom section" added to it that effectively says "wasm-interface-types has been used in this module". This is causing the following error to occur when running these wasm modules with Wasmtime: polywrap/python-client#39
Please provide the steps to reproduce and if possible a minimal demo of the problem.
Build a wrapper that uses wasm-bindgen dependencies, here is an example (sha3-wasm-rs wrapper): https://wrappers.io/v/ipfs/QmbYw6XfEmNdR3Uoa7u2U1WRqJEXbseiSoBNBt3yPFnKvi
Notice that Wasmtime looks for the "wasm-interface-types" custom section, and throws an error if it's present:
https://github.com/bytecodealliance/wasmtime/blob/0548952319d112ecffe519d7eb0fdf9bd10feec7/crates/environ/src/module_environ.rs#L631-L647
Now, inspect the wasm module downloaded above (sha3-wasm-rs), and see what custom sections are held within. Here is a simple program to do so:
This will output the following:
Expected behavior
The module does not need the "wasm-interface-types" custom section, as it does not need interface types. This is simply an artifact from wasm-bindgen.
The text was updated successfully, but these errors were encountered: