bytecodealliance / bytecodealliance/wasmtime

wasmtime explore doesn't support cross-compiling

Open
#6,717 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 16h
Merged PRs (30d)
135

Description

### Steps to Reproduce

```
cargo run --features all-arch -- explore --target riscv64 crates/c-api/wasm-c-api/example/hello.wasm
```

If your native host is actually a `riscv64` system, replace the target with something else such as `x86_64`.

### Expected Results

```
Exploration written to crates/c-api/wasm-c-api/example/hello.explore.html
```

### Actual Results

```
Error: compilation settings are not compatible with the native host

Caused by:
target 'riscv64-unknown-unknown' specified in the configuration does not match the host
```

### Versions and Environment

Wasmtime version or commit: c34567cdddc483d6bdf6a7b04c43026174eef5bf

Operating system: Linux

Architecture: x86-64

### Extra Info

Based on the error messages, apparently `wasmtime explore` winds up in `Engine::check_compatible_with_native_host` by way of `Module::from_binary`. I don't understand why this mode would use that path though.

Found this together with @michelledaviest while trying to understand some profiling results.

Contributor guide

Open the contributing guide

Research direction

Start by running the reported `cargo run --features all-arch -- explore --target riscv64 crates/c-api/wasm-c-api/example/hello.wasm` command and trace how `wasmtime explore` reaches `Module::from_binary` and `Engine::check_compatible_with_native_host`. Determine why exploration requires native-host compatibility. Done means the command supports a non-native target and writes `crates/c-api/wasm-c-api/example/hello.explore.html` as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
cli, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.