bytecodealliance / bytecodealliance/wasm-tools

wasm-component generate components for modules with host function imports

Open
#2,185 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

Say I have an existing module like this:

```wat
(module
(import "env" "host_function" (func $host_function (result i32)))
(func $call_host_function (result i32) call $host_function)
(export "call_host_function" (func $call_host_function))
)
```

Running the component cli I get:

```sh
wasm-tools component new host_function.wasm -o host_function_component.wasm
error: failed to encode a component from module

Caused by:
0: failed to decode world from module
1: module was not valid
2: module requires an import interface named `env`
```
The vast majority of imports are host functions and are not provided by other modules, in these cases using the type signature of the import it should be possible to generate any worlds/interfaces needed (like env in this case)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.