From c356d83e8b36ca9bf5b4544cf6e108825ad6cad6 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 14 Aug 2024 19:22:52 +0200 Subject: [PATCH] chore(rs): update wasmtime Signed-off-by: Roman Volosatovs --- Cargo.lock | 189 +++++++++++++++------------- Cargo.toml | 8 +- crates/runtime-wasmtime/Cargo.toml | 2 +- crates/runtime-wasmtime/src/lib.rs | 51 ++++---- crates/wasmtime-nats-cli/Cargo.toml | 2 +- crates/wasmtime-nats-cli/src/lib.rs | 4 +- 6 files changed, 141 insertions(+), 115 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f123aac..04771a7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -468,21 +468,32 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6b33d7e757a887989eb18b35712b2a67d96171ec3149d1bfb657b29b7b367c" +checksum = "305d51c180ebdc46ef61bc60c54ae6512db3bc9a05842a1f1e762e45977019ab" dependencies = [ "cranelift-entity", ] +[[package]] +name = "cranelift-bitset" +version = "0.110.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3247afacd9b13d620033f3190d9e49d1beefc1acb33d5604a249956c9c13709" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "cranelift-codegen" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9acf15cb22be42d07c3b57d7856329cb228b7315d385346149df2566ad5e4aa" +checksum = "bd7ca95e831c18d1356da783765c344207cbdffea91e13e47fa9327dbb2e0719" dependencies = [ "bumpalo", "cranelift-bforest", + "cranelift-bitset", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-control", @@ -499,43 +510,44 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e934d301392b73b3f8b0540391fb82465a0f179a3cee7c726482ac4727efcc97" +checksum = "450c105fa1e51bfba4e95a86e926504a867ad5639d63f31d43fe3b7ec1f1c9ef" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb2a2566b3d54b854dfb288b3b187f6d3d17d6f762c92898207eba302931da" +checksum = "5479117cd1266881479908d383086561cee37e49affbea9b1e6b594cc21cc220" [[package]] name = "cranelift-control" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0100f33b704cdacd01ad66ff41f8c5030d57cbff078e2a4e49ab1822591299fa" +checksum = "34378804f0abfdd22c068a741cfeed86938b92375b2a96fb0b42c878e0141bfb" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8cfdc315e5d18997093e040a8d234bea1ac1e118a716d3e30f40d449e78207b" +checksum = "a48cb0a194c9ba82fec35a1e492055388d89b2e3c03dee9dcf2488892be8004d" dependencies = [ + "cranelift-bitset", "serde", "serde_derive", ] [[package]] name = "cranelift-frontend" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f74b84f16af2e982b0c0c72233503d9d55cbfe3865dbe807ca28dc6642a28b5" +checksum = "8327afc6c1c05f4be62fefce5b439fa83521c65363a322e86ea32c85e7ceaf64" dependencies = [ "cranelift-codegen", "log", @@ -545,15 +557,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf306d3dde705fb94bd48082f01d38c4ededc74293a4c007805f610bf08bc6e" +checksum = "56b08621c00321efcfa3eee6a3179adc009e21ea8d24ca7adc3c326184bc3f48" [[package]] name = "cranelift-native" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea0ebdef7aff4a79bcbc8b6495f31315f16b3bf311152f472eaa8d679352581" +checksum = "d51180b147c8557c1196c77b098f04140c91962e135ea152cd2fcabf40cf365c" dependencies = [ "cranelift-codegen", "libc", @@ -562,9 +574,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.109.0" +version = "0.110.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d549108a1942065cdbac3bb96c2952afa0e1b9a3beff4b08c4308ac72257576d" +checksum = "019e3dccb7f15e0bc14f0ddc034ec608a66df8e05c9e1e16f75a7716f8461799" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -572,7 +584,7 @@ dependencies = [ "itertools", "log", "smallvec", - "wasmparser 0.209.1", + "wasmparser 0.212.0", "wasmtime-types", ] @@ -1351,15 +1363,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "mime" version = "0.3.17" @@ -2008,6 +2011,9 @@ name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde", +] [[package]] name = "send-future" @@ -2317,6 +2323,15 @@ version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "test-helpers" version = "0.0.0" @@ -2847,9 +2862,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-encoder" -version = "0.209.1" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4a05336882dae732ce6bd48b7e11fe597293cb72c13da4f35d7d5f8d53b2a7" +checksum = "501940df4418b8929eb6d52f1aade1fdd15a5b86c92453cb696e3c906bd3fc33" dependencies = [ "leb128", ] @@ -2895,9 +2910,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.209.1" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07035cc9a9b41e62d3bb3a3815a66ab87c993c06fe1cf6b2a3f2a18499d937db" +checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ "ahash", "bitflags 2.6.0", @@ -2922,23 +2937,25 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.209.1" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceca8ae6eaa8c7c87b33c25c53bdf299f8c2a764aee1179402ff7652ef3a6859" +checksum = "dfac65326cc561112af88c3028f6dfdb140acff67ede33a8e86be2dc6b8956f7" dependencies = [ "anyhow", - "wasmparser 0.209.1", + "termcolor", + "wasmparser 0.212.0", ] [[package]] name = "wasmtime" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786d8b5e7a4d54917c5ebe555b9667337e5f93383f49bddaaeec2eba68093b45" +checksum = "07232e0b473af36112da7348f51e73fa8b11047a6cb546096da3812930b7c93a" dependencies = [ "addr2line 0.21.0", "anyhow", "async-trait", + "bitflags 2.6.0", "bumpalo", "cc", "cfg-if", @@ -2951,7 +2968,6 @@ dependencies = [ "log", "mach2", "memfd", - "memoffset", "object", "once_cell", "paste", @@ -2965,8 +2981,8 @@ dependencies = [ "smallvec", "sptr", "target-lexicon", - "wasm-encoder 0.209.1", - "wasmparser 0.209.1", + "wasm-encoder 0.212.0", + "wasmparser 0.212.0", "wasmtime-asm-macros", "wasmtime-cache", "wasmtime-component-macro", @@ -2984,18 +3000,18 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d697d99c341d4a9ffb72f3af7a02124d233eeb59aee010f36d88e97cca553d5e" +checksum = "e5a9c42562d879c749288d9a26acc0d95d2ca069e30c2ec2efce84461c4d62b3" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916610f9ae9a6c22deb25bba2e6247ba9f00b093d30620875203b91328a1adfa" +checksum = "38d5d5aac98c8ae87cf5244495da7722e3fa022aa6f3f4fcd5e3d6e5699ce422" dependencies = [ "anyhow", "base64 0.21.7", @@ -3013,9 +3029,9 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b29b462b068e73b5b27fae092a27f47e5937cabf6b26be2779c978698a52feca" +checksum = "c0c3f57c4bc96f9b4a6ff4d6cb6e837913eff32e98d09e2b6d79b5c4647b415b" dependencies = [ "anyhow", "proc-macro2", @@ -3023,20 +3039,20 @@ dependencies = [ "syn", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.209.1", + "wit-parser 0.212.0", ] [[package]] name = "wasmtime-component-util" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d2912c53d9054984b380dfbd7579f9c3681b2a73b903a56bd71a1c4f175f1e" +checksum = "1da707969bc31a565da9b32d087eb2370c95c6f2087c5539a15f2e3b27e77203" [[package]] name = "wasmtime-cranelift" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3975deafea000457ba84355c7c0fce0372937204f77026510b7b454f28a3a65" +checksum = "62cb6135ec46994299be711b78b03acaa9480de3715f827d450f0c947a84977c" dependencies = [ "anyhow", "cfg-if", @@ -3051,19 +3067,20 @@ dependencies = [ "object", "target-lexicon", "thiserror", - "wasmparser 0.209.1", + "wasmparser 0.212.0", "wasmtime-environ", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444e900e848b884d8a8a2949b6f5b92af642a3e663ff8fbe78731143a55be61" +checksum = "9bcaa3b42a0718e9123da7fb75e8e13fc95df7db2a7e32e2f2f4f0d3333b7d6f" dependencies = [ "anyhow", "cpp_demangle", + "cranelift-bitset", "cranelift-entity", "gimli 0.28.1", "indexmap", @@ -3071,11 +3088,12 @@ dependencies = [ "object", "postcard", "rustc-demangle", + "semver", "serde", "serde_derive", "target-lexicon", - "wasm-encoder 0.209.1", - "wasmparser 0.209.1", + "wasm-encoder 0.212.0", + "wasmparser 0.212.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -3083,9 +3101,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ded58eb2d1bf0dcd2182d0ccd7055c4b10b50d711514f1d73f61515d0fa829d" +checksum = "baf1c805515f4bc157f70f998038951009d21a19c1ef8c5fbb374a11b1d56672" dependencies = [ "anyhow", "cc", @@ -3098,9 +3116,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afe2f0499542f9a4bcfa1b55bfdda803b6ade4e7c93c6b99e0f39dba44b0a91" +checksum = "2cfee42dac5148fc2664ab1f5cb8d7fa77a28d1a2cf1d9483abc2c3d751a58b9" dependencies = [ "anyhow", "cfg-if", @@ -3110,28 +3128,29 @@ dependencies = [ [[package]] name = "wasmtime-slab" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7de1f2bec5bbb35d532e61c85c049dc84ae671df60492f90b954ecf21169e7" +checksum = "42eb8f6515708ec67974998c3e644101db4186308985f5ef7c2ef324ff33c948" [[package]] name = "wasmtime-types" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412463e9000e14cf6856be48628d2213c20c153e29ffc22b036980c892ea6964" +checksum = "046873fb8fb3e9652f3fd76fe99c8c8129007695c3d73b2e307fdae40f6e324c" dependencies = [ + "anyhow", "cranelift-entity", "serde", "serde_derive", "smallvec", - "wasmparser 0.209.1", + "wasmparser 0.212.0", ] [[package]] name = "wasmtime-versioned-export-macros" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" +checksum = "99c02af2e9dbeb427304d1a08787d70ed0dbfec1af2236616f84c9f1f03e7969" dependencies = [ "proc-macro2", "quote", @@ -3140,9 +3159,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8abb1301089ed8e0b4840f539cba316a73ac382090f1b25d22d8c8eed8df49c7" +checksum = "b2a1349f254d0b8f2ec8f996d0982f040abf22cd6ab19e3cf67afd033c552208" dependencies = [ "anyhow", "async-trait", @@ -3170,16 +3189,16 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4db238a0241df2d15f79ad17b3a37a27f2ea6cb885894d81b42ae107544466" +checksum = "b2ceddc47a49af10908a288fdfdc296ab3932062cab62a785e3705bbb3709c59" dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.28.1", "object", "target-lexicon", - "wasmparser 0.209.1", + "wasmparser 0.212.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -3187,14 +3206,14 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "22.0.0" +version = "23.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc077306b38288262e5ba01d4b21532a6987416cdc0aedf04bb06c22a68fdc" +checksum = "75f528f8b8a2376a3dacaf497d960216dd466d324425361e1e00e26de0a7705c" dependencies = [ "anyhow", "heck 0.4.1", "indexmap", - "wit-parser 0.209.1", + "wit-parser 0.212.0", ] [[package]] @@ -3271,9 +3290,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.20.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6915884e731b2db0d8cf08cb64474cb69221a161675fd3c135f91febc3daa" +checksum = "2a41b67a37ea74e83c38ef495cc213aba73385236b1deee883dc869e835003b9" dependencies = [ "anyhow", "cranelift-codegen", @@ -3281,7 +3300,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.209.1", + "wasmparser 0.212.0", "wasmtime-cranelift", "wasmtime-environ", ] @@ -3602,9 +3621,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.209.1" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e79b9e3c0b6bb589dec46317e645851e0db2734c44e2be5e251b03ff4a51269" +checksum = "ceeb0424aa8679f3fcf2d6e3cfa381f3d6fa6179976a2c05a6249dd2bb426716" dependencies = [ "anyhow", "id-arena", @@ -3615,7 +3634,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.209.1", + "wasmparser 0.212.0", ] [[package]] @@ -3684,7 +3703,7 @@ dependencies = [ [[package]] name = "wrpc-runtime-wasmtime" -version = "0.19.4" +version = "0.20.0" dependencies = [ "anyhow", "bytes", @@ -3754,7 +3773,7 @@ dependencies = [ [[package]] name = "wrpc-wasmtime-nats-cli" -version = "0.4.0" +version = "0.5.0" dependencies = [ "anyhow", "async-nats-wrpc", diff --git a/Cargo.toml b/Cargo.toml index 14a0c1d1..6dd80cac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -126,8 +126,8 @@ uuid = { version = "1", default-features = false } wasi-preview1-component-adapter-provider = { version = "23.0.2", default-features = false } wasm-tokio = { version = "0.5.16", default-features = false } wasmparser = { version = "0.214", default-features = false } -wasmtime = { version = "22", default-features = false } -wasmtime-wasi = { version = "22", default-features = false } +wasmtime = { version = "23", default-features = false } +wasmtime-wasi = { version = "23", default-features = false } wit-bindgen = { version = "0.28", default-features = false } wit-bindgen-core = { version = "0.28", default-features = false } wit-bindgen-wrpc = { version = "0.5", default-features = false, path = "./crates/wit-bindgen" } @@ -138,8 +138,8 @@ wit-component = { version = "0.214", default-features = false } wit-parser = { version = "0.214", default-features = false } wrpc-cli = { version = "0.2.1", path = "./crates/cli", default-features = false } wrpc-introspect = { version = "0.2", default-features = false, path = "./crates/introspect" } -wrpc-runtime-wasmtime = { version = "0.19.4", path = "./crates/runtime-wasmtime", default-features = false } +wrpc-runtime-wasmtime = { version = "0.20", path = "./crates/runtime-wasmtime", default-features = false } wrpc-transport = { version = "0.26.7", path = "./crates/transport", default-features = false } wrpc-transport-nats = { version = "0.22.3", path = "./crates/transport-nats", default-features = false } wrpc-transport-quic = { version = "0.1.1", path = "./crates/transport-quic", default-features = false } -wrpc-wasmtime-nats-cli = { version = "0.4.0", path = "./crates/wasmtime-nats-cli", default-features = false } +wrpc-wasmtime-nats-cli = { version = "0.5", path = "./crates/wasmtime-nats-cli", default-features = false } diff --git a/crates/runtime-wasmtime/Cargo.toml b/crates/runtime-wasmtime/Cargo.toml index e250cf95..bbcaab87 100644 --- a/crates/runtime-wasmtime/Cargo.toml +++ b/crates/runtime-wasmtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wrpc-runtime-wasmtime" -version = "0.19.4" +version = "0.20.0" description = "wRPC wasmtime integration" authors.workspace = true diff --git a/crates/runtime-wasmtime/src/lib.rs b/crates/runtime-wasmtime/src/lib.rs index 14de11cb..84957ec8 100644 --- a/crates/runtime-wasmtime/src/lib.rs +++ b/crates/runtime-wasmtime/src/lib.rs @@ -1262,14 +1262,25 @@ pub trait ServeExt: wrpc_transport::Serve { let span = Span::current(); async move { debug!(instance = instance_name, name, "serving function export"); + let component_ty = instance_pre.component(); + let idx = if instance_name.is_empty() { + None + } else { + let (_, idx) = component_ty + .export_index(None, instance_name) + .with_context(|| format!("export `{instance_name}` not found"))?; + Some(idx) + }; + let (_, idx) = component_ty + .export_index(idx.as_ref(), name) + .with_context(|| format!("export `{name}` not found"))?; + // TODO: set paths let invocations = self.serve(instance_name, rpc_func_name(name), []).await?; - let instance_name = Arc::::from(instance_name); let name = Arc::::from(name); let params_ty: Arc<[_]> = ty.params().collect(); let results_ty: Arc<[_]> = ty.results().collect(); Ok(invocations.map_ok(move |(cx, tx, rx)| { - let instance_name = Arc::clone(&instance_name); let instance_pre = instance_pre.clone(); let name = Arc::clone(&name); let params_ty = Arc::clone(¶ms_ty); @@ -1284,18 +1295,9 @@ pub trait ServeExt: wrpc_transport::Serve { .instantiate_async(&mut store) .await .context("failed to instantiate component")?; - let func = { - let mut exports = instance.exports(&mut store); - if instance_name.is_empty() { - exports.root() - } else { - exports.instance(&instance_name).with_context(|| { - format!("instance export `{instance_name}` not found") - })? - } - .func(&name) - } - .with_context(|| format!("function export`{name}` not found"))?; + let func = instance + .get_func(&mut store, idx) + .with_context(|| format!("function export `{name}` not found"))?; call( &mut store, rx, @@ -1344,17 +1346,20 @@ pub trait ServeExt: wrpc_transport::Serve { async move { let func = { let mut store = store.lock().await; - let mut exports = instance.exports(&mut *store); - if instance_name.is_empty() { - exports.root() + let idx = if instance_name.is_empty() { + None } else { - exports - .instance(instance_name) - .with_context(|| format!("instance export `{instance_name}` not found"))? - } - .func(name) + let idx = instance + .get_export(store.as_context_mut(), None, instance_name) + .with_context(|| format!("export `{instance_name}` not found"))?; + Some(idx) + }; + let idx = instance + .get_export(store.as_context_mut(), idx.as_ref(), name) + .with_context(|| format!("export `{name}` not found"))?; + instance.get_func(store.as_context_mut(), idx) } - .with_context(|| format!("function export`{name}` not found"))?; + .with_context(|| format!("function export `{name}` not found"))?; debug!(instance = instance_name, name, "serving function export"); // TODO: set paths let invocations = self.serve(instance_name, rpc_func_name(name), []).await?; diff --git a/crates/wasmtime-nats-cli/Cargo.toml b/crates/wasmtime-nats-cli/Cargo.toml index 0c05f69f..b16286b9 100644 --- a/crates/wasmtime-nats-cli/Cargo.toml +++ b/crates/wasmtime-nats-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wrpc-wasmtime-nats-cli" -version = "0.4.0" +version = "0.5.0" description = "wRPC Wasmtime NATS CLI" authors.workspace = true diff --git a/crates/wasmtime-nats-cli/src/lib.rs b/crates/wasmtime-nats-cli/src/lib.rs index 8252cb4d..0f9f435e 100644 --- a/crates/wasmtime-nats-cli/src/lib.rs +++ b/crates/wasmtime-nats-cli/src/lib.rs @@ -279,7 +279,9 @@ pub async fn handle_run( "command.wasm", *timeout, ); - let (cmd, _) = wasmtime_wasi::bindings::Command::instantiate_pre(&mut store, &pre) + let cmd = wasmtime_wasi::bindings::CommandPre::new(pre) + .context("failed to construct `command` instance")? + .instantiate_async(&mut store) .await .context("failed to instantiate `command`")?; cmd.wasi_cli_run()