Conversation
Since WebAssembly/component-model#646 a function that isn't `async` in WIT can't be lifted or lowered async, so the only override that still makes sense is turning an `async` function back to sync. `--sync` takes the filters `--async` took, without the `-` prefix. The `generate!` option is renamed the same way, and `async:` now errors and points at `sync:`. The `--async=all` codegen test variant for Rust, C and MoonBit is removed: it generated async imports and exports for sync functions, which can't be put in a component. Closes bytecodealliance#1622 Closes bytecodealliance#1623
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #1622: functions that are
asyncin WIT get async bindings, everything else gets sync bindings, and--syncis the only override. It takes the same filters--asyncdid (all,foo:bar/baz#f,import:…,export:…), without the-prefix. Since they only go one way now, their order no longer matters.generate!takessync: true/sync: [...]in place ofasync:, andasync:now fails with a message pointing atsync:.For reference,
async: trueon main builds fine for a world with a sync import, and then wasmtime refuses the component with "theasynccanonical option requires an async function type".The
--async=allcodegen variant for Rust, C and MoonBit is gone. Swapping it for--sync=allpasses for Rust and C, but only 3 of the 109 codegen tests have async functions, so it would mostly repeat the default run. Happy to add it if you'd like.Ran the Rust and C codegen and runtime tests locally, plus the crate tests, clippy and rustfmt. I couldn't run Go or MoonBit end to end here; their generators only see the renamed flag, and the MoonBit direction test is updated for it.
Closes #1622
Closes #1623