Skip to content

Commit

Permalink
Update witx to 0.9
Browse files Browse the repository at this point in the history
This pulls in the new `witx` 0.9 crate which notably includes
WebAssembly/WASI#395. This is a large refactoring of how witx signatures
are processed and a large update to the actual syntax of the witx ABIs
themselves.

This commit adjusts to all the new `witx` APIs and also tweaks idioms in
a few locations as well. Code generation is now less custom to Rust and
instead tries to match almost exactly what the `witx` crate tells us to
generate. Additionally the representation of types is chosen to more
closely align with interface types in the future where it's impossible
to pass invalid values to the outside world. Notable changes here are:

* `enum`-like values are now newtype wrappers around integers to prevent
  invalid values from flowing out.
* Error traits are now implement directly for the `Errno` wrapper.
* The module containing the raw functions now exclusively uses i32/i64
  types and doesn't try to use convenience types in Rust.
  • Loading branch information
alexcrichton committed Feb 17, 2021
1 parent ad108be commit edea3f3
Show file tree
Hide file tree
Showing 6 changed files with 1,720 additions and 1,206 deletions.
2 changes: 1 addition & 1 deletion crates/witx-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/bytecodealliance/wasi/tree/main/crates/witx-bin

[dependencies]
heck = "0.3"
witx = { path = "WASI/tools/witx", version = "0.8.8" }
witx = { git = 'https://github.com/alexcrichton/wasi', branch = 'abis' }
cfg-if = "0.1"

[features]
Expand Down
Loading

0 comments on commit edea3f3

Please sign in to comment.