Skip to content

fix: add wasmtime flags! macro support for WIT flags types#1327

Draft
jsturtevant wants to merge 1 commit intomainfrom
rally/1318-wasm-guest-bindgen-macro-doesn-t-support-wit-flags
Draft

fix: add wasmtime flags! macro support for WIT flags types#1327
jsturtevant wants to merge 1 commit intomainfrom
rally/1318-wasm-guest-bindgen-macro-doesn-t-support-wit-flags

Conversation

@jsturtevant
Copy link
Contributor

@jsturtevant jsturtevant commented Mar 19, 2026

When is_wasmtime_guest is true, emit wasmtime::component::flags! macro invocations instead of plain structs with bool fields. This enables WIT flags types (e.g. from wasi:filesystem) to satisfy the wasmtime::component::Lift and wasmtime::component::Lower trait bounds.

The non-wasmtime code path (used by guest_bindgen and host_bindgen in this repo) is unchanged. The wasmtime path is used by the external hyperlight-wasm crate.

Closes #1318

Signed-off-by: James Sturtevant jsturtevant@gmail.com

When is_wasmtime_guest is true, emit wasmtime::component::flags! macro
invocations instead of plain structs with bool fields. This enables
WIT flags types (e.g. from wasi:filesystem) to satisfy the
wasmtime::component::Lift and wasmtime::component::Lower trait bounds.

The non-wasmtime code path (used by guest_bindgen and host_bindgen in
this repo) is unchanged. The wasmtime path is used by the external
hyperlight-wasm crate.

Closes #1318

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant added the kind/bugfix For PRs that fix bugs label Mar 19, 2026
@jsturtevant jsturtevant marked this pull request as draft March 20, 2026 20:42
@jsturtevant
Copy link
Contributor Author

moved this to draft, I was integrating into hyperlight-wasm and found the usage of flags needs to be slightly different. than this. will push an update shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasm_guest_bindgen! macro doesn't support WIT flags types (needed for wasi:filesystem)

1 participant