wiggle: make wasmtime a mandatory dep, get rid of own Trap enum (#5137)

* wiggle: no longer need to guard wasmtime integration behind a feature

this existed so we could use wiggle in lucet, but lucet is long EOL

* replace wiggle::Trap with wiggle::wasmtime_crate::Trap

* wiggle tests: unwrap traps because we cant assert_eq on them

* wasi-common: emit a wasmtime::Trap instead of a wiggle::Trap

formally add a dependency on wasmtime here to make it obvious, though
we do now have a transitive one via wiggle no matter what (and therefore
can get rid of the default-features=false on the wiggle dep)

* wasi-nn: use wasmtime::Trap instead of wiggle::Trap

there's no way the implementation of this func is actually
a good idea, it will panic the host process on any error,
but I'll ask @mtr to fix that

* wiggle test-helpers examples: fixes

* wasi-common cant cross compile to wasm32-unknown-emscripten anymore

this was originally for the WASI polyfill for web targets. Those days
are way behind us now.

* wasmtime wont compile for armv7-unknown-linux-gnueabihf either
This commit is contained in:
Pat Hickey
2022-10-27 09:28:10 -07:00
committed by GitHub
parent b20128a6cb
commit 0290a83502
30 changed files with 147 additions and 155 deletions

View File

@@ -17,7 +17,7 @@ wiggle-macro = { workspace = true }
tracing = "0.1.26"
bitflags = "1.2"
async-trait = "0.1.42"
wasmtime = { workspace = true, optional = true }
wasmtime = { workspace = true }
anyhow = { workspace = true }
[badges]
@@ -41,12 +41,12 @@ required-features = ["wasmtime_async", "wasmtime/wat"]
[[test]]
name = "wasmtime_sync"
path = "tests/wasmtime_sync.rs"
required-features = ["wasmtime_integration", "wasmtime/wat"]
required-features = ["wasmtime/wat"]
[[test]]
name = "wasmtime_integration"
path = "tests/wasmtime_integration.rs"
required-features = ["wasmtime_integration", "wasmtime/wat"]
required-features = ["wasmtime/wat"]
[features]
@@ -62,9 +62,7 @@ wiggle_metadata = ['witx', "wiggle-macro/wiggle_metadata"]
# the logs out of wiggle-generated libraries.
tracing_log = [ "tracing/log" ]
# Generate adapters for wasmtime, and expose the wasmtime_integration macro.
wasmtime_integration = [ "wasmtime", "wiggle-macro/wasmtime" ]
# Support for async in the wasmtime crates.
wasmtime_async = [ "wasmtime_integration", "wasmtime/async" ]
wasmtime_async = [ "wasmtime/async" ]
default = ["wiggle_metadata", "wasmtime_integration" ]
default = ["wiggle_metadata", "wasmtime_async" ]