Fix Windows interop and toggle dev ABI with DevBuild#355
Fix Windows interop and toggle dev ABI with DevBuild#355tomohisa wants to merge 3 commits intobytecodealliance:mainfrom
Conversation
| Unreachable = 9, | ||
| /// <summary>The trap was the result of interrupting execution.</summary> | ||
| Interrupt = 10, | ||
| #if WASMTIME_DEV |
There was a problem hiding this comment.
I can't see any mention in the wasmtime docs that these traps only exist in dev builds. Are you certain this is correct?
There was a problem hiding this comment.
Thanks for checking. I agree this isn’t about ‘dev‑only’ traps. The issue is ABI layout: the C API enum in trap.h lists entries without explicit numeric assignments, so the ordinal values are defined by order and can shift when new variants are inserted. docs.wasmtime.dev
The Rust docs also note that C‑API values and Rust trap codes must be kept in sync and that the enum is non‑exhaustive. rustdocs.bsx.fi That’s why #if WASMTIME_DEV currently selects the ABI layout that matches the Wasmtime build being linked. I’m open to making this more explicit (e.g., WASMTIME_TARGET_VERSION=35 vs =dev), but the immediate goal is to avoid ABI mismatches so latest builds don’t fail by default.
Summary
Why
CI runs with DevBuild=true (wasmtime-dev), which requires dev ABI layouts.
This fixes test-host crashes such as
unknown wasmtime_valkind_t.Tests
dotnet test Wasmtime.sln