Stream: git-wasmtime

Topic: wasmtime / issue #12691 v42.0.1: Precompiled cwasm for aa...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 20:37):

shuidi9527-source opened issue #12691:

Test Case

A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:

// src/lib.rs
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
    a + b
}

Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm

Steps to Reproduce

wasmtime compile \
  --target aarch64-linux-android \
  -o test.cwasm \
  ./target/wasm32-wasip1/release/test.wasm
#include <wasmtime.hh>
#include <vector>
#include <fstream>

int main() {
    std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate);
    std::streamsize size = file.tellg();
    file.seekg(0, std::ios::beg);
    std::vector<uint8_t> cwasm_bytes(size);
    file.read((char*)cwasm_bytes.data(), size);

    wasmtime::Config config;
    config.wasm_threads(false);
    config.wasm_bulk_memory(true);
    wasmtime::Engine engine(config);

    auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes);
    if (!module_res) {
        std::cerr << "Error: " << module_res.err().message() << std::endl;
        return 1;
    }
    return 0;
}

Expected Results

Deserialization succeeds with no errors.

Actual Results

Versions and Environment

Extra Info

v40.0.0: works correctly (no concurrency flag)

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 20:37):

shuidi9527-source added the bug label to Issue #12691.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 22:11):

fitzgen commented on issue #12691:

You need to configure with -W threads=n/config.wasm_threads(false) when pre-compiling the Wasm if you want to run that pre-compiled Wasm with -W threads=n/config.wasm_threads(false). Wasmtime will not keep track of which Wasm features a binary actually uses, only which Wasm features were enabled at compilation time.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 22:42):

shuidi9527-source closed issue #12691:

Test Case

A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:

// src/lib.rs
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
    a + b
}

Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm

Steps to Reproduce

wasmtime compile \
  --target aarch64-linux-android \
  -o test.cwasm \
  ./target/wasm32-wasip1/release/test.wasm
#include <wasmtime.hh>
#include <vector>
#include <fstream>

int main() {
    std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate);
    std::streamsize size = file.tellg();
    file.seekg(0, std::ios::beg);
    std::vector<uint8_t> cwasm_bytes(size);
    file.read((char*)cwasm_bytes.data(), size);

    wasmtime::Config config;
    config.wasm_threads(false);
    config.wasm_bulk_memory(true);
    wasmtime::Engine engine(config);

    auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes);
    if (!module_res) {
        std::cerr << "Error: " << module_res.err().message() << std::endl;
        return 1;
    }
    return 0;
}

Expected Results

Deserialization succeeds with no errors.

Actual Results

Versions and Environment

Extra Info

v40.0.0: works correctly (no concurrency flag)

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 22:42):

shuidi9527-source commented on issue #12691:

I tried it, but it didn't work.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 22:42):

shuidi9527-source deleted a comment on issue #12691:

I tried it, but it didn't work.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 22:43):

shuidi9527-source commented on issue #12691:

I tried it, but it didn't work.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2026 at 22:43):

shuidi9527-source reopened issue #12691:

Test Case

A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:

// src/lib.rs
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
    a + b
}

Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm

Steps to Reproduce

wasmtime compile \
  --target aarch64-linux-android \
  -o test.cwasm \
  ./target/wasm32-wasip1/release/test.wasm
#include <wasmtime.hh>
#include <vector>
#include <fstream>

int main() {
    std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate);
    std::streamsize size = file.tellg();
    file.seekg(0, std::ios::beg);
    std::vector<uint8_t> cwasm_bytes(size);
    file.read((char*)cwasm_bytes.data(), size);

    wasmtime::Config config;
    config.wasm_threads(false);
    config.wasm_bulk_memory(true);
    wasmtime::Engine engine(config);

    auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes);
    if (!module_res) {
        std::cerr << "Error: " << module_res.err().message() << std::endl;
        return 1;
    }
    return 0;
}

Expected Results

Deserialization succeeds with no errors.

Actual Results

Versions and Environment

Extra Info

v40.0.0: works correctly (no concurrency flag)

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2026 at 18:26):

alexcrichton commented on issue #12691:

@shuidi9527-source if you compile with -Wconcurrency-support=n does it produce an artifact you can load with the C API?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 05 2026 at 04:00):

shuidi9527-source commented on issue #12691:

thanks a lot for your help!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 05 2026 at 04:00):

shuidi9527-source closed issue #12691:

Test Case

A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:

// src/lib.rs
#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
    a + b
}

Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm

Steps to Reproduce

wasmtime compile \
  --target aarch64-linux-android \
  -o test.cwasm \
  ./target/wasm32-wasip1/release/test.wasm
#include <wasmtime.hh>
#include <vector>
#include <fstream>

int main() {
    std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate);
    std::streamsize size = file.tellg();
    file.seekg(0, std::ios::beg);
    std::vector<uint8_t> cwasm_bytes(size);
    file.read((char*)cwasm_bytes.data(), size);

    wasmtime::Config config;
    config.wasm_threads(false);
    config.wasm_bulk_memory(true);
    wasmtime::Engine engine(config);

    auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes);
    if (!module_res) {
        std::cerr << "Error: " << module_res.err().message() << std::endl;
        return 1;
    }
    return 0;
}

Expected Results

Deserialization succeeds with no errors.

Actual Results

Versions and Environment

Extra Info

v40.0.0: works correctly (no concurrency flag)


Last updated: Mar 23 2026 at 16:19 UTC