Skip to content

Update to the new async abi - #1302

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:new-async-abi
May 27, 2025
Merged

Update to the new async abi #1302
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:new-async-abi

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

No description provided.

@alexcrichton
alexcrichton requested a review from dicej May 21, 2025 18:49
@alexcrichton

Copy link
Copy Markdown
Member Author

Depends on bytecodealliance/wasm-tools#2198

@dicej dicej left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM once the tests pass and the /// TODO in subtask.rs is filled in.

This commit refactors the C/Rust bindings generators to handle the new
async import ABI which allows up to 4 flat parameters instead of always
having all parameters being indirect. Additionally the return pointer is
omitted in the ABI if there are no return values.
@alexcrichton
alexcrichton marked this pull request as ready for review May 27, 2025 17:56
@alexcrichton

Copy link
Copy Markdown
Member Author

I'm really bad about going back and fixing my own TODOs....

Otherwise though I've confirmed locally that tests all pass with bytecodealliance/wasip3-prototyping#171 but I'll have to land this first, with failing async tests, before that PR can land. (and tests can't pass until the wasip3-prototyping PR lands). I'll follow-up with test fixes as necessary though if I missed something.

@alexcrichton
alexcrichton added this pull request to the merge queue May 27, 2025
Merged via the queue into bytecodealliance:main with commit 98772fb May 27, 2025
@alexcrichton
alexcrichton deleted the new-async-abi branch May 27, 2025 21:56
psiegl pushed a commit to airbus-forks/wrpc that referenced this pull request Jul 9, 2026
Merge upstream wit-bindgen 0.43.0 into the vendored bindgen subtree.

- Bump wit-bindgen-core 0.42 -> 0.43 and wit-parser 0.230 -> 0.235 (no generator
  API churn this round).
- Carry the new `tests/codegen/async-trait-function.wit` input (an exported
  resource with an `async func` method); wRPC generates it without changes
  (async functions are handled as their sync equivalents over the transport), so
  no skip-arm is needed.

Non-carries (not applicable to wRPC, dropped from the merge):
- another `wit-bindgen test` subcommand backend (`crates/test/src/cpp.rs`).
- the async-ABI / future-stream refactors (bytecodealliance/wit-bindgen#1302/bytecodealliance/wit-bindgen#1315 future/stream ABI and
  names, bytecodealliance/wit-bindgen#1311 async trait function errors, bytecodealliance/wit-bindgen#1306 linear writes) and bytecodealliance/wit-bindgen@504dcd1a
  (disallow 0 in canonical-ABI `from_handle`) do not apply to wRPC's
  transport-stub generator.

rust codegen (240) and go codegen (80) tests pass; `cargo clippy --workspace`
and `cargo doc --workspace` are clean; wasmtime and all examples build.

Assisted-by: claude:claude-opus-4-8
Upstream diff: bytecodealliance/wit-bindgen@v0.42.0...v0.43.0
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