Skip to content

Releases: bytecodealliance/wasmtime

dev: Remove need for explicit `Config::async_support` knob (#12371)

28 Sep 20:31
cc8d04f

Choose a tag to compare

* Refactor component model host function definitions

Push the `async`-ness down one layer.

* Remove need for explicit `Config::async_support` knob

This commit is an attempt to step towards reconciling "old async" and
"new async" in Wasmtime. The old async style is the original async
support in Wasmtime with `call_async`, `func_wrap_async`, etc, where the
main property is that the store is "locked" during an async operation.
Put another way, a store can only execute at most one async operation at
a time. This is in contrast to "new async" support in Wasmtime with the
component-model-async (WASIp3) support, where stores can have more than
one async operation in flight at once.

This commit does not fully reconcile these differences, but it does
remove one hurdle along the way: `Config::async_support`. Since the
beginning of Wasmtime this configuration knob has existed to explicitly
demarcate a config/engine/store as "this thing requires `async` stuff
internally." This has started to make less and less sense over time
where the line between sync and async has become more murky with WASIp3
where the two worlds comingle. The goal of this commit is to deprecate
`Config::async_support` and make the function not actually do anything.

In isolation this can't simply be done, however, because there are many
load-bearing aspects of Wasmtime that rely on this `async_support` knob.
For example once epochs + yielding are enabled it's required that all
Wasm is executed on a fiber lest it hit an epoch and not know how to
yield. That means that this commit is not a simple removal of
`async_support` but instead a refactoring/rearchitecting of how async is
used internally within Wasmtime. The high-level ideas within Wasmtime
now are:

* A `Store` has a "requires async" boolean stored within it.
* All configuration options which end up requiring async, such as
  yielding with epochs, turn this boolean on.
* Creation of host functions which use async
  (e.g. `func_wrap_{async,concurrent}`) will also turn this option on.
* Synchronous API entrypoints into Wasmtime ensure that this boolean is
  disabled.
* Asynchronous APIs are usable at any time.

This means that the concept of an async store vs a sync store is now
gone. All stores are equally capable of executing sync/async, and the
change now is that dynamically some stores will require that async is
used with certain configuration. Additionally all panicking conditions
around `async_support` have been converted to errors instead. All
relevant APIs already returned an error and things are murky enough now
that it's not necessarily trivial to get this right at the embedder
level. In the interest of avoiding panics all detected async mismatches
are now first-class `wasmtime::Error` values.

The end result of this commit is that `Config::async_support` is a
deprecated `#[doc(hidden)]` function that does nothing. While many
internal changes happened as well as having new tests for all this sort
of behavior this is not expected to have a great impact on external
consumers. In general a deletion of `async_support(true)` is in theory
all that's required. This is intended to make it easier to think about
async/sync/etc in the future with WASIp3 and eventually reconcile
`func_wrap_async` and `func_wrap_concurrent` for example. That's left
for future refactorings however.

prtest:full

* Review comments

* Fix CI failures

v41.0.0: Release Wasmtime 41.0.0 (#12373)

20 Jan 18:02
Immutable release. Only release title and notes can be modified.
3dda916

Choose a tag to compare

41.0.0

Released 2026-01-20.

Added

  • Support for {Future,Stream}Any in the component model has improved.
    #12142

  • Wasmtime has initial support for breakpoints and single-stepping with the
    debug feature for guest programs.
    #12133

  • Wasmtime has begun adding a new Error type which is similar to
    anyhow::Error but supports gracefully handling OOM. Wasmtime still uses
    anyhow::Error but this will change in the future to wasmtime::Error which
    will be a distinct type.
    #12163

  • An initial top-level crate for async-debugging guest programs has been added.
    #12183

Changed

  • Cranelift now optimizes redundant select + icmp instructions.
    #12135

  • Synchronous component model functions can no longer block before returning.
    This implements a change in the upstream specification to the upcoming async
    support in the component model which places stricter restrictions on
    non-async functions and their ability to perform blocking operations.
    #12043

  • Frame iteration in debug mode now visits all activations which enables
    seeing all frames from recursive wasm calls.
    #12176

  • Wasmtime now requires Rust 1.90.0 or later.
    #12167

  • Intra-component stream/future reads/writes are now allowed for simple data
    types.
    #12181

  • The POLL callback code has been removed from the canonical ABI for async
    functions and the waitable-set.poll function no longer yields.
    #12182

  • Guest-to-guest adapters injected by Wasmtime now have improved trapping error
    messages.
    #12215

Fixed

  • #[derive(Lift)] for enums with exactly 256 cases has been fixed.
    #12140

  • With component-model-async support recursively calling a guest from a host
    function has now been fixed.
    #12152

v40.0.2: Release Wasmtime 40.0.2 (#12346)

14 Jan 17:29
Immutable release. Only release title and notes can be modified.
bb9ef67

Choose a tag to compare

40.0.2

Released 2026-01-14.

Fixed

  • A possible stack overflow in the x64 backend with cmp emission has been
    fixed.
    #12333

  • Some ISLE optimization rules which created erroneous IR for vector inputs have
    been fixed.
    #12179
    #12335

  • The x64 lowering of shld has been fixed for some edge caxes.
    #12321

v39.0.2: Release Wasmtime 39.0.2 (#12347)

14 Jan 17:05
Immutable release. Only release title and notes can be modified.
f66a5b6

Choose a tag to compare

39.0.2

Released 2026-01-14.

Fixed

  • A possible stack overflow in the x64 backend with cmp emission has been
    fixed.
    #12333

v36.0.4: Release Wasmtime 36.0.4 (#12348)

14 Jan 17:16
Immutable release. Only release title and notes can be modified.
0489f91

Choose a tag to compare

36.0.4

Released 2026-01-14.

Fixed

  • A possible stack overflow in the x64 backend with cmp emission has been
    fixed.
    #12333

v40.0.1: Release Wasmtime 40.0.1 (#12271)

07 Jan 23:22
Immutable release. Only release title and notes can be modified.
918e5dc

Choose a tag to compare

40.0.1

Released 2026-01-07.

Changed

  • This release is a test of Wasmtime's CI-based crate publishing infrastructure.
    Wasmtime is switching to crates.io-based trusted publishing for this release
    and is testing that everything works.
    #12257

v40.0.0: Release Wasmtime 40.0.0 (#12192)

22 Dec 16:10
Immutable release. Only release title and notes can be modified.
0807b00

Choose a tag to compare

40.0.0

Released 2025-12-20.

Added

  • WASIp3 support for wasi:http now implements Response::from_http to convert
    from standard Rust types to WASI types.
    #12063

  • Cranelift now supports a "patchable" ABI which has a maximum number of
    arguments and clobbers no registers. This is paired as well with a new
    patchable_call instruction which supports being turned into NOPs at runtime.
    #12061
    #12101

Changed

  • Support for the WebAssembly threads proposal is now classified as tier 2 by
    default. Additionally creation of SharedMemory is disabled by deafult behind
    a new config knob/CLI flag.
    #12036

  • A variety of peephole-style optimizations have been added to Cranelift's
    optimization passes.
    #11994
    #11995
    #11996
    #11997
    #11998
    #11999
    #12000
    #12006
    #12008

  • Component host functions have been slightly optimized to remove an Arc clone
    and reduce contention.
    #11987

  • Support for component-model-async has been updated to account for the
    changes specified in WebAssembly/component-model#578.
    This means that historical binaries using WASIp3, for example, are no longer
    valid. Recompilation of historical components will be required and
    source-level changes may also be required in some circumstances.
    #12031
    #12043

  • The UnsyncBoxBody type is now used everywhere in wasmtime-wasi-http instead
    of just in the wasip3 support.
    #12060

  • Initial groundwork for gracefully handling OOM (e.g. returning an error
    instead of aborting) has been added.
    #12070
    #12089

  • Wasmtime will create a private copy of code memory when guest debugging is
    enabled to assist with modifying code when adding/removing breakpoints.
    #12051

  • The ResourceTable type will no longer use Tombstone when compiled in debug
    mode.
    #12114

  • Intra-component future/stream reads/writes will now trap instead of
    accidentally being allowed.
    #12117

  • Cranelift optimization rules have been tweaked after it was discovered that
    they could pessimize code containing long chains of computations.
    #12116

Fixed

  • Compilation of i8x16.popcnt has been fixed in Winch for some potential
    inputs.
    #12010

  • A panic in Instance::prepare_call for some component-model-async situations
    has been fixed.
    #12054

  • An off-by-one error for lifting/lowering enums/variants with 255 cases has
    been fixed.
    #12066

  • Restarting the read of a host future after cancellation has been fixed.
    #12093

  • Compilation for OpenBSD on x86_64 has been fixed.
    #12097

  • Components containing a module type which exoprts a tag are now supported.
    #12125

v39.0.1: Release Wasmtime 39.0.1 (#12084)

24 Nov 19:29
Immutable release. Only release title and notes can be modified.
0163804

Choose a tag to compare

39.0.1

Released 2025-11-24.

Fixed

  • Compiling the debug feature without the gc feature enabled has been fixed.
    #12074

v39.0.0: Release Wasmtime 39.0.0 (#12050)

20 Nov 15:59
Immutable release. Only release title and notes can be modified.
56b81c9

Choose a tag to compare

39.0.0

Released 2025-11-20.

Added

  • Initial work has begun to support WebAssembly-level debugging natively in
    Wasmtime. This is intended to complement today's preexisting DWARF-level
    debugging, but this work will be portable and operate at the WebAssembly level
    of abstraction rather than the machine-level. Note that this work is not yet
    complete at this time but is expected to get filled out over the coming
    releases.
    #11768
    #11769
    #11873
    #11892
    #11895

  • The pooling allocator now exposes more metrics about unused slots.
    #11789

  • The Wizer and component-init projects have been merged into Wasmtime under
    a new wasmtime wizer CLI subcommand and wasmtime-wizer crate. This is
    mostly a drop-in replacement for both with a minor caveat that the
    initialization function is now called wizer-initialize instead of
    wizer.initialize to be compatible with components.
    #11805
    #11851
    #11853
    #11855
    #11857
    #11863
    #11866
    #11867
    #11877
    #11876
    #11878
    #11891
    #11897
    #11898

  • The Config::wasm_feature method is now public.
    #11812

  • Enabling the wasm exceptions proposal is now exposed in the C API.
    #11861

  • The wasmtime crate now has a custom-sync-primitives Cargo feature which
    enables using custom synchronization primitives defined by the embedder. This
    is useful in no_std targets where the default panic-on-contention primitives
    are not appropriate.
    #11836

  • Wasmtime now supports unsafe intrinsics to be used for compile-time builtins.
    This can be used to provide give low-level access to host APIs/memory to a
    guest program in a controlled fashion.
    #11825
    #11918

  • The signals_based_traps configuration option is now exposed in the C API.
    #11879

  • A new EqRef::from_i31 function has been added.
    #11884

  • The wasmtime serve subcommand will, by default, now reuse instances when
    used with WASIp3 components. This increases throughput and additionally
    showcases the concurrent features of WASIp3. This can be opted-out-of on the
    CLI as well.
    #11807

  • The C++ API for components has been filled out and implemented.
    #11880
    #11889
    #11988

  • A new ResourceDynamic type, similar to Resource<T>, has been added to
    support host resources that have a dynamic tag at runtime rather than a
    statically known tag at compile time. This is then used to implement resources
    in the C/C++ API as well.
    #11885
    #11920

  • The C/C++ API of Wasmtime now supports the custom-page-sizes wasm proposal.
    #11890

  • Initial support has been added for the cooperative multithreading component
    model proposal in Wasmtime, built on async primitives.
    #11751

  • The epoch_deadline_callback Rust API has been bound in C++.
    #11945

  • A new Request::into_http helper has been added to the WASIp3 implementation
    of wasi:http.
    #11843

  • A define_unknown_imports_as_traps function has been added to the C API.
    #11962

  • A callback-based implementation of stdout and stderr has been added to the
    C API for WASI configuration.
    #11965

Changed

  • Running async functions in the component model now operates at the
    Store-level of abstraction rather than an Instance.
    #11796

  • The wasmtime serve subcommand no longer mistakenly spawns an epoch thread
    per-request and instead uses a single epoch thread.
    #11817

  • The component-model-async Cargo feature is now on-by-default. Note that it
    is still gated at runtime by default. Also note that Wasmtime 39 does not include
    #12031 which means
    that components using async produced with the latest wasm-tools will not run
    in Wasmtime 39. To run async components it's recommended to pin to a
    historical version of wasm-tools and guest toolchains for now.
    #11822

  • Bindings generated by wiggle no longer use async_trait.
    #11839

  • Wasmtime's documentation now has an example of a plugin system using Wasmtime.
    #11848

  • Profiling with perfmap or jitdump now uses O_APPEND to be more amenable to
    other engines in the same process also using perfmap/jitdump.
    #11865

  • The wasmtime-wasi-http crate now uses UnsyncBoxBody to clarify that Sync
    is not required.
    #11941

  • A . character is now used instead of / int he bindgen! macro to separate
    interface members.
    #11947

  • The func_new function for component linkers now provides the type to the
    callee so it knows the type that the component that imported it is using.
    #11944

  • The component::Func type now has a type accessor and the old params/result
    accessors were deleted.
    #11943

  • Wasmtime now requires Rust 1.89.0 or later to compile.
    #11959

Fixed

  • Some panics handling shapes of components with resources in various locations
    has been fixed.
    #11798

  • Bitwise float operations in Cranelift have been fixed on aarch64.
    #11811

  • An off-by-one in the bounds check of wasm atomic operations has been fixed.
    #11977

  • Bounds-check elision now happens again with 4 GiB guard pages.
    #11973

v38.0.4: Release Wasmtime 38.0.4 (#12024)

11 Nov 19:12
Immutable release. Only release title and notes can be modified.
4c22e15

Choose a tag to compare

38.0.4

Released 2025-11-11.

Fixed