From 01068b62bdc7e996e0e75a3e1c364c1673e479d4 Mon Sep 17 00:00:00 2001 From: hkrn <129939+hkrn@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:04:02 +0900 Subject: [PATCH] [rust] migrate `wasmer` to `wasmtime` Due to wasmer4 lack flexibility of feature selection and test migration difficulties, we decided to migrate wasmer to wasmtime crate. --- rust/Cargo.lock | 2313 +++++++------------ rust/deny.toml | 10 +- rust/plugin_wasm/Cargo.toml | 14 +- rust/plugin_wasm/src/lib.rs | 422 ++-- rust/plugin_wasm/src/model/core.rs | 5 +- rust/plugin_wasm/src/model/plugin.rs | 110 +- rust/plugin_wasm/src/model/test/full.rs | 6 +- rust/plugin_wasm/src/model/test/minimum.rs | 5 +- rust/plugin_wasm/src/model/test/mod.rs | 102 +- rust/plugin_wasm/src/motion/core.rs | 5 +- rust/plugin_wasm/src/motion/plugin.rs | 149 +- rust/plugin_wasm/src/motion/test/full.rs | 5 +- rust/plugin_wasm/src/motion/test/minimum.rs | 5 +- rust/plugin_wasm/src/motion/test/mod.rs | 101 +- 14 files changed, 1395 insertions(+), 1857 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 2180329b..c9aadeef 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,11 +4,20 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "gimli 0.27.2", + "gimli 0.27.3", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.0", ] [[package]] @@ -19,20 +28,29 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "getrandom", + "cfg-if", "once_cell", "version_check", ] [[package]] -name = "any_ascii" -version = "0.1.7" +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + +[[package]] +name = "ambient-authority" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" [[package]] name = "anyhow" @@ -41,10 +59,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] -name = "arrayvec" -version = "0.7.2" +name = "arbitrary" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" [[package]] name = "assert_matches" @@ -54,22 +72,13 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", -] - -[[package]] -name = "atomic-polyfill" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" -dependencies = [ - "critical-section", + "syn", ] [[package]] @@ -80,31 +89,19 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line", + "addr2line 0.21.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.32.1", "rustc-demangle", ] -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base64" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" - [[package]] name = "bincode" version = "1.3.3" @@ -121,41 +118,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.10.4" +name = "bitflags" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" - -[[package]] -name = "bytecheck" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13fe11640a23eb24562225322cd3e452b93a3d4091d62fab69c70542fcd17d1f" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" @@ -168,80 +140,118 @@ name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cap-fs-ext" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b779b2d0a001c125b4584ad586268fb4b92d957bff8d26d7fe0dd78283faa814" dependencies = [ - "serde", + "cap-primitives", + "cap-std", + "io-lifetimes 2.0.2", + "windows-sys", ] [[package]] -name = "cc" -version = "1.0.79" +name = "cap-primitives" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "2bf30c373a3bee22c292b1b6a7a26736a38376840f1af3d2d806455edf8c3899" +dependencies = [ + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes 2.0.2", + "ipnet", + "maybe-owned", + "rustix 0.38.13", + "windows-sys", + "winx", +] [[package]] -name = "cfg-if" -version = "1.0.0" +name = "cap-rand" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "577de6cff7c2a47d6b13efe5dd28bf116bd7f8f7db164ea95b7cc2640711f522" +dependencies = [ + "ambient-authority", + "rand", +] [[package]] -name = "const_fn" -version = "0.4.9" +name = "cap-std" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" +checksum = "84bade423fa6403efeebeafe568fdb230e8c590a275fba2ba978dd112efcf6e9" +dependencies = [ + "cap-primitives", + "io-extras", + "io-lifetimes 2.0.2", + "rustix 0.38.13", +] [[package]] -name = "cooked-waker" -version = "5.0.0" +name = "cap-time-ext" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147be55d677052dabc6b22252d5dd0fd4c29c8c27aa4f2fbef0f94aa003b406f" +checksum = "f8f52b3c8f4abfe3252fd0a071f3004aaa3b18936ec97bdbd8763ce03aff6247" +dependencies = [ + "cap-primitives", + "once_cell", + "rustix 0.38.13", + "winx", +] [[package]] -name = "corosensei" -version = "0.1.3" +name = "cc" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "autocfg", - "cfg-if", "libc", - "scopeguard", - "windows-sys 0.33.0", ] [[package]] -name = "cpufeatures" -version = "0.2.7" +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cpp_demangle" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "libc", + "cfg-if", ] [[package]] name = "cranelift-bforest" -version = "0.91.1" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" +checksum = "5a91a1ccf6fb772808742db2f51e2179f25b1ec559cbe39ea080c72ff61caf8f" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.91.1" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" +checksum = "169db1a457791bff4fd1fc585bb5cc515609647e0420a7d5c98d7700c59c2d00" dependencies = [ - "arrayvec", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", - "cranelift-egraph", + "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", + "gimli 0.27.3", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -250,44 +260,42 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.91.1" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" +checksum = "3486b93751ef19e6d6eef66d2c0e83ed3d2ba01da1919ed2747f2f7bd8ba3419" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.91.1" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" +checksum = "86a1205ab18e7cd25dc4eca5246e56b506ced3feb8d95a8d776195e48d2cd4ef" [[package]] -name = "cranelift-egraph" -version = "0.91.1" +name = "cranelift-control" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +checksum = "1b108cae0f724ddfdec1871a0dc193a607e0c2d960f083cfefaae8ccf655eff2" dependencies = [ - "cranelift-entity", - "fxhash", - "hashbrown", - "indexmap", - "log", - "smallvec", + "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.91.1" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" +checksum = "720444006240622798665bfc6aa8178e2eed556da342fda62f659c5267c3c659" +dependencies = [ + "serde", +] [[package]] name = "cranelift-frontend" -version = "0.91.1" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" +checksum = "b7a94c4c5508b7407e125af9d5320694b7423322e59a4ac0d07919ae254347ca" dependencies = [ "cranelift-codegen", "log", @@ -297,125 +305,53 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" - -[[package]] -name = "critical-section" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" -dependencies = [ - "darling_core", - "darling_macro", -] +checksum = "ef1f888d0845dcd6be4d625b91d9d8308f3d95bed5c5d4072ce38e1917faa505" [[package]] -name = "darling_core" -version = "0.20.1" +name = "cranelift-native" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "9ad5966da08f1e96a3ae63be49966a85c9b249fa465f8cf1b66469a82b1004a0" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn 2.0.31", + "cranelift-codegen", + "libc", + "target-lexicon", ] [[package]] -name = "darling_macro" -version = "0.20.1" +name = "cranelift-wasm" +version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "0d8635c88b424f1d232436f683a301143b36953cd98fc6f86f7bac862dfeb6f5" dependencies = [ - "darling_core", - "quote", - "syn 2.0.31", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.10.5", + "log", + "smallvec", + "wasmparser 0.110.0", + "wasmtime-types", ] [[package]] -name = "dashmap" -version = "5.4.0" +name = "crc32fast" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "debugid" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "uuid", ] [[package]] @@ -424,16 +360,6 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "crypto-common", -] - [[package]] name = "dirs" version = "4.0.0" @@ -454,68 +380,36 @@ dependencies = [ "winapi", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "enum-iterator" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] -name = "enumset" -version = "1.0.13" +name = "encoding_rs" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b025475ad197bd8b4a9bdce339216b6cf3bd568bf2e107c286b51613f0b3cf" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "enumset_derive", + "cfg-if", ] [[package]] -name = "enumset_derive" -version = "0.7.0" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c2852ff17a4c9a2bb2abbca3074737919cb05dc24b0a8ca9498081a7033dd6" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.31", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -536,11 +430,19 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fd-lock" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" dependencies = [ - "instant", + "cfg-if", + "rustix 0.38.13", + "windows-sys", ] [[package]] @@ -550,18 +452,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] -name = "fnv" -version = "1.0.7" +name = "form_urlencoded" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] [[package]] -name = "form_urlencoded" -version = "1.1.0" +name = "fs-set-times" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "dd738b84894214045e8414eaded76359b4a5773f0a0a56b16575110739cdcf39" dependencies = [ - "percent-encoding", + "io-lifetimes 2.0.2", + "rustix 0.38.13", + "windows-sys", ] [[package]] @@ -620,7 +527,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn", ] [[package]] @@ -663,90 +570,66 @@ dependencies = [ ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "fxprof-processed-profile" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "typenum", - "version_check", + "bitflags 2.4.0", + "debugid", + "fxhash", + "serde", + "serde_json", ] [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hash32" -version = "0.2.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] [[package]] -name = "heapless" -version = "0.7.16" +name = "hashbrown" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "atomic-polyfill", - "hash32", - "rustc_version 0.4.0", - "spin", - "stable_deref_trait", + "ahash", ] [[package]] -name = "heck" -version = "0.3.3" +name = "hashbrown" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -756,34 +639,17 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "hex" -version = "0.4.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "http" -version = "0.2.9" +name = "home" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "bytes", - "fnv", - "itoa", + "windows-sys", ] [[package]] @@ -792,17 +658,11 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -815,28 +675,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", "serde", ] [[package]] -name = "instant" -version = "0.1.12" +name = "io-extras" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "9d3c230ee517ee76b1cc593b52939ff68deda3fae9e41eca426c6b4993df51c4" dependencies = [ - "cfg-if", + "io-lifetimes 2.0.2", + "windows-sys", ] [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", - "windows-sys 0.48.0", + "windows-sys", +] + +[[package]] +name = "io-lifetimes" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c" + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi", + "rustix 0.38.13", + "windows-sys", ] [[package]] @@ -849,19 +743,19 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "1.0.6" +name = "itertools" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] [[package]] -name = "js-sys" -version = "0.3.61" +name = "itoa" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" -dependencies = [ - "wasm-bindgen", -] +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "lazy_static" @@ -875,60 +769,29 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" -[[package]] -name = "lexical-sort" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09e4591611e231daf4d4c685a66cb0410cc1e502027a20ae55f2bb9e997207a" -dependencies = [ - "any_ascii", -] - [[package]] name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linked_hash_set" -version = "0.1.4" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" -dependencies = [ - "linked-hash-map", -] +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] -name = "lock_api" -version = "0.4.9" +name = "linux-raw-sys" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "mach" @@ -945,44 +808,55 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] -name = "memmap2" -version = "0.5.10" +name = "memfd" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "libc", + "rustix 0.37.23", ] [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] -name = "more-asserts" -version = "0.2.2" +name = "mio" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] [[package]] name = "multimap" @@ -1011,49 +885,40 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] [[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" +name = "object" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", + "crc32fast", + "hashbrown 0.13.2", + "indexmap 1.9.3", + "memchr", ] [[package]] name = "object" -version = "0.30.3" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "overload" @@ -1062,65 +927,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "parking_lot_core" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "windows-sys 0.45.0", -] - -[[package]] -name = "path-clean" -version = "0.1.0" +name = "paste" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "indexmap 2.0.0", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1134,6 +966,8 @@ version = "35.0.0" dependencies = [ "anyhow", "assert_matches", + "async-trait", + "futures", "maplit", "nanoem-protobuf", "pretty_assertions", @@ -1144,8 +978,10 @@ dependencies = [ "tracing", "tracing-subscriber", "walkdir", - "wasmer", - "wasmer-wasix", + "wasi-common", + "wasmtime", + "wasmtime-wasi", + "zerocopy", ] [[package]] @@ -1211,63 +1047,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.31", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "syn", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8473a65b88506c106c28ae905ca4a2b83a2993640467a41bb3080627ddfd2c" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" dependencies = [ "bytes", "prost-derive", @@ -1275,13 +1071,13 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d3e647e9eb04ddfef78dfee2d5b3fefdf94821c84b710a3d8ebc89ede8b164" +checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" dependencies = [ "bytes", - "heck 0.4.1", - "itertools", + "heck", + "itertools 0.11.0", "log", "multimap", "once_cell", @@ -1290,69 +1086,58 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.31", + "syn", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56075c27b20ae524d00f247b8a4dc333e5784f889fe63099f8e626bc8d73486c" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" dependencies = [ "anyhow", - "itertools", + "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.31", + "syn", ] [[package]] name = "prost-types" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cebe0a918c97f86c217b0f76fd754e966f8b9f41595095cf7d74cb4e59d730f6" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ "prost", ] [[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" +name = "psm" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "cc", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ - "bitflags", + "bitflags 1.3.2", "memchr", "unicase", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1387,35 +1172,13 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "redox_syscall" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1424,7 +1187,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1440,77 +1203,45 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.5.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +checksum = "5b4dcbd3a2ae7fb94b5813fa0e957c6ab51bf5d0a8ee1b69e0c2d0f1e6eb8485" dependencies = [ - "fxhash", + "hashbrown 0.13.2", "log", + "rustc-hash", "slice-group-by", "smallvec", ] [[package]] name = "regex" -version = "1.8.1" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", "regex-syntax", ] [[package]] -name = "regex-syntax" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" - -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - -[[package]] -name = "rend" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "rkyv" -version = "0.7.41" +name = "regex-automata" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21499ed91807f07ae081880aabb2ccc0235e9d88011867d984525e9a4c3cfa3e" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ - "bytecheck", - "hashbrown", - "indexmap", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "rkyv_derive" -version = "0.7.41" +name = "regex-syntax" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1c672430eb41556291981f45ca900a0239ad007242d1cb4b4167af842db666" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rustc-demangle" @@ -1519,42 +1250,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] -name = "rustc_version" -version = "0.2.3" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "rustix" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "semver 1.0.17", + "bitflags 1.3.2", + "errno", + "io-lifetimes 1.0.11", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys", ] [[package]] name = "rustix" -version = "0.37.19" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ - "bitflags", + "bitflags 2.4.0", "errno", - "io-lifetimes", + "itoa", "libc", - "linux-raw-sys", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.7", + "once_cell", + "windows-sys", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -1565,38 +1299,11 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" @@ -1607,27 +1314,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.188" @@ -1636,58 +1322,20 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn", ] [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" -dependencies = [ - "indexmap", - "ryu", - "serde", - "yaml-rust", -] - -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sharded-slab" version = "0.1.4" @@ -1706,17 +1354,11 @@ dependencies = [ "dirs", ] -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -1729,19 +1371,26 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] -name = "spin" -version = "0.9.8" +name = "socket2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ - "lock_api", + "libc", + "windows-sys", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1749,141 +1398,69 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "standback" -version = "0.2.17" +name = "syn" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ - "version_check", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "stdweb" -version = "0.4.20" +name = "system-interface" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +checksum = "27ce32341b2c0b70c144bbf35627fdc1ef18c76ced5e5e7b3ee8b5ba6b2ab6a0" dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", + "bitflags 2.4.0", + "cap-fs-ext", + "cap-std", + "fd-lock", + "io-lifetimes 2.0.2", + "rustix 0.38.13", + "windows-sys", + "winx", ] [[package]] -name = "stdweb-derive" -version = "0.5.3" +name = "target-lexicon" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 1.0.109", -] +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] -name = "stdweb-internal-macros" -version = "0.2.9" +name = "tempfile" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn 1.0.109", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.38.13", + "windows-sys", ] [[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" +name = "thiserror" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] [[package]] -name = "syn" -version = "1.0.109" +name = "thiserror-impl" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "target-lexicon" -version = "0.12.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" - -[[package]] -name = "tempfile" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys 0.45.0", -] - -[[package]] -name = "term_size" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "termios" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" -dependencies = [ - "libc", -] - -[[package]] -name = "thiserror" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", + "syn", ] [[package]] @@ -1896,44 +1473,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros", - "version_check", - "winapi", -] - -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn 1.0.109", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1951,44 +1490,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", + "backtrace", "bytes", + "libc", + "mio", "num_cpus", "pin-project-lite", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[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.31", -] - -[[package]] -name = "toml_datetime" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" - -[[package]] -name = "toml_edit" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", + "socket2", + "windows-sys", ] [[package]] @@ -1998,6 +1511,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2005,20 +1519,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -2049,17 +1563,11 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -2072,9 +1580,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -2085,18 +1593,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "unicode-xid" version = "0.2.4" @@ -2105,21 +1601,20 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", ] [[package]] -name = "urlencoding" -version = "2.1.2" +name = "uuid" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" [[package]] name = "valuable" @@ -2134,518 +1629,464 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "virtual-fs" -version = "0.2.0" +name = "walkdir" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba2b45886b577c5a11b5d3165b0410620ff508b0acfa91e5b024935de792e8e" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ - "anyhow", - "async-trait", - "bytes", - "derivative", - "getrandom", - "indexmap", - "lazy_static", - "pin-project-lite", - "slab", - "thiserror", - "tokio", - "tracing", - "webc", + "same-file", + "winapi-util", ] [[package]] -name = "virtual-net" -version = "0.1.0" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e043eb813b35633445d602acf13df921a8a1ac8833818fb8f891e2f6223fedd7" -dependencies = [ - "async-trait", - "bytes", - "thiserror", - "tracing", -] +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wai-bindgen-gen-core" -version = "0.2.3" +name = "wasi-cap-std-sync" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa3dc41b510811122b3088197234c27e08fcad63ef936306dd8e11e2803876c" +checksum = "3b8bb7213a65e753e110c36f904d9491e23c763183bd8aa82f5ce721ca647177" dependencies = [ "anyhow", - "wai-parser", -] - -[[package]] -name = "wai-bindgen-gen-rust" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc05e8380515c4337c40ef03b2ff233e391315b178a320de8640703d522efe" -dependencies = [ - "heck 0.3.3", - "wai-bindgen-gen-core", + "async-trait", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "io-extras", + "io-lifetimes 2.0.2", + "is-terminal", + "once_cell", + "rustix 0.38.13", + "system-interface", + "tracing", + "wasi-common", + "windows-sys", ] [[package]] -name = "wai-bindgen-gen-rust-wasm" -version = "0.2.3" +name = "wasi-common" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f35ce5e74086fac87f3a7bd50f643f00fe3559adb75c88521ecaa01c8a6199" +checksum = "a99e7c55c22a7c776a2169bcd72a310806004e3d298151036f0452a6c3ebe56d" dependencies = [ - "heck 0.3.3", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust", + "anyhow", + "bitflags 2.4.0", + "cap-rand", + "cap-std", + "io-extras", + "log", + "rustix 0.38.13", + "thiserror", + "tracing", + "wasmtime", + "wiggle", + "windows-sys", ] [[package]] -name = "wai-bindgen-gen-wasmer" -version = "0.2.3" +name = "wasm-encoder" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f61484185d8c520a86d5a7f7f8265f446617c2f9774b2e20a52de19b6e53432" +checksum = "41763f20eafed1399fff1afb466496d3a959f58241436cfdc17e3f5ca954de16" dependencies = [ - "heck 0.3.3", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust", + "leb128", ] [[package]] -name = "wai-bindgen-rust" -version = "0.2.3" +name = "wasmparser" +version = "0.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5601c6f448c063e83a5e931b8fefcdf7e01ada424ad42372c948d2e3d67741" +checksum = "1dfcdb72d96f01e6c85b6bf20102e7423bdbaad5c337301bab2bbf253d26413c" dependencies = [ - "bitflags", - "wai-bindgen-rust-impl", + "indexmap 2.0.0", + "semver", ] [[package]] -name = "wai-bindgen-rust-impl" -version = "0.2.3" +name = "wasmparser" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdeeb5c1170246de8425a3e123e7ef260dc05ba2b522a1d369fe2315376efea4" +checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" dependencies = [ - "proc-macro2", - "syn 1.0.109", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust-wasm", + "indexmap 2.0.0", + "semver", ] [[package]] -name = "wai-bindgen-wasmer" -version = "0.4.0" +name = "wasmprinter" +version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e1e0eda6f3b18f1b630eabc3d82b3b8ca74749b89e73b7bba0999726ebfae04" +checksum = "34ddf5892036cd4b780d505eff1194a0cbc10ed896097656fdcea3744b5e7c2f" dependencies = [ "anyhow", - "bitflags", - "once_cell", - "thiserror", - "tracing", - "wai-bindgen-wasmer-impl", - "wasmer", -] - -[[package]] -name = "wai-bindgen-wasmer-impl" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b3488ed88d4dd0e3bf85bad4e27dac6cb31aae5d122a5dda2424803c8dc863a" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "wai-bindgen-gen-core", - "wai-bindgen-gen-wasmer", + "wasmparser 0.112.0", ] [[package]] -name = "wai-parser" -version = "0.2.3" +name = "wasmtime" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd0acb6d70885ea0c343749019ba74f015f64a9d30542e66db69b49b7e28186" +checksum = "c4e87029cc5760db9a3774aff4708596fe90c20ed2baeef97212e98b812fd0fc" dependencies = [ "anyhow", - "id-arena", - "pulldown-cmark", - "unicode-normalization", - "unicode-xid", -] - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", + "async-trait", + "bincode", + "bumpalo", + "cfg-if", + "encoding_rs", + "fxprof-processed-profile", + "indexmap 2.0.0", + "libc", + "log", + "object 0.31.1", + "once_cell", + "paste", + "psm", + "serde", + "serde_json", + "target-lexicon", + "wasm-encoder", + "wasmparser 0.110.0", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit", + "wasmtime-runtime", + "wasmtime-winch", + "windows-sys", ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "wasmtime-asm-macros" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "96d84f68d831200016e120f2ee79d81b50cf4c4123112914aefb168d036d445d" dependencies = [ "cfg-if", - "wasm-bindgen-macro", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.84" +name = "wasmtime-component-macro" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "8e7e07b8da23838e870c4c092027208ac546398a2ac4f5afff33a1ea1d763ec0" dependencies = [ - "bumpalo", - "log", - "once_cell", + "anyhow", "proc-macro2", "quote", - "syn 1.0.109", - "wasm-bindgen-shared", + "syn", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", ] [[package]] -name = "wasm-bindgen-downcast" -version = "0.1.1" +name = "wasmtime-component-util" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dac026d43bcca6e7ce1c0956ba68f59edf6403e8e930a5d891be72c31a44340" -dependencies = [ - "js-sys", - "once_cell", - "wasm-bindgen", - "wasm-bindgen-downcast-macros", -] +checksum = "74f421bc59c753dcd24e39601928a0f2915adf15f40d8ba0066c4cf23f92c9a0" [[package]] -name = "wasm-bindgen-downcast-macros" -version = "0.1.1" +name = "wasmtime-cranelift" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" +checksum = "8ae8ed7a4845f22be6b1ad80f33f43fa03445b03a02f2d40dca695129769cd1a" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "anyhow", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.27.3", + "log", + "object 0.31.1", + "target-lexicon", + "thiserror", + "wasmparser 0.110.0", + "wasmtime-cranelift-shared", + "wasmtime-environ", + "wasmtime-versioned-export-macros", ] [[package]] -name = "wasm-bindgen-macro" -version = "0.2.84" +name = "wasmtime-cranelift-shared" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "86b17099f9320a1c481634d88101258917d5065717cf22b04ed75b1a8ea062b4" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "anyhow", + "cranelift-codegen", + "cranelift-control", + "cranelift-native", + "gimli 0.27.3", + "object 0.31.1", + "target-lexicon", + "wasmtime-environ", ] [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.84" +name = "wasmtime-environ" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "e8b9227b1001229ff125e0f76bf1d5b9dc4895e6bcfd5cc35a56f84685964ec7" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "anyhow", + "cranelift-entity", + "gimli 0.27.3", + "indexmap 2.0.0", + "log", + "object 0.31.1", + "serde", + "target-lexicon", + "thiserror", + "wasm-encoder", + "wasmparser 0.110.0", + "wasmprinter", + "wasmtime-component-util", + "wasmtime-types", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.84" +name = "wasmtime-fiber" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" - -[[package]] -name = "wasm-encoder" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05d0b6fcd0aeb98adf16e7975331b3c17222aa815148f5b976370ce589d80ef" +checksum = "fc8c8410c03a79073ea06806ccde3da4854c646bd646b3b2707b99b3746c3f70" dependencies = [ - "leb128", + "cc", + "cfg-if", + "rustix 0.38.13", + "wasmtime-asm-macros", + "wasmtime-versioned-export-macros", + "windows-sys", ] [[package]] -name = "wasmer" -version = "3.3.0" +name = "wasmtime-jit" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78caedecd8cb71ed47ccca03b68d69414a3d278bb031e6f93f15759344efdd52" +checksum = "cce606b392c321d7272928003543447119ef937a9c3ebfce5c4bb0bf6b0f5bac" dependencies = [ - "bytes", + "addr2line 0.20.0", + "anyhow", + "bincode", "cfg-if", - "derivative", - "indexmap", - "js-sys", - "more-asserts", + "cpp_demangle", + "gimli 0.27.3", + "log", + "object 0.31.1", "rustc-demangle", + "rustix 0.38.13", "serde", - "serde-wasm-bindgen", "target-lexicon", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-downcast", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-derive", - "wasmer-types", - "wasmer-vm", - "wat", - "winapi", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys", ] [[package]] -name = "wasmer-compiler" -version = "3.3.0" +name = "wasmtime-jit-debug" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726a8450541af4a57c34af7b6973fdbfc79f896cc7e733429577dfd1d1687180" +checksum = "aef27ea6c34ef888030d15560037fe7ef27a5609fbbba8e1e3e41dc4245f5bb2" dependencies = [ - "backtrace", - "cfg-if", - "enum-iterator", - "enumset", - "lazy_static", - "leb128", - "memmap2", - "more-asserts", - "region", - "smallvec", - "thiserror", - "wasmer-types", - "wasmer-vm", - "wasmparser", - "winapi", + "once_cell", + "wasmtime-versioned-export-macros", ] [[package]] -name = "wasmer-compiler-cranelift" -version = "3.3.0" +name = "wasmtime-jit-icache-coherence" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e5633f90f372563ebbdf3f9799c7b29ba11c90e56cf9b54017112d2e656c95" +checksum = "b59f94b0409221873565419168e20b5aedf18c4bd64de5c38acf8f0634efeee3" dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.2", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "cfg-if", + "libc", + "windows-sys", ] [[package]] -name = "wasmer-derive" -version = "3.3.0" +name = "wasmtime-runtime" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97901fdbaae383dbb90ea162cc3a76a9fa58ac39aec7948b4c0b9bbef9307738" +checksum = "ceb587a88ae5bb6ca248455a391aff29ac63329a404b2cdea36d91267c797db4" dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "anyhow", + "cc", + "cfg-if", + "encoding_rs", + "indexmap 2.0.0", + "libc", + "log", + "mach", + "memfd", + "memoffset", + "paste", + "rand", + "rustix 0.38.13", + "sptr", + "wasm-encoder", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "wasmtime-versioned-export-macros", + "windows-sys", ] [[package]] -name = "wasmer-types" -version = "3.3.0" +name = "wasmtime-types" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f1f2839f4f61509550e4ddcd0e658e19f3af862b51c79fda15549d735d659b" +checksum = "77943729d4b46141538e8d0b6168915dc5f88575ecdfea26753fd3ba8bab244a" dependencies = [ - "bytecheck", - "enum-iterator", - "enumset", - "indexmap", - "more-asserts", - "rkyv", - "target-lexicon", + "cranelift-entity", + "serde", "thiserror", + "wasmparser 0.110.0", ] [[package]] -name = "wasmer-vm" -version = "3.3.0" +name = "wasmtime-versioned-export-macros" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043118ec4f16d1714fed3aab758b502b864bd865e1d5188626c9ad290100563f" +checksum = "ca7af9bb3ee875c4907835e607a275d10b04d15623d3aebe01afe8fbd3f85050" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "dashmap", - "derivative", - "enum-iterator", - "fnv", - "indexmap", - "lazy_static", - "libc", - "mach", - "memoffset", - "more-asserts", - "region", - "scopeguard", - "thiserror", - "wasmer-types", - "winapi", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "wasmer-wasix" -version = "0.4.0" +name = "wasmtime-wasi" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c216facb6a1aae257e38f2018a27b270765aa9d386166e28afecd4004c306cbc" +checksum = "50e107275b5a0144e2965985d14fac61fa46f804755e71c44eeef7b37510db54" dependencies = [ "anyhow", "async-trait", - "bincode", + "bitflags 2.4.0", "bytes", - "cfg-if", - "cooked-waker", - "derivative", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", "futures", - "getrandom", - "heapless", - "hex", - "http", - "lazy_static", + "io-extras", "libc", - "linked_hash_set", "once_cell", - "pin-project", - "rand", - "serde", - "serde_derive", - "serde_json", - "serde_yaml", - "sha2", - "shellexpand", - "term_size", - "termios", + "rustix 0.38.13", + "system-interface", "thiserror", "tokio", "tracing", - "urlencoding", - "virtual-fs", - "virtual-net", - "wai-bindgen-wasmer", - "waker-fn", - "wasm-bindgen", - "wasmer", - "wasmer-types", - "wasmer-wasix-types", - "webc", - "weezl", - "winapi", + "wasi-cap-std-sync", + "wasi-common", + "wasmtime", + "wiggle", + "windows-sys", ] [[package]] -name = "wasmer-wasix-types" -version = "0.4.0" +name = "wasmtime-winch" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34aaac6706d29f89a771f2a58bd7e93628ef65344a39d993bdd717c62aafc27" +checksum = "bcdfbdbb400f63e4dfc6dd32f42c77484da58c9622cdd9e9aac238c7347afdf1" dependencies = [ "anyhow", - "bitflags", - "byteorder", - "cfg-if", - "num_enum", - "time", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust", - "wai-bindgen-gen-rust-wasm", - "wai-bindgen-rust", - "wai-parser", - "wasmer", - "wasmer-derive", - "wasmer-types", + "cranelift-codegen", + "gimli 0.27.3", + "object 0.31.1", + "target-lexicon", + "wasmparser 0.110.0", + "wasmtime-cranelift-shared", + "wasmtime-environ", + "winch-codegen", ] [[package]] -name = "wasmparser" -version = "0.95.0" +name = "wasmtime-wit-bindgen" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" +checksum = "14770d0820f56ba86cdd9987aef97cc3bacbb0394633c37dbfbc61ef29603a71" dependencies = [ - "indexmap", - "url", + "anyhow", + "heck", + "indexmap 2.0.0", + "wit-parser", ] [[package]] name = "wast" -version = "57.0.0" +version = "35.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb0f5ed17ac4421193c7477da05892c2edafd67f9639e3c11a82086416662dc" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" dependencies = [ "leb128", - "memchr", - "unicode-width", - "wasm-encoder", ] [[package]] -name = "wat" -version = "1.0.63" +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9ab0d87337c3be2bb6fc5cd331c4ba9fd6bcb4ee85048a0dd59ed9ecf92e53" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ - "wast", + "either", + "home", + "once_cell", + "rustix 0.38.13", ] [[package]] -name = "webc" -version = "5.0.0" +name = "wiggle" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06bee486f9207604f99bfa3c95afcd03272d95db5872c6c1b11470be4390d514" +checksum = "3b68b8c7e33b826fefcedd4fdaba18b45e802949039976dfed2ec4eed62e01dc" dependencies = [ "anyhow", - "base64", - "byteorder", - "bytes", - "indexmap", - "leb128", - "lexical-sort", - "memmap2", - "once_cell", - "path-clean", - "rand", - "serde", - "serde_cbor", - "serde_json", - "sha2", + "async-trait", + "bitflags 2.4.0", "thiserror", - "url", - "walkdir", + "tracing", + "wasmtime", + "wiggle-macro", ] [[package]] -name = "weezl" -version = "0.1.7" +name = "wiggle-generate" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "a1993fafe27277a5f3d3e8799d027fb1d4cf715cb7706bc50f13dbc06197800e" +dependencies = [ + "anyhow", + "heck", + "proc-macro2", + "quote", + "shellexpand", + "syn", + "witx", +] [[package]] -name = "which" -version = "4.4.0" +name = "wiggle-macro" +version = "12.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "b71eb22a17666b04cd9273983ec00ccbd3085cae494ae08dba733e65465cf6e7" dependencies = [ - "either", - "libc", - "once_cell", + "proc-macro2", + "quote", + "syn", + "wiggle-generate", ] [[package]] @@ -2680,25 +2121,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.33.0" +name = "winch-codegen" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "9722f5d601e3ea1cab8cc23f8e4c07c57d6657a1d72ef4c3a064100cca725a20" dependencies = [ - "windows_aarch64_msvc 0.33.0", - "windows_i686_gnu 0.33.0", - "windows_i686_msvc 0.33.0", - "windows_x86_64_gnu 0.33.0", - "windows_x86_64_msvc 0.33.0", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "anyhow", + "cranelift-codegen", + "gimli 0.27.3", + "regalloc2", + "smallvec", + "target-lexicon", + "wasmparser 0.110.0", + "wasmtime-environ", ] [[package]] @@ -2707,173 +2142,127 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.33.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.33.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" +name = "windows_x86_64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" +name = "winx" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "357bb8e2932df531f83b052264b050b81ba0df90ee5a59b2d1d3949f344f81e5" +dependencies = [ + "bitflags 2.4.0", + "windows-sys", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "wit-parser" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "541efa2046e544de53a9da1e2f6299e63079840360c9e106f1f8275a97771318" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.0.0", + "log", + "pulldown-cmark", + "semver", + "unicode-xid", + "url", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "witx" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" +dependencies = [ + "anyhow", + "log", + "thiserror", + "wast", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" +name = "yansi" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] -name = "winnow" -version = "0.4.6" +name = "zerocopy" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "870cdd4b8b867698aea998d95bcc06c1d75fe566267781ee6f5ae8c9c45a3930" dependencies = [ - "memchr", + "byteorder", + "zerocopy-derive", ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "zerocopy-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "e9c6f95fa5657518b36c6784ba7cdd89e8bdf9a16e58266085248bfb950860c5" dependencies = [ - "linked-hash-map", + "proc-macro2", + "quote", + "syn", ] - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/rust/deny.toml b/rust/deny.toml index 52dd8faf..443d01ac 100644 --- a/rust/deny.toml +++ b/rust/deny.toml @@ -5,12 +5,7 @@ vulnerability = "deny" unmaintained = "warn" yanked = "warn" notice = "warn" -ignore = [ - "RUSTSEC-2020-0056", # unmaintained stdweb issue - "RUSTSEC-2020-0163", # unmaintained term_size issue - "RUSTSEC-2020-0168", # unmaintained mach issue - "RUSTSEC-2021-0127", # unmaintained serde_cbor issue -] +ignore = ["RUSTSEC-2020-0168"] [licenses] unlicensed = "deny" @@ -20,9 +15,6 @@ allow = [ "Apache-2.0 WITH LLVM-exception", "BSD-3-Clause", "BSD-2-Clause", - "BUSL-1.1", - "CC0-1.0", - "ISC", "MIT", "MPL-2.0", "Unicode-DFS-2016", diff --git a/rust/plugin_wasm/Cargo.toml b/rust/plugin_wasm/Cargo.toml index 06225087..225d57c5 100644 --- a/rust/plugin_wasm/Cargo.toml +++ b/rust/plugin_wasm/Cargo.toml @@ -10,16 +10,13 @@ anyhow = "1" nanoem-protobuf = { version = "35", path = "../protobuf" } tracing = { version = "0.1", default-features = false, features = ["std"] } tracing-subscriber = "0.3" -wasmer = { version = "3.3", default-features = false, features = [ - "sys", +wasmtime = { version = "12", default-features = false, features = [ "cranelift", + "pooling-allocator", ] } -wasmer-wasix = { version = "0.4", default-features = false, features = [ - "sys", - "sys-poll", - "sys-thread", -] } +wasmtime-wasi = { version = "12" } walkdir = "2" +zerocopy = "0.7" [dev-dependencies] serde = "1" @@ -29,6 +26,9 @@ maplit = "1" rand = "0.8" pretty_assertions = "1" assert_matches = "1" +async-trait = { version = "0.1" } +wasi-common = { version = "12" } +futures = { version = "0.3" } [lib] path = "src/lib.rs" diff --git a/rust/plugin_wasm/src/lib.rs b/rust/plugin_wasm/src/lib.rs index 6fa801c4..87169052 100644 --- a/rust/plugin_wasm/src/lib.rs +++ b/rust/plugin_wasm/src/lib.rs @@ -8,7 +8,8 @@ use core::slice; use std::mem::size_of; use anyhow::Result; -use wasmer::{Instance, Memory, Store, TypedFunction, WasmPtr}; +use wasmtime::{AsContextMut, Instance, Memory, TypedFunc}; +use zerocopy::AsBytes; pub(crate) const PLUGIN_MODEL_IO_ABI_VERSION: u32 = 2 << 16; pub(crate) const PLUGIN_MOTION_IO_ABI_VERSION: u32 = 2 << 16; @@ -38,10 +39,11 @@ impl nanoem_application_plugin_status_t { } } -pub(crate) type ByteArray = WasmPtr; -pub(crate) type OpaquePtr = WasmPtr; -pub(crate) type SizePtr = WasmPtr; -pub(crate) type StatusPtr = WasmPtr; +pub(crate) type ByteArray = i32; //WasmPtr; +pub(crate) type OpaquePtr = i32; //WasmPtr; +pub(crate) type SizePtr = i32; // WasmPtr; +pub(crate) type StatusPtr = i32; // WasmPtr; +type Store = wasmtime::Store; fn notify_export_function_error(name: &str) { tracing::warn!( @@ -53,29 +55,34 @@ fn notify_export_function_error(name: &str) { fn inner_get_data_internal( instance: &Instance, opaque: &OpaquePtr, - get_data_size: TypedFunction<(OpaquePtr, SizePtr), ()>, - get_data_body: TypedFunction<(OpaquePtr, ByteArray, u32, StatusPtr), ()>, + get_data_size: TypedFunc<(OpaquePtr, SizePtr), ()>, + get_data_body: TypedFunc<(OpaquePtr, ByteArray, u32, StatusPtr), ()>, output_data: &mut Vec, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { - let data_size_ptr = allocate_size_ptr(instance, store)?; - get_data_size.call(store, *opaque, data_size_ptr)?; - let data_size = data_size_ptr - .deref(&inner_memory(instance)?.view(store)) - .read()?; - let bytes = allocate_byte_array(instance, data_size, store)?; - let status_ptr = allocate_status_ptr(instance, store)?; - get_data_body.call(store, *opaque, bytes, data_size, status_ptr)?; - let cell = bytes.deref(&inner_memory(instance)?.view(store)).as_ptr32(); + let data_size_ptr = allocate_size_ptr(instance, store.as_context_mut())?; + get_data_size.call(store.as_context_mut(), (*opaque, data_size_ptr))?; + let mut data_size = 0; + inner_memory(instance, store.as_context_mut())?.read( + store.as_context_mut(), + data_size_ptr as usize, + data_size.as_bytes_mut(), + )?; + let bytes = allocate_byte_array(instance, data_size, store.as_context_mut())?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; + get_data_body.call( + store.as_context_mut(), + (*opaque, bytes, data_size, status_ptr), + )?; output_data.resize(data_size as usize, 0); - let view = inner_memory(instance)?.view(store); - let slice = cell.slice(&view, data_size)?; - for byte in slice.iter() { - output_data.push(byte.read()?); - } - release_byte_array(instance, bytes, store)?; - release_size_ptr(instance, data_size_ptr, store)?; - release_status_ptr(instance, status_ptr, store)?; + inner_memory(instance, store.as_context_mut())?.read( + store.as_context_mut(), + bytes as usize, + output_data, + )?; + release_byte_array(instance, bytes, store.as_context_mut())?; + release_size_ptr(instance, data_size_ptr, store.as_context_mut())?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; Ok(()) } @@ -85,27 +92,28 @@ fn inner_set_data_internal( data: &[u8], component_size: usize, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { if let Ok(set_input_model_data) = instance - .exports - .get_typed_function::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>(store, name) + .get_typed_func::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>(store.as_context_mut(), name) { - let data_ptr = allocate_byte_array_with_data(instance, data, store)?; - let status_ptr = allocate_status_ptr(instance, store)?; + let data_ptr = allocate_byte_array_with_data(instance, data, store.as_context_mut())?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; set_input_model_data.call( - store, - *opaque, - data_ptr, - if component_size > 1 { - (data.len() / component_size) as u32 - } else { - data.len() as u32 - }, - status_ptr, + store.as_context_mut(), + ( + *opaque, + data_ptr, + if component_size > 1 { + (data.len() / component_size) as u32 + } else { + data.len() as u32 + }, + status_ptr, + ), )?; - release_byte_array(instance, data_ptr, store)?; - release_status_ptr(instance, status_ptr, store)?; + release_byte_array(instance, data_ptr, store.as_context_mut())?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; } else { notify_export_function_error(name); } @@ -116,19 +124,20 @@ pub(crate) fn initialize_env_logger() { tracing_subscriber::fmt::try_init().unwrap_or_default(); } -pub(crate) fn inner_memory(instance: &Instance) -> Result<&Memory> { - Ok(instance.exports.get_memory("memory")?) +pub(crate) fn inner_memory(instance: &Instance, mut store: impl AsContextMut) -> Result { + instance + .get_memory(store.as_context_mut(), "memory") + .ok_or(anyhow::anyhow!("Cannot retrieve memory")) } pub(crate) fn allocate_byte_array( instance: &Instance, data_size: u32, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { - let malloc_func = instance - .exports - .get_typed_function::(store, MALLOC_FN)?; - let data_ptr = malloc_func.call(store, data_size)?; + let malloc_func = + instance.get_typed_func::(store.as_context_mut(), MALLOC_FN)?; + let data_ptr = malloc_func.call(store.as_context_mut(), data_size)?; tracing::debug!(size = data_size, "Allocated byte array"); Ok(data_ptr) } @@ -136,81 +145,110 @@ pub(crate) fn allocate_byte_array( pub(crate) fn allocate_byte_array_with_data( instance: &Instance, data: &[u8], - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { let data_size = data.len() as u32; - let data_ptr = allocate_byte_array(instance, data_size, store)?; - let view = inner_memory(instance)?.view(store); - let cell = data_ptr.deref(&view); - let ptr = cell.as_ptr32(); - for (offset, byte) in data.iter().enumerate() { - ptr.add_offset(offset as u32)?.write(&view, *byte)?; - } + let data_ptr = allocate_byte_array(instance, data_size, store.as_context_mut())?; + inner_memory(instance, store.as_context_mut())?.write( + store.as_context_mut(), + data_ptr as usize, + data, + )?; tracing::debug!(size = data_size, "Allocated byte array with data"); Ok(data_ptr) } -pub(crate) fn allocate_status_ptr(instance: &Instance, store: &mut Store) -> Result { - let malloc_func = instance - .exports - .get_typed_function::(store, MALLOC_FN)?; - let data_ptr = malloc_func.call(store, size_of::() as u32)?; - let view = inner_memory(instance)?.view(store); - data_ptr.deref(&view).write(0)?; +pub(crate) fn allocate_status_ptr( + instance: &Instance, + mut store: impl AsContextMut, +) -> Result { + let malloc_func = + instance.get_typed_func::(store.as_context_mut(), MALLOC_FN)?; + let data_ptr = malloc_func.call(store.as_context_mut(), size_of::() as u32)?; + inner_memory(instance, store.as_context_mut())?.write( + store.as_context_mut(), + data_ptr as usize, + 0u32.as_bytes(), + )?; Ok(data_ptr) } -pub(crate) fn allocate_size_ptr(instance: &Instance, store: &mut Store) -> Result { - let memory = inner_memory(instance)?; - let malloc_func = instance - .exports - .get_typed_function::(store, MALLOC_FN)?; - let size_ptr = malloc_func.call(store, size_of::() as u32)?; - let view = memory.view(store); - size_ptr.deref(&view).write(0)?; +pub(crate) fn allocate_size_ptr( + instance: &Instance, + mut store: impl AsContextMut, +) -> Result { + let malloc_func = instance.get_typed_func::(store.as_context_mut(), MALLOC_FN)?; + let size_ptr = malloc_func.call(store.as_context_mut(), size_of::() as u32)?; + inner_memory(instance, store.as_context_mut())?.write( + store.as_context_mut(), + size_ptr as usize, + 0u32.as_bytes(), + )?; Ok(size_ptr) } +pub(crate) fn read_utf8_string( + memory: Memory, + ptr: ByteArray, + mut store: impl AsContextMut, +) -> Result { + if let Some(size) = memory + .data(store.as_context_mut()) + .get(ptr as usize..) + .ok_or(anyhow::anyhow!( + "Cannot retrieve range from memory: {:x}", + ptr + ))? + .iter() + .position(|i| *i == 0) + { + let mut value = Vec::new(); + value.resize(size, 0); + memory.read(store.as_context_mut(), ptr as usize, value.as_mut())?; + Ok(String::from_utf8(value)?) + } else { + Err(anyhow::anyhow!("Cannot find null terminator: {:x}", ptr)) + } +} + pub(crate) fn release_byte_array( instance: &Instance, ptr: ByteArray, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { - let free_func = instance - .exports - .get_typed_function::(store, FREE_FN)?; - free_func.call(store, ptr)?; + let free_func = instance.get_typed_func::(store.as_context_mut(), FREE_FN)?; + free_func.call(store.as_context_mut(), ptr)?; tracing::debug!("Released byte array"); Ok(()) } -pub(crate) fn release_size_ptr(instance: &Instance, ptr: SizePtr, store: &mut Store) -> Result<()> { - let free_func = instance - .exports - .get_typed_function::(store, FREE_FN)?; - free_func.call(store, ptr)?; +pub(crate) fn release_size_ptr( + instance: &Instance, + ptr: SizePtr, + mut store: impl AsContextMut, +) -> Result<()> { + let free_func = instance.get_typed_func::(store.as_context_mut(), FREE_FN)?; + free_func.call(store.as_context_mut(), ptr)?; Ok(()) } pub(crate) fn release_status_ptr( instance: &Instance, ptr: StatusPtr, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { - let free_func = instance - .exports - .get_typed_function::(store, FREE_FN)?; - free_func.call(store, ptr)?; + let free_func = instance.get_typed_func::(store.as_context_mut(), FREE_FN)?; + free_func.call(store.as_context_mut(), ptr)?; Ok(()) } pub(crate) fn inner_initialize_function( instance: &Instance, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { - if let Ok(initialize) = instance.exports.get_typed_function::<(), ()>(store, name) { - initialize.call(store)?; + if let Ok(initialize) = instance.get_typed_func::<(), ()>(store.as_context_mut(), name) { + initialize.call(store.as_context_mut(), ())?; tracing::debug!(name = name, "Called initialization"); } else { notify_export_function_error(name); @@ -221,12 +259,10 @@ pub(crate) fn inner_initialize_function( pub(crate) fn inner_create_opaque( instance: &Instance, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { - let create = instance - .exports - .get_typed_function::<(), OpaquePtr>(store, name)?; - let opaque = create.call(store)?; + let create = instance.get_typed_func::<(), OpaquePtr>(store.as_context_mut(), name)?; + let opaque = create.call(store.as_context_mut(), ())?; tracing::debug!(name = name, opaque = ?opaque, "Called creating opaque"); Ok(opaque) } @@ -235,14 +271,12 @@ pub(crate) fn inner_destroy_opaque( instance: &Instance, opaque: &Option, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) { if let Some(opaque) = opaque { - if let Ok(destroy) = instance - .exports - .get_typed_function::(store, name) + if let Ok(destroy) = instance.get_typed_func::(store.as_context_mut(), name) { - match destroy.call(store, *opaque) { + match destroy.call(store.as_context_mut(), *opaque) { Ok(_) => tracing::debug!(name = name, opaque = ?opaque, "Called destroying opaque"), Err(err) => { tracing::warn!(name = name, opaque = ?opaque, error = %err, "Catched runtime error") @@ -252,9 +286,15 @@ pub(crate) fn inner_destroy_opaque( } } -pub(crate) fn inner_terminate_function(instance: &Instance, name: &str, store: &mut Store) { - if let Ok(terminate) = instance.exports.get_typed_function::<(), ()>(store, name) { - terminate.call(store).unwrap_or_default(); +pub(crate) fn inner_terminate_function( + instance: &Instance, + name: &str, + mut store: impl AsContextMut, +) { + if let Ok(terminate) = instance.get_typed_func::<(), ()>(store.as_context_mut(), name) { + terminate + .call(store.as_context_mut(), ()) + .unwrap_or_default(); tracing::debug!(name = name, "Called termination"); } else { notify_export_function_error(name); @@ -265,18 +305,18 @@ pub(crate) fn inner_get_string( instance: &Instance, opaque: &Option, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { if let Some(opaque) = opaque { - if let Ok(get_string) = instance - .exports - .get_typed_function::(store, name) + if let Ok(get_string) = + instance.get_typed_func::(store.as_context_mut(), name) { - let memory = inner_memory(instance)?; - let value = get_string - .call(store, *opaque)? - .read_utf8_string_with_nul(&memory.view(store)) - .unwrap_or_default(); + let ptr = get_string.call(store.as_context_mut(), *opaque)?; + let value = read_utf8_string( + inner_memory(instance, store.as_context_mut())?, + ptr, + store.as_context_mut(), + )?; tracing::debug!( name = name, opaque = ?opaque, @@ -298,11 +338,11 @@ pub(crate) fn inner_get_data( opaque: &Option, body_func_name: &str, size_func_name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result> { if let Some(opaque) = opaque { - let get_data_size = instance.exports.get_typed_function(store, size_func_name); - let get_data_body = instance.exports.get_typed_function(store, body_func_name); + let get_data_size = instance.get_typed_func(store.as_context_mut(), size_func_name); + let get_data_body = instance.get_typed_func(store.as_context_mut(), body_func_name); let mut output_data = Vec::new(); if get_data_size.is_ok() && get_data_body.is_ok() { let get_data_size = get_data_size?; @@ -313,7 +353,7 @@ pub(crate) fn inner_get_data( get_data_size, get_data_body, &mut output_data, - store, + store.as_context_mut(), )?; tracing::debug!( name = body_func_name, @@ -337,7 +377,7 @@ pub(crate) fn inner_set_data( ) -> Result<()> { if let Some(opaque) = opaque { let component_size = size_of::(); - let len = data.len() * component_size; + let len = std::mem::size_of_val(data); let data = unsafe { slice::from_raw_parts(data.as_ptr() as *const u8, len) }; inner_set_data_internal(instance, opaque, data, component_size, name, store)?; tracing::debug!(name = name, opaque = ?opaque, size = len, "Called setting data"); @@ -350,13 +390,12 @@ pub(crate) fn inner_set_language( opaque: &Option, value: i32, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { if let Some(opaque) = opaque { - let set_language = instance - .exports - .get_typed_function::<(OpaquePtr, i32), ()>(store, name)?; - set_language.call(store, *opaque, value)?; + let set_language = + instance.get_typed_func::<(OpaquePtr, i32), ()>(store.as_context_mut(), name)?; + set_language.call(store.as_context_mut(), (*opaque, value))?; tracing::debug!(name = name, opaque = ?opaque, value = value, "Called setting language"); } Ok(()) @@ -366,13 +405,12 @@ pub(crate) fn inner_count_all_functions( instance: &Instance, opaque: &Option, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { if let Some(opaque) = opaque { - let count_all_functions = instance - .exports - .get_typed_function::(store, name)?; - let count = count_all_functions.call(store, *opaque)?; + let count_all_functions = + instance.get_typed_func::(store.as_context_mut(), name)?; + let count = count_all_functions.call(store.as_context_mut(), *opaque)?; tracing::debug!(name = name, opaque = ?opaque, count = count, "Called counting all functions"); Ok(count) } else { @@ -385,17 +423,17 @@ pub(crate) fn inner_get_function_name( opaque: &Option, index: i32, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { if let Some(opaque) = opaque { - let get_function_name = instance - .exports - .get_typed_function::<(OpaquePtr, i32), ByteArray>(store, name)?; - let memory = inner_memory(instance)?; - let function_name = get_function_name - .call(store, *opaque, index)? - .read_utf8_string_with_nul(&memory.view(store)) - .unwrap_or_default(); + let get_function_name = + instance.get_typed_func::<(OpaquePtr, i32), ByteArray>(store.as_context_mut(), name)?; + let ptr = get_function_name.call(store.as_context_mut(), (*opaque, index))?; + let function_name = read_utf8_string( + inner_memory(instance, store.as_context_mut())?, + ptr, + store.as_context_mut(), + )?; tracing::debug!( name = name, opaque = ?opaque, @@ -414,17 +452,21 @@ pub(crate) fn inner_set_function( opaque: &Option, index: i32, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { let result = if let Some(opaque) = opaque { - let status_ptr = allocate_status_ptr(instance, store)?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; let set_function = instance - .exports - .get_typed_function::<(OpaquePtr, i32, StatusPtr), ()>(store, name)?; - set_function.call(store, *opaque, index, status_ptr)?; - let result = status_ptr.read(&inner_memory(instance)?.view(store))?; + .get_typed_func::<(OpaquePtr, i32, StatusPtr), ()>(store.as_context_mut(), name)?; + set_function.call(store.as_context_mut(), (*opaque, index, status_ptr))?; + let mut result = 0; + inner_memory(instance, store.as_context_mut())?.read( + store.as_context_mut(), + status_ptr as usize, + result.as_bytes_mut(), + )?; tracing::debug!(name = name, opaque = ?opaque, index = index, "Called setting function"); - release_status_ptr(instance, status_ptr, store)?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; result } else { nanoem_application_plugin_status_t::ERROR_NULL_OBJECT as i32 @@ -436,17 +478,21 @@ pub(crate) fn inner_execute( instance: &Instance, opaque: &Option, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { let result = if let Some(opaque) = opaque { - let status_ptr = allocate_status_ptr(instance, store)?; - let execute = instance - .exports - .get_typed_function::<(OpaquePtr, StatusPtr), ()>(store, name)?; - execute.call(store, *opaque, status_ptr)?; - let result = status_ptr.read(&inner_memory(instance)?.view(store))?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; + let execute = + instance.get_typed_func::<(OpaquePtr, StatusPtr), ()>(store.as_context_mut(), name)?; + execute.call(store.as_context_mut(), (*opaque, status_ptr))?; + let mut result = 0; + inner_memory(instance, store.as_context_mut())?.read( + store.as_context_mut(), + status_ptr as usize, + result.as_bytes_mut(), + )?; tracing::debug!(name = name, opaque = ?opaque, "Called executing function"); - release_status_ptr(instance, status_ptr, store)?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; result } else { nanoem_application_plugin_status_t::ERROR_NULL_OBJECT as i32 @@ -458,18 +504,22 @@ pub(crate) fn inner_load_ui_window( instance: &Instance, opaque: &Option, name: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { let result = if let Some(opaque) = opaque { - if let Ok(load_ui_window_layout) = instance - .exports - .get_typed_function::<(OpaquePtr, StatusPtr), ()>(store, name) + if let Ok(load_ui_window_layout) = + instance.get_typed_func::<(OpaquePtr, StatusPtr), ()>(store.as_context_mut(), name) { - let status_ptr = allocate_status_ptr(instance, store)?; - load_ui_window_layout.call(store, *opaque, status_ptr)?; - let result = status_ptr.read(&inner_memory(instance)?.view(store))?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; + load_ui_window_layout.call(store.as_context_mut(), (*opaque, status_ptr))?; + let mut result = 0; + inner_memory(instance, store.as_context_mut())?.read( + store.as_context_mut(), + status_ptr as usize, + result.as_bytes_mut(), + )?; tracing::debug!(name = name, opaque = ?opaque, "Called loading UI window"); - release_status_ptr(instance, status_ptr, store)?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; result } else { nanoem_application_plugin_status_t::SUCCESS as i32 @@ -487,38 +537,44 @@ pub(crate) fn inner_set_ui_component_layout( data: &[u8], name: &str, reload: &mut bool, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result { let result = if let Some(opaque) = opaque { - if let Ok(set_ui_component_layout) = instance.exports.get_typed_function::<( - OpaquePtr, - ByteArray, - ByteArray, - u32, - SizePtr, - StatusPtr, - ), ()>(store, name) + if let Ok(set_ui_component_layout) = + instance + .get_typed_func::<(OpaquePtr, ByteArray, ByteArray, u32, SizePtr, StatusPtr), ()>( + store.as_context_mut(), + name, + ) { - let id_ptr = allocate_byte_array_with_data(instance, id.as_bytes(), store)?; - let data_ptr = allocate_byte_array_with_data(instance, data, store)?; - let reload_layout_ptr = allocate_size_ptr(instance, store)?; - let status_ptr = allocate_status_ptr(instance, store)?; + let id_ptr = + allocate_byte_array_with_data(instance, id.as_bytes(), store.as_context_mut())?; + let data_ptr = allocate_byte_array_with_data(instance, data, store.as_context_mut())?; + let reload_layout_ptr = allocate_size_ptr(instance, store.as_context_mut())?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; set_ui_component_layout.call( - store, - *opaque, - id_ptr, - data_ptr, - data.len() as u32, - reload_layout_ptr, - status_ptr, + store.as_context_mut(), + ( + *opaque, + id_ptr, + data_ptr, + data.len() as u32, + reload_layout_ptr, + status_ptr, + ), )?; *reload = false; - let result = status_ptr.read(&inner_memory(instance)?.view(store))?; + let mut result = 0; + inner_memory(instance, store.as_context_mut())?.read( + store.as_context_mut(), + status_ptr as usize, + result.as_bytes_mut(), + )?; tracing::debug!(name = name, opaque = ?opaque, "Called setting UI component layout"); - release_byte_array(instance, id_ptr, store)?; - release_byte_array(instance, data_ptr, store)?; - release_size_ptr(instance, reload_layout_ptr, store)?; - release_status_ptr(instance, status_ptr, store)?; + release_byte_array(instance, id_ptr, store.as_context_mut())?; + release_byte_array(instance, data_ptr, store.as_context_mut())?; + release_size_ptr(instance, reload_layout_ptr, store.as_context_mut())?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; result } else { notify_export_function_error(name); diff --git a/rust/plugin_wasm/src/model/core.rs b/rust/plugin_wasm/src/model/core.rs index 4c42463d..8505f257 100644 --- a/rust/plugin_wasm/src/model/core.rs +++ b/rust/plugin_wasm/src/model/core.rs @@ -30,7 +30,8 @@ impl Drop for nanoem_application_plugin_model_io_t { impl nanoem_application_plugin_model_io_t { pub fn new(path: &CStr) -> Result { let path = Path::new(path.to_str()?); - let mut controller = ModelIOPluginController::from_path(path, |_| ())?; + let mut controller = + ModelIOPluginController::from_path(path, |builder| builder.inherit_stdio())?; controller.initialize()?; Ok(Self { controller }) } @@ -65,7 +66,7 @@ impl nanoem_application_plugin_model_io_t { } pub fn function_name(&self, value: i32) -> *const i8 { if let Ok(name) = self.controller.function_name(value) { - name.as_ptr() as *const i8 + name.as_ptr() } else { null() } diff --git a/rust/plugin_wasm/src/model/plugin.rs b/rust/plugin_wasm/src/model/plugin.rs index eb6cee97..84634bad 100644 --- a/rust/plugin_wasm/src/model/plugin.rs +++ b/rust/plugin_wasm/src/model/plugin.rs @@ -8,85 +8,93 @@ use std::{ffi::CString, path::Path}; use anyhow::Result; use walkdir::WalkDir; -use wasmer::{Instance, Module, Store}; -use wasmer_wasix::{wasmer_wasix_types::wasi::Errno, WasiEnv, WasiEnvBuilder, WasiFunctionEnv}; +use wasmtime::{AsContextMut, Engine, Instance, Linker, Module}; +use wasmtime_wasi::WasiCtxBuilder; use crate::{ inner_count_all_functions, inner_create_opaque, inner_destroy_opaque, inner_execute, inner_get_data, inner_get_function_name, inner_get_string, inner_initialize_function, inner_load_ui_window, inner_set_data, inner_set_function, inner_set_language, inner_set_ui_component_layout, inner_terminate_function, ByteArray, OpaquePtr, SizePtr, - StatusPtr, FREE_FN, MALLOC_FN, + StatusPtr, Store, FREE_FN, MALLOC_FN, }; -fn validate_plugin(instance: &Instance, store: &mut Store) -> Result<()> { - let e = &instance.exports; - e.get_memory("memory")?; - e.get_typed_function::(store, MALLOC_FN)?; - e.get_typed_function::(store, FREE_FN)?; - e.get_typed_function::<(), OpaquePtr>(store, "nanoemApplicationPluginModelIOCreate")?; - e.get_typed_function::(store, "nanoemApplicationPluginModelIOGetName")?; - e.get_typed_function::( - store, +fn validate_plugin(instance: &Instance, mut store: impl AsContextMut) -> Result<()> { + instance + .get_memory(store.as_context_mut(), "memory") + .unwrap(); + instance.get_typed_func::(store.as_context_mut(), MALLOC_FN)?; + instance.get_typed_func::(store.as_context_mut(), FREE_FN)?; + instance.get_typed_func::<(), OpaquePtr>( + store.as_context_mut(), + "nanoemApplicationPluginModelIOCreate", + )?; + instance.get_typed_func::( + store.as_context_mut(), + "nanoemApplicationPluginModelIOGetName", + )?; + instance.get_typed_func::( + store.as_context_mut(), "nanoemApplicationPluginModelIOGetVersion", )?; - e.get_typed_function::<(OpaquePtr, i32), ()>( - store, + instance.get_typed_func::<(OpaquePtr, i32), ()>( + store.as_context_mut(), "nanoemApplicationPluginModelIOSetLanguage", )?; - e.get_typed_function::( - store, + instance.get_typed_func::( + store.as_context_mut(), "nanoemApplicationPluginModelIOCountAllFunctions", )?; - e.get_typed_function::<(OpaquePtr, i32), ByteArray>( - store, + instance.get_typed_func::<(OpaquePtr, i32), ByteArray>( + store.as_context_mut(), "nanoemApplicationPluginModelIOGetFunctionName", )?; - e.get_typed_function::<(OpaquePtr, i32, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, i32, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginModelIOSetFunction", )?; - e.get_typed_function::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginModelIOSetInputModelData", )?; - e.get_typed_function::<(OpaquePtr, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginModelIOExecute", )?; - e.get_typed_function::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginModelIOGetOutputModelData", )?; - e.get_typed_function::<(OpaquePtr, SizePtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, SizePtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginModelIOGetOutputModelDataSize", )?; - e.get_typed_function::( - store, + instance.get_typed_func::( + store.as_context_mut(), "nanoemApplicationPluginModelIOGetFailureReason", )?; - e.get_typed_function::(store, "nanoemApplicationPluginModelIODestroy")?; + instance.get_typed_func::( + store.as_context_mut(), + "nanoemApplicationPluginModelIODestroy", + )?; Ok(()) } pub struct ModelIOPlugin { instance: Instance, store: Store, - env: WasiFunctionEnv, opaque: Option, } impl ModelIOPlugin { - pub fn new(bytes: &[u8], mut env: WasiFunctionEnv, mut store: Store) -> Result { - let module = Module::new(&store, bytes)?; - let imports = env.import_object(&mut store, &module)?; - let instance = Instance::new(&mut store, &module, &imports)?; - validate_plugin(&instance, &mut store)?; - env.initialize(&mut store, instance.clone())?; + pub fn new(engine: &Engine, bytes: &[u8], mut store: Store) -> Result { + let module = Module::new(engine, bytes)?; + let mut linker = Linker::new(engine); + wasmtime_wasi::add_to_linker(&mut linker, |ctx| ctx)?; + let instance = linker.instantiate(store.as_context_mut(), &module)?; + validate_plugin(&instance, store.as_context_mut())?; Ok(Self { instance, - env, store, opaque: None, }) @@ -364,17 +372,6 @@ impl ModelIOPlugin { &mut self.store, ) } - #[allow(dead_code)] - pub(super) fn wasi_env(&mut self) -> &mut WasiEnv { - self.env.env.as_mut(&mut self.store) - } -} - -impl Drop for ModelIOPlugin { - fn drop(&mut self) { - self.env - .cleanup(&mut self.store, Some(Errno::Success.into())); - } } pub struct ModelIOPluginController { @@ -396,9 +393,9 @@ impl ModelIOPluginController { recovery_suggestion: None, } } - pub fn from_path(path: &Path, builder_callback: F) -> Result + pub fn from_path(path: &Path, cb: F) -> Result where - F: Fn(&mut WasiEnvBuilder), + F: Fn(WasiCtxBuilder) -> WasiCtxBuilder, { let mut plugins = vec![]; for entry in WalkDir::new(path.parent().unwrap()) { @@ -406,11 +403,10 @@ impl ModelIOPluginController { let filename = entry.file_name().to_str(); if filename.map(|s| s.ends_with(".wasm")).unwrap_or(false) { let bytes = std::fs::read(entry.path())?; - let mut store = Store::default(); - let mut builder = WasiEnvBuilder::new("nanoem"); - builder_callback(&mut builder); - let env = builder.finalize(&mut store)?; - match ModelIOPlugin::new(&bytes, env, store) { + let data = cb(WasiCtxBuilder::new()).build(); + let engine = Engine::default(); + let store = Store::new(&engine, data); + match ModelIOPlugin::new(&engine, &bytes, store) { Ok(plugin) => { plugins.push(plugin); tracing::debug!(filename = filename.unwrap(), "Loaded model WASM plugin"); diff --git a/rust/plugin_wasm/src/model/test/full.rs b/rust/plugin_wasm/src/model/test/full.rs index cb7ff50c..5d6f1cbc 100644 --- a/rust/plugin_wasm/src/model/test/full.rs +++ b/rust/plugin_wasm/src/model/test/full.rs @@ -9,16 +9,16 @@ use assert_matches::assert_matches; use maplit::hashmap; use pretty_assertions::assert_eq; use serde_json::json; -use wasmer_wasix::Pipe; +use wasmtime_wasi::WasiFile; use crate::model::{ plugin::ModelIOPluginController, - test::{create_random_data, read_plugin_output, PluginOutput}, + test::{create_random_data, read_plugin_output, Pipe, PluginOutput}, }; use super::{build_type_and_flags, inner_create_controller}; -fn create_controller(pipe: Pipe) -> Result { +fn create_controller(pipe: Box) -> Result { let package = "plugin_wasm_test_model_full"; let (ty, flag) = build_type_and_flags(); inner_create_controller(pipe, &format!("target/wasm32-wasi/{ty}/{package}.wasm")).with_context( diff --git a/rust/plugin_wasm/src/model/test/minimum.rs b/rust/plugin_wasm/src/model/test/minimum.rs index 92eee7d2..ae3690b1 100644 --- a/rust/plugin_wasm/src/model/test/minimum.rs +++ b/rust/plugin_wasm/src/model/test/minimum.rs @@ -9,16 +9,15 @@ use assert_matches::assert_matches; use maplit::hashmap; use pretty_assertions::assert_eq; use serde_json::json; -use wasmer_wasix::Pipe; use crate::model::{ plugin::ModelIOPluginController, - test::{create_random_data, read_plugin_output, PluginOutput}, + test::{create_random_data, read_plugin_output, Pipe, PluginOutput}, }; use super::{build_type_and_flags, inner_create_controller}; -fn create_controller(pipe: Pipe) -> Result { +fn create_controller(pipe: Box) -> Result { let package = "plugin_wasm_test_model_minimum"; let (ty, flag) = build_type_and_flags(); inner_create_controller(pipe, &format!("target/wasm32-wasi/{ty}/{package}.wasm")).with_context( diff --git a/rust/plugin_wasm/src/model/test/mod.rs b/rust/plugin_wasm/src/model/test/mod.rs index ccb6340d..371f502a 100644 --- a/rust/plugin_wasm/src/model/test/mod.rs +++ b/rust/plugin_wasm/src/model/test/mod.rs @@ -5,9 +5,11 @@ */ use std::{ + any::Any, collections::{HashMap, HashSet}, env::current_dir, - io::Read, + io::IoSliceMut, + sync::{Arc, Mutex}, }; use anyhow::Result; @@ -15,8 +17,14 @@ use pretty_assertions::assert_eq; use rand::{thread_rng, Rng}; use serde_derive::{Deserialize, Serialize}; use serde_json::Value; -use wasmer::Store; -use wasmer_wasix::{Pipe, WasiEnvBuilder, WasiFunctionEnv}; +use wasi_common::{ + file::{FileType, Filestat}, + snapshots::preview_1::types::Error, +}; +use wasmtime::Engine; +use wasmtime_wasi::{WasiCtxBuilder, WasiFile}; + +use crate::Store; use super::plugin::{ModelIOPlugin, ModelIOPluginController}; @@ -26,6 +34,61 @@ struct PluginOutput { arguments: Option>, } +pub(super) struct Pipe { + content: Arc>>, +} + +impl Pipe { + pub fn channel() -> (Box, Box) { + let content = Arc::new(Mutex::new(Vec::new())); + ( + Box::new(Self { + content: Arc::clone(&content), + }), + Box::new(Self { + content: Arc::clone(&content), + }), + ) + } +} + +#[async_trait::async_trait] +impl WasiFile for Pipe { + fn as_any(&self) -> &dyn Any { + self + } + async fn get_filetype(&self) -> Result { + Ok(FileType::RegularFile) + } + async fn get_filestat(&self) -> Result { + Ok(Filestat { + device_id: 0, + inode: 0, + filetype: self.get_filetype().await?, + nlink: 0, + size: self.content.lock().unwrap().len() as _, + atim: None, + mtim: None, + ctim: None, + }) + } + async fn read_vectored<'a>(&self, _bufs: &mut [std::io::IoSliceMut<'a>]) -> Result { + let guard = self.content.lock().unwrap(); + for slice in _bufs.iter_mut() { + slice.copy_from_slice(guard.as_slice()); + } + Ok(guard.len() as _) + } + async fn write_vectored<'a>(&self, _bufs: &[std::io::IoSlice<'a>]) -> Result { + let mut guard = self.content.lock().unwrap(); + let size = guard.len(); + for slice in _bufs.iter() { + guard.extend(slice.iter()); + } + Ok((guard.len() - size) as _) + } +} + fn build_type_and_flags() -> (&'static str, &'static str) { if cfg!(debug_assertions) { ("debug", "") @@ -34,12 +97,6 @@ fn build_type_and_flags() -> (&'static str, &'static str) { } } -fn create_wasi_env(pipe: Pipe, store: &mut Store) -> Result { - Ok(WasiEnvBuilder::new("nanoem") - .stdout(Box::new(pipe)) - .finalize(store)?) -} - fn create_random_data(size: usize) -> Vec { let mut data = vec![]; let mut rng = thread_rng(); @@ -50,9 +107,12 @@ fn create_random_data(size: usize) -> Vec { data } -fn read_plugin_output(mut pipe: Pipe) -> Result> { - let mut s = String::new(); - pipe.read_to_string(&mut s)?; +fn read_plugin_output(pipe: Box) -> Result> { + let stat = futures::executor::block_on(pipe.get_filestat())?; + let mut buffer = Vec::new(); + buffer.resize(stat.size as _, 0); + futures::executor::block_on(pipe.read_vectored(&mut [IoSliceMut::new(&mut buffer)]))?; + let s = String::from_utf8(buffer)?; let mut data: Vec<_> = s.split('\n').collect(); data.pop(); Ok(data @@ -61,13 +121,14 @@ fn read_plugin_output(mut pipe: Pipe) -> Result> { .collect()) } -fn inner_create_controller(pipe: Pipe, path: &str) -> Result { +fn inner_create_controller(pipe: Box, path: &str) -> Result { let path = current_dir()?.parent().unwrap().join(path); tracing::info!(path = ?path); - let mut store = Store::default(); - let env = create_wasi_env(pipe, &mut store)?; + let engine = Engine::default(); + let data = WasiCtxBuilder::new().stdout(pipe).build(); + let store = Store::new(&engine, data); let bytes = std::fs::read(path)?; - let plugin = ModelIOPlugin::new(&bytes, env, store)?; + let plugin = ModelIOPlugin::new(&engine, &bytes, store)?; Ok(ModelIOPluginController::new(vec![plugin])) } @@ -78,16 +139,9 @@ fn from_path() -> Result<()> { .parent() .unwrap() .join(format!("target/wasm32-wasi/{ty}/deps")); - let (_stdout_reader, stdout_writer) = Pipe::channel(); - let mut controller = ModelIOPluginController::from_path(&path, |builder| { - builder.set_stdout(Box::new(stdout_writer.clone())); - })?; + let mut controller = ModelIOPluginController::from_path(&path, |builder| builder)?; let mut names = vec![]; for plugin in controller.all_plugins_mut() { - /* let stdout = Box::new(Pipe::new()); - let state = Arc::clone(&plugin.wasi_env().state); - let inodes = state.inodes.read().unwrap(); - state.fs.swap_file(&inodes, __WASI_STDOUT_FILENO, stdout)?; */ plugin.create()?; names.push(plugin.name()?); } diff --git a/rust/plugin_wasm/src/motion/core.rs b/rust/plugin_wasm/src/motion/core.rs index ed74e786..f1a66a45 100644 --- a/rust/plugin_wasm/src/motion/core.rs +++ b/rust/plugin_wasm/src/motion/core.rs @@ -30,7 +30,8 @@ impl Drop for nanoem_application_plugin_motion_io_t { impl nanoem_application_plugin_motion_io_t { pub fn new(path: &CStr) -> Result { let path = Path::new(path.to_str()?); - let mut controller = MotionIOPluginController::from_path(path, |_| ())?; + let mut controller = + MotionIOPluginController::from_path(path, |builder| builder.inherit_stdio())?; controller.initialize()?; Ok(Self { controller }) } @@ -65,7 +66,7 @@ impl nanoem_application_plugin_motion_io_t { } pub fn function_name(&self, value: i32) -> *const i8 { if let Ok(name) = self.controller.function_name(value) { - name.as_ptr() as *const i8 + name.as_ptr() } else { null() } diff --git a/rust/plugin_wasm/src/motion/plugin.rs b/rust/plugin_wasm/src/motion/plugin.rs index f543041d..3da4812d 100644 --- a/rust/plugin_wasm/src/motion/plugin.rs +++ b/rust/plugin_wasm/src/motion/plugin.rs @@ -4,13 +4,13 @@ This file is part of emapp component and it's licensed under Mozilla Public License. see LICENSE.md for more details. */ -use std::{ffi::CString, mem::size_of, path::Path, slice}; +use std::{ffi::CString, path::Path, slice}; use anyhow::Result; use tracing::warn; use walkdir::WalkDir; -use wasmer::{Instance, Module, Store}; -use wasmer_wasix::{wasmer_wasix_types::wasi::Errno, WasiEnv, WasiEnvBuilder, WasiFunctionEnv}; +use wasmtime::{AsContextMut, Engine, Instance, Linker, Module}; +use wasmtime_wasi::WasiCtxBuilder; use crate::{ allocate_byte_array_with_data, allocate_status_ptr, inner_count_all_functions, @@ -18,13 +18,12 @@ use crate::{ inner_get_function_name, inner_get_string, inner_initialize_function, inner_load_ui_window, inner_set_data, inner_set_function, inner_set_language, inner_set_ui_component_layout, inner_terminate_function, release_byte_array, release_status_ptr, ByteArray, OpaquePtr, - SizePtr, StatusPtr, FREE_FN, MALLOC_FN, + SizePtr, StatusPtr, Store, FREE_FN, MALLOC_FN, }; pub struct MotionIOPlugin { instance: Instance, store: Store, - env: WasiFunctionEnv, opaque: Option, } @@ -34,103 +33,107 @@ fn inner_set_named_data( name: &str, data: &[u32], func: &str, - store: &mut Store, + mut store: impl AsContextMut, ) -> Result<()> { if let Some(opaque) = opaque { - if let Ok(set_input_model_data) = - instance - .exports - .get_typed_function::<(OpaquePtr, ByteArray, ByteArray, u32, StatusPtr), ()>( - store, func, - ) + if let Ok(set_input_model_data) = instance + .get_typed_func::<(OpaquePtr, ByteArray, ByteArray, u32, StatusPtr), ()>( + store.as_context_mut(), + func, + ) { - let component_size = size_of::(); let data_size = data.len(); - let len = data_size * component_size; + let len = std::mem::size_of_val(data); let data = unsafe { slice::from_raw_parts(data.as_ptr() as *const u8, len) }; let mut name = name.as_bytes().to_vec(); name.push(0); - let name_ptr = allocate_byte_array_with_data(instance, name.as_slice(), store)?; - let data_ptr = allocate_byte_array_with_data(instance, data, store)?; - let status_ptr = allocate_status_ptr(instance, store)?; + let name_ptr = + allocate_byte_array_with_data(instance, name.as_slice(), store.as_context_mut())?; + let data_ptr = allocate_byte_array_with_data(instance, data, store.as_context_mut())?; + let status_ptr = allocate_status_ptr(instance, store.as_context_mut())?; set_input_model_data.call( - store, - *opaque, - name_ptr, - data_ptr, - data_size as u32, - status_ptr, + store.as_context_mut(), + (*opaque, name_ptr, data_ptr, data_size as u32, status_ptr), )?; - release_byte_array(instance, name_ptr, store)?; - release_byte_array(instance, data_ptr, store)?; - release_status_ptr(instance, status_ptr, store)?; + release_byte_array(instance, name_ptr, store.as_context_mut())?; + release_byte_array(instance, data_ptr, store.as_context_mut())?; + release_status_ptr(instance, status_ptr, store.as_context_mut())?; } } Ok(()) } -fn validate_plugin(instance: &Instance, store: &Store) -> Result<()> { - let e = &instance.exports; - e.get_memory("memory")?; - e.get_typed_function::(store, MALLOC_FN)?; - e.get_typed_function::(store, FREE_FN)?; - e.get_typed_function::<(), OpaquePtr>(store, "nanoemApplicationPluginMotionIOCreate")?; - e.get_typed_function::(store, "nanoemApplicationPluginMotionIOGetName")?; - e.get_typed_function::( - store, +fn validate_plugin(instance: &Instance, mut store: impl AsContextMut) -> Result<()> { + instance + .get_memory(store.as_context_mut(), "memory") + .unwrap(); + instance.get_typed_func::(store.as_context_mut(), MALLOC_FN)?; + instance.get_typed_func::(store.as_context_mut(), FREE_FN)?; + instance.get_typed_func::<(), OpaquePtr>( + store.as_context_mut(), + "nanoemApplicationPluginMotionIOCreate", + )?; + instance.get_typed_func::( + store.as_context_mut(), + "nanoemApplicationPluginMotionIOGetName", + )?; + instance.get_typed_func::( + store.as_context_mut(), "nanoemApplicationPluginMotionIOGetVersion", )?; - e.get_typed_function::<(OpaquePtr, i32), ()>( - store, + instance.get_typed_func::<(OpaquePtr, i32), ()>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOSetLanguage", )?; - e.get_typed_function::( - store, + instance.get_typed_func::( + store.as_context_mut(), "nanoemApplicationPluginMotionIOCountAllFunctions", )?; - e.get_typed_function::<(OpaquePtr, i32), ByteArray>( - store, + instance.get_typed_func::<(OpaquePtr, i32), ByteArray>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOGetFunctionName", )?; - e.get_typed_function::<(OpaquePtr, i32, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, i32, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOSetFunction", )?; - e.get_typed_function::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOSetInputMotionData", )?; - e.get_typed_function::<(OpaquePtr, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOExecute", )?; - e.get_typed_function::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, ByteArray, u32, StatusPtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOGetOutputMotionData", )?; - e.get_typed_function::<(OpaquePtr, SizePtr), ()>( - store, + instance.get_typed_func::<(OpaquePtr, SizePtr), ()>( + store.as_context_mut(), "nanoemApplicationPluginMotionIOGetOutputMotionDataSize", )?; - e.get_typed_function::( - store, + instance.get_typed_func::( + store.as_context_mut(), "nanoemApplicationPluginMotionIOGetFailureReason", )?; - e.get_typed_function::(store, "nanoemApplicationPluginMotionIODestroy")?; + instance.get_typed_func::( + store.as_context_mut(), + "nanoemApplicationPluginMotionIODestroy", + )?; Ok(()) } impl MotionIOPlugin { - pub fn new(bytes: &[u8], mut env: WasiFunctionEnv, mut store: Store) -> Result { - let module = Module::new(&store, bytes)?; - let imports = env.import_object(&mut store, &module)?; - let instance = Instance::new(&mut store, &module, &imports)?; - validate_plugin(&instance, &store)?; - env.initialize(&mut store, instance.clone())?; + pub fn new(engine: &Engine, bytes: &[u8], mut store: Store) -> Result { + let module = Module::new(engine, bytes)?; + let mut linker = Linker::new(engine); + wasmtime_wasi::add_to_linker(&mut linker, |ctx| ctx)?; + let instance = linker.instantiate(store.as_context_mut(), &module)?; + validate_plugin(&instance, store.as_context_mut())?; Ok(Self { instance, store, - env, opaque: None, }) } @@ -418,17 +421,6 @@ impl MotionIOPlugin { &mut self.store, ) } - #[allow(dead_code)] - pub(super) fn wasi_env(&mut self) -> &mut WasiEnv { - self.env.env.as_mut(&mut self.store) - } -} - -impl Drop for MotionIOPlugin { - fn drop(&mut self) { - self.env - .cleanup(&mut self.store, Some(Errno::Success.into())); - } } pub struct MotionIOPluginController { @@ -450,9 +442,9 @@ impl MotionIOPluginController { recovery_suggestion: None, } } - pub fn from_path(path: &Path, builder_callback: F) -> Result + pub fn from_path(path: &Path, cb: F) -> Result where - F: Fn(&mut WasiEnvBuilder), + F: Fn(WasiCtxBuilder) -> WasiCtxBuilder, { let mut plugins = vec![]; for entry in WalkDir::new(path.parent().unwrap()) { @@ -460,11 +452,10 @@ impl MotionIOPluginController { let filename = entry.file_name().to_str(); if filename.map(|s| s.ends_with(".wasm")).unwrap_or(false) { let bytes = std::fs::read(entry.path())?; - let mut store = Store::default(); - let mut builder = WasiEnvBuilder::new("nanoem"); - builder_callback(&mut builder); - let env = builder.finalize(&mut store)?; - match MotionIOPlugin::new(&bytes, env, store) { + let data = cb(WasiCtxBuilder::new()).build(); + let engine = Engine::default(); + let store = Store::new(&engine, data); + match MotionIOPlugin::new(&engine, &bytes, store) { Ok(plugin) => { plugins.push(plugin); tracing::debug!(filename = filename.unwrap(), "Loaded motion WASM plugin"); diff --git a/rust/plugin_wasm/src/motion/test/full.rs b/rust/plugin_wasm/src/motion/test/full.rs index 8eccc7b6..a51735f6 100644 --- a/rust/plugin_wasm/src/motion/test/full.rs +++ b/rust/plugin_wasm/src/motion/test/full.rs @@ -9,16 +9,15 @@ use assert_matches::assert_matches; use maplit::hashmap; use pretty_assertions::assert_eq; use serde_json::json; -use wasmer_wasix::Pipe; use crate::motion::{ plugin::MotionIOPluginController, - test::{create_random_data, inner_create_controller, read_plugin_output, PluginOutput}, + test::{create_random_data, inner_create_controller, read_plugin_output, Pipe, PluginOutput}, }; use super::build_type_and_flags; -fn create_controller(stdout: Pipe) -> Result { +fn create_controller(stdout: Box) -> Result { let package = "plugin_wasm_test_motion_full"; let (ty, flag) = build_type_and_flags(); inner_create_controller( stdout, &format!("target/wasm32-wasi/{ty}/{package}.wasm")) diff --git a/rust/plugin_wasm/src/motion/test/minimum.rs b/rust/plugin_wasm/src/motion/test/minimum.rs index 77bd5d21..7fabd575 100644 --- a/rust/plugin_wasm/src/motion/test/minimum.rs +++ b/rust/plugin_wasm/src/motion/test/minimum.rs @@ -9,16 +9,15 @@ use assert_matches::assert_matches; use maplit::hashmap; use pretty_assertions::assert_eq; use serde_json::json; -use wasmer_wasix::Pipe; use crate::motion::{ plugin::MotionIOPluginController, - test::{create_random_data, read_plugin_output, PluginOutput}, + test::{create_random_data, read_plugin_output, Pipe, PluginOutput}, }; use super::{build_type_and_flags, inner_create_controller}; -fn create_controller(stdout: Pipe) -> Result { +fn create_controller(stdout: Box) -> Result { let package = "plugin_wasm_test_motion_minimum"; let (ty, flag) = build_type_and_flags(); inner_create_controller(stdout, &format!("target/wasm32-wasi/{ty}/{package}.wasm")) diff --git a/rust/plugin_wasm/src/motion/test/mod.rs b/rust/plugin_wasm/src/motion/test/mod.rs index f0695feb..b8a6fc1e 100644 --- a/rust/plugin_wasm/src/motion/test/mod.rs +++ b/rust/plugin_wasm/src/motion/test/mod.rs @@ -5,9 +5,11 @@ */ use std::{ + any::Any, collections::{HashMap, HashSet}, env::current_dir, - io::Read, + io::IoSliceMut, + sync::{Arc, Mutex}, }; use anyhow::Result; @@ -15,8 +17,14 @@ use pretty_assertions::assert_eq; use rand::{thread_rng, Rng}; use serde_derive::{Deserialize, Serialize}; use serde_json::Value; -use wasmer::Store; -use wasmer_wasix::{Pipe, WasiEnvBuilder, WasiFunctionEnv}; +use wasi_common::{ + file::{FileType, Filestat}, + snapshots::preview_1::types::Error, +}; +use wasmtime::Engine; +use wasmtime_wasi::{WasiCtxBuilder, WasiFile}; + +use crate::Store; use super::plugin::{MotionIOPlugin, MotionIOPluginController}; @@ -26,6 +34,61 @@ struct PluginOutput { arguments: Option>, } +pub(super) struct Pipe { + content: Arc>>, +} + +impl Pipe { + pub fn channel() -> (Box, Box) { + let content = Arc::new(Mutex::new(Vec::new())); + ( + Box::new(Self { + content: Arc::clone(&content), + }), + Box::new(Self { + content: Arc::clone(&content), + }), + ) + } +} + +#[async_trait::async_trait] +impl WasiFile for Pipe { + fn as_any(&self) -> &dyn Any { + self + } + async fn get_filetype(&self) -> Result { + Ok(FileType::RegularFile) + } + async fn get_filestat(&self) -> Result { + Ok(Filestat { + device_id: 0, + inode: 0, + filetype: self.get_filetype().await?, + nlink: 0, + size: self.content.lock().unwrap().len() as _, + atim: None, + mtim: None, + ctim: None, + }) + } + async fn read_vectored<'a>(&self, _bufs: &mut [std::io::IoSliceMut<'a>]) -> Result { + let guard = self.content.lock().unwrap(); + for slice in _bufs.iter_mut() { + slice.copy_from_slice(guard.as_slice()); + } + Ok(guard.len() as u64) + } + async fn write_vectored<'a>(&self, _bufs: &[std::io::IoSlice<'a>]) -> Result { + let mut guard = self.content.lock().unwrap(); + let size = guard.len(); + for slice in _bufs.iter() { + guard.extend(slice.iter()); + } + Ok((guard.len() - size) as u64) + } +} + fn build_type_and_flags() -> (&'static str, &'static str) { if cfg!(debug_assertions) { ("debug", "") @@ -34,12 +97,6 @@ fn build_type_and_flags() -> (&'static str, &'static str) { } } -fn create_wasi_env(stdout: Pipe, store: &mut Store) -> Result { - Ok(WasiEnvBuilder::new("nanoem") - .stdout(Box::new(stdout)) - .finalize(store)?) -} - fn create_random_data(size: usize) -> Vec { let mut data = vec![]; let mut rng = thread_rng(); @@ -50,9 +107,12 @@ fn create_random_data(size: usize) -> Vec { data } -fn read_plugin_output(mut pipe: Pipe) -> Result> { - let mut s = String::new(); - pipe.read_to_string(&mut s)?; +fn read_plugin_output(pipe: Box) -> Result> { + let stat = futures::executor::block_on(pipe.get_filestat())?; + let mut buffer = Vec::new(); + buffer.resize(stat.size as _, 0); + futures::executor::block_on(pipe.read_vectored(&mut [IoSliceMut::new(&mut buffer)]))?; + let s = String::from_utf8(buffer)?; let mut data = s.split('\n').collect::>(); data.pop(); Ok(data @@ -61,12 +121,16 @@ fn read_plugin_output(mut pipe: Pipe) -> Result> { .collect()) } -fn inner_create_controller(stdout: Pipe, path: &str) -> Result { +fn inner_create_controller( + pipe: Box, + path: &str, +) -> Result { let path = current_dir()?.parent().unwrap().join(path); - let mut store = Store::default(); - let env = create_wasi_env(stdout, &mut store)?; + let engine = Engine::default(); + let data = WasiCtxBuilder::new().stdout(pipe).build(); + let store = Store::new(&engine, data); let bytes = std::fs::read(path)?; - let plugin = MotionIOPlugin::new(&bytes, env, store)?; + let plugin = MotionIOPlugin::new(&engine, &bytes, store)?; Ok(MotionIOPluginController::new(vec![plugin])) } @@ -77,10 +141,7 @@ fn from_path() -> Result<()> { .parent() .unwrap() .join(format!("target/wasm32-wasi/{ty}/deps")); - let (_stdout_reader, stdout_writer) = Pipe::channel(); - let mut controller = MotionIOPluginController::from_path(&path, |builder| { - builder.set_stdout(Box::new(stdout_writer.clone())) - })?; + let mut controller = MotionIOPluginController::from_path(&path, |builder| builder)?; let mut names = vec![]; for plugin in controller.all_plugins_mut() { plugin.create()?;