bytecodealliance / bytecodealliance/wasmtime

Failed to instantiate the example world by component model

Open
#7,716 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

### Test Case

```
package component:matrix;

interface service {
enum flame-error {
internal,
}
type task-input = list;
type task-output = list;

record session-context {
session-id: string,
common-data: option>,
}

record task-context {
task-id: string,
session-id: string,
}

// handle request function
on-session-enter: func(ctx: session-context) -> result<_, flame-error>;
on-session-leave: func(ctx: session-context) -> result<_, flame-error>;
on-task-invoke: func(ctx: task-context, input: option) -> result, flame-error>;
}

// exports the interface
world flame {
export service;
}
```

### Steps to Reproduce

* build wasm `cargo component build -p matrix-server`
* build wasm main `cargo build -p matrix-local`
* run wasm main `./target/debug/matrix-local`

**References**:

* matrix-local: https://github.com/xflops/flame/pull/75/files#diff-448546749b6625cbca1a43c400f6d86637db5f014968c96ece09705e07f65c7c
* matrix-server (wasm): https://github.com/xflops/flame/pull/75/files#diff-e21ed78fa8d569631fed0fdddc6c99d585fc4d25806da0c7c00c4ebb2bacc8e9

### Expected Results

Execute the callbacks accordingly, e.g. on_session_enter.

### Actual Results

```
$ ./target/debug/matrix-local
Error: Internal("Failed to instantiate the flame world")
```

### Versions and Environment

Wasmtime version or commit:
```
wasmtime = "16"
wasmtime-wasi = "16"
anyhow = "1"
```

```
$ rustc --version
rustc 1.74.1 (a28077b28 2023-12-04)
$ cargo --version
cargo 1.74.1 (ecb9851af 2023-10-18)
```

Operating system: `Ubuntu 22.04`

Architecture: x86

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.