Skip to content

update future/stream ABIs and names - #1315

Merged
dicej merged 3 commits into
bytecodealliance:mainfrom
dicej:future-and-stream-changes
Jun 10, 2025
Merged

update future/stream ABIs and names#1315
dicej merged 3 commits into
bytecodealliance:mainfrom
dicej:future-and-stream-changes

Conversation

@dicej

@dicej dicej commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

This updates wit-bindgen-rt etc. to use (some of) the new ABI defined in WebAssembly/component-model#524. It covers everything in that PR except the lifting and lowering changes to future.{read,write}, which we decided are more trouble than they're worth.

I've tested this end-to-end with wasip3-prototyping and will soon post a corresponding PR there.

Finally, rustfmt was complaining about using gen as a field name, so I took this opportunity to address that.

This updates `wit-bindgen-rt` etc. to use (some of) the new ABI defined in
WebAssembly/component-model#524.  It covers everything
in that PR _except_ the lifting and lowering changes to `future.{read,write}`,
which we decided are more trouble than they're worth.

I've tested this end-to-end with `wasip3-prototyping` and will soon post a
corresponding PR there.

Finally, `rustfmt` was complaining about using `gen` as a field name, so I took
this opportunity to address that.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

fix rust codegen build errors

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

snapshot

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Comment thread crates/guest-rust/rt/src/async_support/future_support.rs Outdated
Comment thread crates/c/src/lib.rs
let mut gen = self.interface(resolve, true, Some(&wasm_import_module));
gen.interface = Some((id, name));
gen.define_interface_types(id);
let mut r#gen = self.interface(resolve, true, Some(&wasm_import_module));

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 can do this in a follow-up but I'd prefer to avoid r#gen. I understand it's the machine-applicable way to migrate from one edition to another but no one really wants to either read or write r#gen over time so I'd prefer to go through and update things to generator or similar.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej

dicej commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator Author

I'm going to try to fix the Test Async CI job before merging this.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej
dicej enabled auto-merge June 9, 2025 23:12
@dicej
dicej added this pull request to the merge queue Jun 9, 2025
Merged via the queue into bytecodealliance:main with commit 34e399e Jun 10, 2025
@dicej
dicej deleted the future-and-stream-changes branch June 10, 2025 00:00
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