Skip to content

Update wasmtime to 50.0.1 - #394

Merged
martindevans merged 2 commits into
bytecodealliance:mainfrom
phillipcaofph:update-wasmtime-50
Nov 5, 2026
Merged

martindevans merged 2 commits into
bytecodealliance:mainfrom
phillipcaofph:update-wasmtime-50

Conversation

@phillipcaofph

@phillipcaofph phillipcaofph commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Includes these changes to support the new wasmtime version:

  • wasmtime_component_func_t gained a pointer field, so the managed mirror grows from 24 to 32 bytes.
  • Component-model async is on by default. Wasmtime’s async implementation isn’t compatible with .NET, so the Config constructor now always disables it. Leaving it on also crashed engine creation whenever reference types were disabled.
  • The component text format now requires the core keyword in canonical options, e.g. (memory (core memory $i "memory")) and (realloc (core func $i "realloc")).

- `wasmtime_component_func_t` gained a pointer field, so the managed mirror
  grows from 24 to 32 bytes. With the old size every component call read
  past the struct and crashed the process.
- Wasmtime now enables component-model async by default, and that feature
  requires reference types. `Config.WithReferenceTypes(false)` now also
  turns component-model async off, so the engine can still be created.
- The component text format now requires the `core` keyword in canonical
  options, e.g. `(memory (core memory $i "memory"))` and
  `(realloc (core func $i "realloc"))`. Updated the test fixture and the
  component example.
Comment thread src/Config.cs
public static extern void wasmtime_config_wasm_reference_types_set(Handle config, [MarshalAs(UnmanagedType.I1)] bool enable);

[DllImport(Engine.LibraryName)]
public static extern void wasmtime_config_wasm_component_model_async_set(Handle config, [MarshalAs(UnmanagedType.I1)] bool enable);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that we probably need to always unconditionally disable component async. The way that wasmtime implements async is incompatible with dotnet :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to always disabled.

Wasmtime's async implementation isn't compatible with .NET, so the Config
constructor turns component-model async off rather than only doing so when
reference types are disabled.

@martindevans martindevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for working on this

@martindevans
martindevans merged commit 4aac1a5 into bytecodealliance:main Nov 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants