Conversation
Subscribe to Label Actioncc @kubkon DetailsThis issue or pull request has been labeled: "wasi"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Subscribe to Label Actioncc @peterhuene DetailsThis issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
e54e76c to
1e4cde6
Compare
* ctx parameter no longer accepted by wiggle::from_witx macro. * optional async_ parameter specifies which functions are async. * re-export async_trait::async_trait, so users don't have to take a dep.
wiggle-macro doc tests weren't being run, so docs had gotten out of sync.
1e4cde6 to
af49505
Compare
alexcrichton
approved these changes
Mar 5, 2021
crates/wiggle/generate/src/config.rs
Outdated
| input.parse::<Token![:]>()?; | ||
| Ok(ConfigField::Error(input.parse()?)) | ||
| } else if lookahead.peek(kw::async_) { | ||
| input.parse::<kw::async_>()?; |
Member
There was a problem hiding this comment.
Could this parse the async keyword itself to avoid the underscore? (given this is a macro I'd assume we could do whatever syntax we wanted here)
Contributor
Author
There was a problem hiding this comment.
Sure. I don't know why I never thought of that.
This was referenced May 6, 2021
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.
Following #2434, wiggle now supports async functions. Users of the wiggle macro can specify which functions should be async with a new
async_section of the settings.The new integration test of wasmtime-wiggle shows async support working end-to-end: https://github.com/bytecodealliance/wasmtime/pull/2701/files#diff-9b1eee5f3bd355b0c43aa2ec5d647ddcc085d50f81324540cdbbce39ca6de21b
I rewrote a bunch of the doc test to document the new functionality, plus other earlier changes that had been left out: https://github.com/bytecodealliance/wasmtime/blob/1e4cde62ab510f6c5b551ab73203b48bff707635/crates/wiggle/macro/src/lib.rs
During this work I realized that the wiggle::from_witx macro did not need to take the user's so-called
ctxtype as an argument to the macro. Instead, all code generated bywiggleis generic - it will accept any type which implements the required traits. (Async lifetime issues meant it was easier to make this particular type generic rather than concrete, because lifetime parameters can't be elided in some async fn contexts.) Thewasmtime-wiggleintegration does still require the user to specify a concrete ctx type.Over in
crates/wasmtime, I added a missing functionLinker::instantiate_async, for use with async stores.