wasi-cap-std-async is better named wasi-tokio
This commit is contained in:
22
Cargo.lock
generated
22
Cargo.lock
generated
@@ -3068,16 +3068,6 @@ version = "0.10.2+wasi-snapshot-preview1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasi-cap-std-async"
|
|
||||||
version = "0.26.0"
|
|
||||||
dependencies = [
|
|
||||||
"tokio",
|
|
||||||
"wasi-cap-std-sync",
|
|
||||||
"wasi-common",
|
|
||||||
"wiggle",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi-cap-std-sync"
|
name = "wasi-cap-std-sync"
|
||||||
version = "0.26.0"
|
version = "0.26.0"
|
||||||
@@ -3144,6 +3134,16 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi-tokio"
|
||||||
|
version = "0.26.0"
|
||||||
|
dependencies = [
|
||||||
|
"tokio",
|
||||||
|
"wasi-cap-std-sync",
|
||||||
|
"wasi-common",
|
||||||
|
"wiggle",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-encoder"
|
name = "wasm-encoder"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
@@ -3551,9 +3551,9 @@ name = "wasmtime-wasi"
|
|||||||
version = "0.26.0"
|
version = "0.26.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"wasi-cap-std-async",
|
|
||||||
"wasi-cap-std-sync",
|
"wasi-cap-std-sync",
|
||||||
"wasi-common",
|
"wasi-common",
|
||||||
|
"wasi-tokio",
|
||||||
"wasmtime",
|
"wasmtime",
|
||||||
"wasmtime-wiggle",
|
"wasmtime-wiggle",
|
||||||
"wiggle",
|
"wiggle",
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ members = [
|
|||||||
"crates/wiggle/wasmtime",
|
"crates/wiggle/wasmtime",
|
||||||
"crates/wasi-common",
|
"crates/wasi-common",
|
||||||
"crates/wasi-common/cap-std-sync",
|
"crates/wasi-common/cap-std-sync",
|
||||||
"crates/wasi-common/cap-std-async",
|
"crates/wasi-common/tokio",
|
||||||
"examples/fib-debug/wasm",
|
"examples/fib-debug/wasm",
|
||||||
"examples/wasi/wasm",
|
"examples/wasi/wasm",
|
||||||
"examples/tokio/wasm",
|
"examples/tokio/wasm",
|
||||||
@@ -112,7 +112,7 @@ harness = false
|
|||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
required-features = ["wasmtime-wasi/async"]
|
required-features = ["wasmtime-wasi/tokio"]
|
||||||
|
|
||||||
[profile.dev.package.backtrace]
|
[profile.dev.package.backtrace]
|
||||||
debug = false # FIXME(#1813)
|
debug = false # FIXME(#1813)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasi-cap-std-async"
|
name = "wasi-tokio"
|
||||||
version = "0.26.0"
|
version = "0.26.0"
|
||||||
authors = ["The Wasmtime Project Developers"]
|
authors = ["The Wasmtime Project Developers"]
|
||||||
description = "WASI implementation in Rust"
|
description = "WASI implementation in Rust"
|
||||||
@@ -15,7 +15,7 @@ build = "build.rs"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
wasi-common = { path = "../wasi-common", version = "0.26.0" }
|
wasi-common = { path = "../wasi-common", version = "0.26.0" }
|
||||||
wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync", version = "0.26.0", optional = true }
|
wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync", version = "0.26.0", optional = true }
|
||||||
wasi-cap-std-async = { path = "../wasi-common/cap-std-async", version = "0.26.0", optional = true }
|
wasi-tokio = { path = "../wasi-common/tokio", version = "0.26.0", optional = true }
|
||||||
wiggle = { path = "../wiggle", default-features = false, version = "0.26.0" }
|
wiggle = { path = "../wiggle", default-features = false, version = "0.26.0" }
|
||||||
wasmtime-wiggle = { path = "../wiggle/wasmtime", default-features = false, version = "0.26.0" }
|
wasmtime-wiggle = { path = "../wiggle/wasmtime", default-features = false, version = "0.26.0" }
|
||||||
wasmtime = { path = "../wasmtime", default-features = false, version = "0.26.0" }
|
wasmtime = { path = "../wasmtime", default-features = false, version = "0.26.0" }
|
||||||
@@ -24,4 +24,4 @@ anyhow = "1.0"
|
|||||||
[features]
|
[features]
|
||||||
default = ["sync"]
|
default = ["sync"]
|
||||||
sync = ["wasi-cap-std-sync"]
|
sync = ["wasi-cap-std-sync"]
|
||||||
async = ["wasi-cap-std-async", "wasmtime/async", "wasmtime-wiggle/async"]
|
tokio = ["wasi-tokio", "wasmtime/async", "wasmtime-wiggle/async"]
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ pub mod sync {
|
|||||||
super::define_wasi!(block_on);
|
super::define_wasi!(block_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Re-export the wasi-cap-std-async crate here. This saves consumers of this library from having
|
/// Re-export the wasi-tokio crate here. This saves consumers of this library from having
|
||||||
/// to keep additional dependencies in sync.
|
/// to keep additional dependencies in sync.
|
||||||
#[cfg(feature = "async")]
|
#[cfg(feature = "tokio")]
|
||||||
pub mod async_ {
|
pub mod tokio {
|
||||||
pub use wasi_cap_std_async::*;
|
pub use wasi_tokio::*;
|
||||||
super::define_wasi!(async);
|
super::define_wasi!(async);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use wasmtime::{Config, Engine, Linker, Module, Store};
|
|||||||
// For this example we want to use the async version of wasmtime_wasi.
|
// For this example we want to use the async version of wasmtime_wasi.
|
||||||
// Notably, this version of wasi uses a scheduler that will async yield
|
// Notably, this version of wasi uses a scheduler that will async yield
|
||||||
// when sleeping in `poll_oneoff`.
|
// when sleeping in `poll_oneoff`.
|
||||||
use wasmtime_wasi::async_::{Wasi, WasiCtxBuilder};
|
use wasmtime_wasi::tokio::{Wasi, WasiCtxBuilder};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Error> {
|
async fn main() -> Result<(), Error> {
|
||||||
|
|||||||
Reference in New Issue
Block a user