diff --git a/Cargo.lock b/Cargo.lock index 2bcd5a5..c6dac32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -170,7 +170,7 @@ dependencies = [ "polling", "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] @@ -364,7 +364,7 @@ dependencies = [ "io-lifetimes 2.0.2", "ipnet", "maybe-owned", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", "winx 0.36.1", ] @@ -400,7 +400,7 @@ dependencies = [ "cap-primitives 2.0.0", "io-extras 0.18.0", "io-lifetimes 2.0.2", - "rustix 0.38.6", + "rustix 0.38.7", ] [[package]] @@ -411,15 +411,15 @@ checksum = "f8f52b3c8f4abfe3252fd0a071f3004aaa3b18936ec97bdbd8763ce03aff6247" dependencies = [ "cap-primitives 2.0.0", "once_cell", - "rustix 0.38.6", + "rustix 0.38.7", "winx 0.36.1", ] [[package]] name = "cc" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6b2562119bf28c3439f7f02db99faf0aa1a8cdfe5772a2ee155d32227239f0" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "jobserver", "libc", @@ -433,9 +433,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.19" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" dependencies = [ "clap_builder", "clap_derive", @@ -444,9 +444,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" dependencies = [ "anstream", "anstyle", @@ -517,16 +517,16 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "bumpalo", "cranelift-bforest", @@ -545,37 +545,37 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" [[package]] name = "cranelift-control" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cranelift-codegen", "log", @@ -585,13 +585,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" [[package]] name = "cranelift-native" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cranelift-codegen", "libc", @@ -600,8 +600,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.99.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.100.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -677,9 +677,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68e12e817cb19eaab81aaec582b4052d07debd3c3c6b083b9d361db47c7dc9d" +checksum = "ba1ba0a82363c553ecb7b4cd58ba6e1c017baef8e3cca4e7d66ca17879201144" dependencies = [ "cc", "cxxbridge-flags", @@ -689,9 +689,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e789217e4ab7cf8cc9ce82253180a9fe331f35f5d339f0ccfe0270b39433f397" +checksum = "ac9ec8372f860c6ee7c6463b96a26d08dd590bcbcd9bf2d1894db09ae81410d3" dependencies = [ "cc", "codespan-reporting", @@ -704,15 +704,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a19f4c80fd9ab6c882286fa865e92e07688f4387370a209508014ead8751d0" +checksum = "409667bbb937bae87f7cfa91ca29e1415bb92d415371e3344b5269c10d90d595" [[package]] name = "cxxbridge-macro" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcfa71f66c8563c4fa9dd2bb68368d50267856f831ac5d85367e0805f9606c" +checksum = "5fb2a9757fb085d6d97856b28d4f049141ca4a61a64c697f4426433b5f6caa1f" dependencies = [ "proc-macro2", "quote", @@ -877,7 +877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" dependencies = [ "cfg-if", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", ] @@ -921,7 +921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d167b646a876ba8fda6b50ac645cfd96242553cbaf0ca4fccaa39afcbf0801f" dependencies = [ "io-lifetimes 1.0.11", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", ] @@ -932,7 +932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd738b84894214045e8414eaded76359b4a5773f0a0a56b16575110739cdcf39" dependencies = [ "io-lifetimes 2.0.2", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", ] @@ -1244,7 +1244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", ] @@ -1469,9 +1469,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" [[package]] name = "pin-utils" @@ -1641,9 +1641,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", @@ -1653,9 +1653,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" dependencies = [ "aho-corasick", "memchr", @@ -1698,9 +1698,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.6" +version = "0.38.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" +checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" dependencies = [ "bitflags 2.3.3", "errno", @@ -1743,18 +1743,18 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.180" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.180" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", @@ -1845,6 +1845,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spdx" version = "0.10.2" @@ -1924,7 +1934,7 @@ dependencies = [ "cap-std 2.0.0", "fd-lock", "io-lifetimes 2.0.2", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", "winx 0.36.1", ] @@ -1937,14 +1947,14 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.6", + "rustix 0.38.7", "windows-sys", ] @@ -1994,21 +2004,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "2d3ce25f50619af8b0aec2eb23deebe84249e19e2ddd393a6e16e3300a6dadfd" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.3", + "tokio-macros", "windows-sys", ] +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "toml" version = "0.5.11" @@ -2230,8 +2251,8 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "async-trait", @@ -2244,7 +2265,7 @@ dependencies = [ "io-lifetimes 2.0.2", "is-terminal", "once_cell", - "rustix 0.38.6", + "rustix 0.38.7", "system-interface", "tracing", "wasi-common", @@ -2253,8 +2274,8 @@ dependencies = [ [[package]] name = "wasi-common" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "bitflags 2.3.3", @@ -2262,7 +2283,7 @@ dependencies = [ "cap-std 2.0.0", "io-extras 0.18.0", "log", - "rustix 0.38.6", + "rustix 0.38.7", "thiserror", "tracing", "wasmtime", @@ -2280,6 +2301,7 @@ dependencies = [ "clap", "heck 0.4.1", "serde", + "tokio", "toml 0.7.6", "walrus", "wasm-compose", @@ -2359,7 +2381,7 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-compose" version = "0.4.0" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "anyhow", "heck 0.4.1", @@ -2395,7 +2417,7 @@ dependencies = [ [[package]] name = "wasm-encoder" version = "0.31.1" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "leb128", ] @@ -2418,7 +2440,7 @@ dependencies = [ [[package]] name = "wasm-metadata" version = "0.10.1" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "anyhow", "indexmap 2.0.0", @@ -2488,7 +2510,7 @@ dependencies = [ [[package]] name = "wasmparser" version = "0.110.0" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "indexmap 2.0.0", "semver", @@ -2506,8 +2528,8 @@ dependencies = [ [[package]] name = "wasmtime" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "async-trait", @@ -2544,16 +2566,16 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "base64", @@ -2561,7 +2583,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.38.6", + "rustix 0.38.7", "serde", "sha2", "toml 0.5.11", @@ -2571,8 +2593,8 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "proc-macro2", @@ -2585,13 +2607,13 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" [[package]] name = "wasmtime-cranelift" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "cranelift-codegen", @@ -2613,8 +2635,8 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "cranelift-codegen", @@ -2628,8 +2650,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "cranelift-entity", @@ -2649,12 +2671,12 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cc", "cfg-if", - "rustix 0.38.6", + "rustix 0.38.7", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys", @@ -2662,8 +2684,8 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "addr2line", "anyhow", @@ -2675,7 +2697,7 @@ dependencies = [ "log", "object", "rustc-demangle", - "rustix 0.38.6", + "rustix 0.38.7", "serde", "target-lexicon", "wasmtime-environ", @@ -2687,19 +2709,19 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "object", "once_cell", - "rustix 0.38.6", + "rustix 0.38.7", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cfg-if", "libc", @@ -2708,8 +2730,8 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "cc", @@ -2723,7 +2745,7 @@ dependencies = [ "memoffset", "paste", "rand", - "rustix 0.38.6", + "rustix 0.38.7", "sptr", "wasm-encoder 0.31.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmtime-asm-macros", @@ -2736,8 +2758,8 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "cranelift-entity", "serde", @@ -2747,8 +2769,8 @@ dependencies = [ [[package]] name = "wasmtime-versioned-export-macros" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "proc-macro2", "quote", @@ -2757,8 +2779,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "async-trait", @@ -2773,7 +2795,7 @@ dependencies = [ "io-extras 0.18.0", "libc", "once_cell", - "rustix 0.38.6", + "rustix 0.38.7", "system-interface", "thiserror", "tokio", @@ -2787,8 +2809,8 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "cranelift-codegen", @@ -2803,11 +2825,12 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "heck 0.4.1", + "indexmap 2.0.0", "wit-parser 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2835,7 +2858,7 @@ dependencies = [ [[package]] name = "wast" version = "62.0.1" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "leb128", "memchr", @@ -2855,7 +2878,7 @@ dependencies = [ [[package]] name = "wat" version = "1.0.69" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "wast 62.0.1 (git+https://github.com/bytecodealliance/wasm-tools)", ] @@ -2872,8 +2895,8 @@ dependencies = [ [[package]] name = "wiggle" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "async-trait", @@ -2886,8 +2909,8 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "heck 0.4.1", @@ -2900,8 +2923,8 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "12.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "13.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "proc-macro2", "quote", @@ -2942,8 +2965,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.10.0" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +version = "0.11.0" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "cranelift-codegen", @@ -3023,9 +3046,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46aab759304e4d7b2075a9aecba26228bb073ee8c50db796b2c72c676b5d807" +checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" dependencies = [ "memchr", ] @@ -3054,7 +3077,7 @@ dependencies = [ [[package]] name = "wit-bindgen" version = "0.9.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen#bf318b8ae4703586ae236a232f62813efc946df3" +source = "git+https://github.com/bytecodealliance/wit-bindgen#31b561e5a31fb8d52ba24186d0cc83a2efa5670d" dependencies = [ "bitflags 2.3.3", "wit-bindgen-rust-macro", @@ -3063,7 +3086,7 @@ dependencies = [ [[package]] name = "wit-bindgen-core" version = "0.9.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen#bf318b8ae4703586ae236a232f62813efc946df3" +source = "git+https://github.com/bytecodealliance/wit-bindgen#31b561e5a31fb8d52ba24186d0cc83a2efa5670d" dependencies = [ "anyhow", "wit-component 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3073,7 +3096,7 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" version = "0.9.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen#bf318b8ae4703586ae236a232f62813efc946df3" +source = "git+https://github.com/bytecodealliance/wit-bindgen#31b561e5a31fb8d52ba24186d0cc83a2efa5670d" dependencies = [ "anyhow", "heck 0.4.1", @@ -3086,7 +3109,7 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-lib" version = "0.9.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen#bf318b8ae4703586ae236a232f62813efc946df3" +source = "git+https://github.com/bytecodealliance/wit-bindgen#31b561e5a31fb8d52ba24186d0cc83a2efa5670d" dependencies = [ "heck 0.4.1", "wit-bindgen-core", @@ -3095,7 +3118,7 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" version = "0.9.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen#bf318b8ae4703586ae236a232f62813efc946df3" +source = "git+https://github.com/bytecodealliance/wit-bindgen#31b561e5a31fb8d52ba24186d0cc83a2efa5670d" dependencies = [ "anyhow", "proc-macro2", @@ -3125,7 +3148,7 @@ dependencies = [ [[package]] name = "wit-component" version = "0.13.1" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "anyhow", "bitflags 2.3.3", @@ -3156,7 +3179,7 @@ dependencies = [ [[package]] name = "wit-parser" version = "0.9.2" -source = "git+https://github.com/bytecodealliance/wasm-tools#64fee0e54eed6fe3bf07a43e4f559621d0cb3eac" +source = "git+https://github.com/bytecodealliance/wasm-tools#3e1fb68b217b210c816a504fa7abe0907c9c9039" dependencies = [ "anyhow", "id-arena", @@ -3171,7 +3194,7 @@ dependencies = [ [[package]] name = "witx" version = "0.9.1" -source = "git+https://github.com/bytecodealliance/wasmtime#520015979139825df35f9b5a380f1c22632d8894" +source = "git+https://github.com/bytecodealliance/wasmtime#2764edc59c42d38a1e32db9e67ca320050bd54c3" dependencies = [ "anyhow", "log", diff --git a/Cargo.toml b/Cargo.toml index aef7d6d..80497ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ rustflags = ["-Zoom=panic"] anyhow = "1" clap = { version = "4", features = ["derive"] } serde = { version = "1", features = ["derive"] } +tokio = { version = "1.30.0", features = ["macros"] } toml = "0.7" walrus = "0.20.1" wasm-compose = { git = "https://github.com/bytecodealliance/wasm-tools" } diff --git a/README.md b/README.md index fe7945a..eb41a06 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,16 @@ fn main() { When calling a subsystem for the first time, its virtualization will be enabled. Subsystems not used or configured at all will be omitted from the virtualization entirely. +### Selective Subsystem Virtualization + +By default, when using the `wasi-virt` CLI command, all virtualizations are enabled. This way, not only is encapsulation the default, but composition with arbitrary components will always work out as all interfaces for WASI should always be available. + +Selective subsystem virtualization can be performed directly with the WASI Virt library as above (which does not virtualize all subsystems by default). This allows virtualizing just a single subsystem like `env`, where it is possible to virtualize only that subsystem and skip other virtualizations and end up creating a smaller virtualization component. + +There is an important caveat to this: _as soon as any subsystem uses IO, all subsystems using IO need to be virtualized in order to fully subclass streams and polls in the virtualization layer_. In future this caveat requirement should weaken as these features lower into the core ABI in subsequent WASI versions. + +`wasm-tools compose` will error in these scenarios, and better [error messaging](https://github.com/bytecodealliance/wasm-tools/issues/1147) may be provided in future when performing invalid compositions like the above. Missing subsystems can be usually detected from the composition warnings list. + ## Contributing To build, run `./build-adapter.sh` which builds the master `virtual-adapter` component, followed by `cargo build` to build diff --git a/lib/virtual_adapter.wasm b/lib/virtual_adapter.wasm index e36b75d..fd7dfea 100755 Binary files a/lib/virtual_adapter.wasm and b/lib/virtual_adapter.wasm differ diff --git a/src/bin/wasi-virt.rs b/src/bin/wasi-virt.rs index d3e0923..c004bae 100644 --- a/src/bin/wasi-virt.rs +++ b/src/bin/wasi-virt.rs @@ -131,13 +131,11 @@ fn main() -> Result<()> { // http virt_opts.http(args.allow_http.unwrap_or(allow_all)); - // TODO: These need completing - // random virt_opts.random(args.allow_random.unwrap_or(allow_all)); // sockets - // virt_opts.sockets(args.allow_sockets.unwrap_or(allow_all)); + virt_opts.sockets(args.allow_sockets.unwrap_or(allow_all)); // stdio virt_opts diff --git a/src/lib.rs b/src/lib.rs index a127440..0021706 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -198,7 +198,7 @@ impl WasiVirt { .resolve .select_world(*pkg_id, Some("virtual-sockets"))?; - // env & exit subsystems are fully independent + // env, exit & random subsystems are fully independent if self.env.is_some() { bindgen.resolve.merge_worlds(env_world, base_world)?; } else { @@ -225,36 +225,36 @@ impl WasiVirt { strip_io_virt(&mut module)?; } if let Some(clocks) = self.clocks { - if clocks { - // When subsystem is enabled, we can pass through all interfaces - // that do not rely on io. The adapter default is passthrough. - bindgen.resolve.merge_worlds(io_clocks_world, base_world)?; - } else { - // When subsystem is disabled, we must do a full virtualization + if !clocks { + // deny is effectively virtualization + // in future with fine-grained virtualization options, they + // also would extend here (ie !clocks is deceiving) bindgen.resolve.merge_worlds(clocks_world, base_world)?; deny_clocks_virt(&mut module)?; + } else { + // passthrough can be simplified to just rewrapping io interfaces + bindgen.resolve.merge_worlds(io_clocks_world, base_world)?; } } else { strip_clocks_virt(&mut module)?; } // sockets and http are identical to clocks above if let Some(sockets) = self.sockets { - if sockets { - bindgen.resolve.merge_worlds(io_sockets_world, base_world)?; - } else { + if !sockets { bindgen.resolve.merge_worlds(sockets_world, base_world)?; - // TODO: - // deny_sockets_virt(&mut module)?; + deny_sockets_virt(&mut module)?; + } else { + bindgen.resolve.merge_worlds(io_sockets_world, base_world)?; } } else { strip_sockets_virt(&mut module)?; } if let Some(http) = self.http { - if http { - bindgen.resolve.merge_worlds(io_http_world, base_world)?; - } else { + if !http { bindgen.resolve.merge_worlds(http_world, base_world)?; deny_http_virt(&mut module)?; + } else { + bindgen.resolve.merge_worlds(io_http_world, base_world)?; } } else { strip_http_virt(&mut module)?; diff --git a/src/virt_deny.rs b/src/virt_deny.rs index ca3f45b..426e9c5 100644 --- a/src/virt_deny.rs +++ b/src/virt_deny.rs @@ -378,5 +378,6 @@ pub(crate) fn deny_exit_virt(module: &mut Module) -> Result<()> { } pub(crate) fn deny_sockets_virt(module: &mut Module) -> Result<()> { - todo!(); + // TODO: Complete stubbing implementation + Ok(()) } diff --git a/tests/cases/fs-dir-read.toml b/tests/cases/fs-dir-read.toml index 3516532..f7e10e3 100644 --- a/tests/cases/fs-dir-read.toml +++ b/tests/cases/fs-dir-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/mydir" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs.preopens."/".dir."mydir".dir] "file1.txt" = { source = "inner contents1" } "file2.txt" = { source = "inner contents2" } diff --git a/tests/cases/fs-file-read.toml b/tests/cases/fs-file-read.toml index e13bc13..6226ceb 100644 --- a/tests/cases/fs-file-read.toml +++ b/tests/cases/fs-file-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/file.txt" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs.preopens."/".dir] "file.txt" = { source = "contents" } diff --git a/tests/cases/fs-host-read.toml b/tests/cases/fs-host-read.toml index f92104a..0650c67 100644 --- a/tests/cases/fs-host-read.toml +++ b/tests/cases/fs-host-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/file.txt" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs.preopens."/".dir] "file.txt" = { runtime-file = "/LICENSE" } diff --git a/tests/cases/fs-inner-read.toml b/tests/cases/fs-inner-read.toml index 68b3f63..dbc2901 100644 --- a/tests/cases/fs-inner-read.toml +++ b/tests/cases/fs-inner-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/mydir/file.txt" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs.preopens."/".dir."mydir".dir] "file.txt" = { source = "inner contents" } diff --git a/tests/cases/fs-nested-dir-read.toml b/tests/cases/fs-nested-dir-read.toml index 1e0fe65..9a96090 100644 --- a/tests/cases/fs-nested-dir-read.toml +++ b/tests/cases/fs-nested-dir-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/clocks/monotonic-clock.wit" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs.preopens."/"] virtualize = "./wit/deps" diff --git a/tests/cases/fs-passive-file-read.toml b/tests/cases/fs-passive-file-read.toml index a20b811..ef15b2a 100644 --- a/tests/cases/fs-passive-file-read.toml +++ b/tests/cases/fs-passive-file-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/env-none.toml" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs] passive-cutoff = 10 diff --git a/tests/cases/fs-virt-dir-read.toml b/tests/cases/fs-virt-dir-read.toml index 5805d38..8506866 100644 --- a/tests/cases/fs-virt-dir-read.toml +++ b/tests/cases/fs-virt-dir-read.toml @@ -2,6 +2,11 @@ component = "file-read" host-fs-path = "/env-none.toml" +[virt-opts.stdio] +stdin = true +stdout = true +stderr = true + [virt-opts.fs.preopens."/"] virtualize = "./tests/cases" diff --git a/tests/virt.rs b/tests/virt.rs index 7a16b9a..6cf1ef7 100644 --- a/tests/virt.rs +++ b/tests/virt.rs @@ -60,7 +60,9 @@ struct TestCase { expect: TestExpectation, } -#[async_std::test] +const DEBUG: bool = false; + +#[tokio::test] async fn virt_test() -> Result<()> { let wasi_adapter = fs::read("lib/wasi_snapshot_preview1.reactor.wasm")?; @@ -71,10 +73,16 @@ async fn virt_test() -> Result<()> { let test_case_name = test_case_file_name.strip_suffix(".toml").unwrap(); // Filtering... - // if test_case_name != "encapsulate" { + // if test_case_name != "passthrough" { // continue; // } + if DEBUG { + if test_case_name == "encapsulate" { + continue; + } + } + println!("> {:?}", test_case_path); // load the test case JSON data @@ -90,12 +98,14 @@ async fn virt_test() -> Result<()> { let mut generated_component_path = generated_path.join(component_name); generated_component_path.set_extension("component.wasm"); cmd(&format!( - "cargo build -p {component_name} --target wasm32-wasi --release" + "cargo build -p {component_name} --target wasm32-wasi {}", + if DEBUG { "" } else { "--release" } ))?; // encode the component let component_core = fs::read(&format!( - "target/wasm32-wasi/release/{}.wasm", + "target/wasm32-wasi/{}/{}.wasm", + if DEBUG { "debug" } else { "release" }, component_name.to_snake_case() ))?; let mut encoder = ComponentEncoder::default() @@ -112,7 +122,9 @@ async fn virt_test() -> Result<()> { virt_component_path.set_extension("virt.wasm"); let mut virt_opts = test.virt_opts.clone().unwrap_or_default(); virt_opts.exit(Default::default()); - // virt_opts.wasm_opt = Some(false); + if DEBUG { + virt_opts.wasm_opt = Some(false); + } let virt_component = virt_opts .finish() @@ -137,18 +149,17 @@ async fn virt_test() -> Result<()> { } // execute the composed virtualized component test function - let mut builder = WasiCtxBuilder::new().inherit_stdio().push_preopened_dir( + let mut builder = WasiCtxBuilder::new(); + builder.inherit_stdio().preopened_dir( Dir::open_ambient_dir(".", ambient_authority())?, DirPerms::READ, FilePerms::READ, "/", ); if let Some(host_env) = &test.host_env { - let env: Vec<(String, String)> = host_env - .iter() - .map(|(k, v)| (k.to_string(), v.to_string())) - .collect(); - builder = builder.set_env(env.as_slice()); + for (k, v) in host_env { + builder.env(k, v); + } } let mut table = Table::new(); let wasi = builder.build(&mut table)?; diff --git a/virtual-adapter/src/io.rs b/virtual-adapter/src/io.rs index f8aa84d..105c21d 100644 --- a/virtual-adapter/src/io.rs +++ b/virtual-adapter/src/io.rs @@ -1004,7 +1004,7 @@ impl Streams for VirtAdapter { match IoState::get_stream(sid)? { Stream::Null => Ok((bytes.len() as u64, StreamStatus::Ended)), Stream::StaticFile(_) | Stream::StaticDir(_) => Err(stream_err()), - Stream::Host(sid) => stream_res_map(streams::write(*sid, bytes.as_slice())), + Stream::Host(sid) => stream_res_map(streams::blocking_write(*sid, bytes.as_slice())), } } fn write_zeroes(sid: u32, len: u64) -> Result<(u64, StreamStatus), StreamError> {