Auto-generate the hostcalls module of wasi-common (#846)

* Auto-generate shims for old `wasi_unstable` module

This commit is effectively just doing what #707 already did, but
applying it to the `snapshot_0` module as well. The end result is the
same, where we cut down on all the boilerplate in `snapshot_0` and bring
it in line with the main `wasi_snapshot_preview1` implementation. The
goal here is to make it easier to change the two in tandem since they're
both doing the same thing.

* Migrate `wasi_common::hostcalls` to a macro

This commit migrates the `hostcalls` module to being auto-generated by a
macro rather than duplicating a handwritten signature for each wasi
syscall.

* Auto-generate snapshot_0's `hostcalls` module

Similar to the previous commit, but for `snapshot_0`

* Delete the `wasi-common-cbindgen` crate

This is no longer needed with the hostcalls macro now, we can easily
fold the definition of the cbindgen macro into the same crate.

* Rustfmt

* Fix windows build errors

* Rustfmt

* Remove now no-longer-necessary code

* rustfmt
This commit is contained in:
Alex Crichton
2020-01-22 14:54:39 -06:00
committed by GitHub
parent 5d7635c351
commit 5953215bac
44 changed files with 391 additions and 2742 deletions

31
Cargo.lock generated
View File

@@ -1860,20 +1860,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
[[package]]
name = "trybuild"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "987d6fdc45ddd7f3be5aa7386c8c8a844d1655c95b9ed948a9cd9cded8f2b79f"
dependencies = [
"glob",
"lazy_static",
"serde",
"serde_json",
"termcolor",
"toml",
]
[[package]]
name = "typemap"
version = "0.3.3"
@@ -1992,23 +1978,12 @@ dependencies = [
"log",
"num",
"thiserror",
"wasi-common-cbindgen",
"wig",
"winapi",
"winx",
"yanix",
]
[[package]]
name = "wasi-common-cbindgen"
version = "0.9.0"
dependencies = [
"proc-macro2 1.0.7",
"quote 1.0.2",
"syn 1.0.13",
"trybuild",
]
[[package]]
name = "wasm-webidl-bindings"
version = "0.6.0"
@@ -2427,11 +2402,13 @@ dependencies = [
[[package]]
name = "witx"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abc432537dbc9940e06816ebc3e1c4694fc835b90720615c32038769d7b2967d"
checksum = "a6ee25990cb94f39b8d5637b8c7d9b9eaaed76795d95f45342a7ef3d2e574931"
dependencies = [
"clap",
"log",
"pretty_env_logger",
"thiserror",
"wast 3.0.4",
]