Add a wasmtime::component::bindgen! macro (#5317)

* Import Wasmtime support from the `wit-bindgen` repo

This commit imports the `wit-bindgen-gen-host-wasmtime-rust` crate from
the `wit-bindgen` repository into the upstream Wasmtime repository. I've
chosen to not import the full history here since the crate is relatively
small and doesn't have a ton of complexity. While the history of the
crate is quite long the current iteration of the crate's history is
relatively short so there's not a ton of import there anyway. The
thinking is that this can now continue to evolve in-tree.

* Refactor `wasmtime-component-macro` a bit

Make room for a `wit_bindgen` macro to slot in.

* Add initial support for a `bindgen` macro

* Add tests for `wasmtime::component::bindgen!`

* Improve error forgetting `async` feature

* Add end-to-end tests for bindgen

* Add an audit of `unicase`

* Add a license to the test-helpers crate

* Add vet entry for `pulldown-cmark`

* Update publish script with new crate

* Try to fix publish script

* Update audits

* Update lock file
This commit is contained in:
Alex Crichton
2022-12-06 13:06:00 -06:00
committed by GitHub
parent 293bb5b334
commit 2329ecc341
43 changed files with 4336 additions and 1212 deletions

54
Cargo.lock generated
View File

@@ -472,6 +472,14 @@ dependencies = [
"syn",
]
[[package]]
name = "component-macro-test-helpers"
version = "0.0.0"
dependencies = [
"proc-macro2",
"quote",
]
[[package]]
name = "component-test-util"
version = "0.0.0"
@@ -2235,6 +2243,17 @@ dependencies = [
"cc",
]
[[package]]
name = "pulldown-cmark"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8"
dependencies = [
"bitflags",
"memchr",
"unicase",
]
[[package]]
name = "quick-error"
version = "1.2.3"
@@ -2969,6 +2988,15 @@ version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "unicase"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
dependencies = [
"version_check",
]
[[package]]
name = "unicode-bidi"
version = "0.3.8"
@@ -3496,10 +3524,15 @@ dependencies = [
name = "wasmtime-component-macro"
version = "5.0.0"
dependencies = [
"component-macro-test-helpers",
"proc-macro2",
"quote",
"syn",
"tracing",
"wasmtime",
"wasmtime-component-util",
"wasmtime-wit-bindgen",
"wit-parser",
]
[[package]]
@@ -3757,6 +3790,14 @@ dependencies = [
"winch-codegen",
]
[[package]]
name = "wasmtime-wit-bindgen"
version = "5.0.0"
dependencies = [
"heck",
"wit-parser",
]
[[package]]
name = "wast"
version = "35.0.2"
@@ -3986,6 +4027,19 @@ dependencies = [
"windows-sys",
]
[[package]]
name = "wit-parser"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "893834cffb239f88413eead7cf91862a6f24c2233afae15d7808256d8c58f91e"
dependencies = [
"anyhow",
"id-arena",
"indexmap",
"pulldown-cmark",
"unicode-xid",
]
[[package]]
name = "witx"
version = "0.9.1"