diff --git a/Cargo.lock b/Cargo.lock index 5a6f57d326..50419e08d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,16 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli 0.31.1", +] + +[[package]] +name = "addr2line" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9acbfca36652500c911ddb767ed433e3ed99b032b5d935be73c6923662db1d43" +dependencies = [ + "gimli 0.32.0", ] [[package]] @@ -998,11 +1007,11 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.5", "rustc-demangle", "windows-targets 0.52.6", ] @@ -1878,36 +1887,36 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae7b60ec3fd7162427d3b3801520a1908bef7c035b52983cd3ca11b8e7deb51" +checksum = "3870e823d79cafc9c868fbea77e83fc12ec9c0e87f17ad392c71a55ec01f12a9" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6511c200fed36452697b4b6b161eae57d917a2044e6333b1c1389ed63ccadeee" +checksum = "0a9fe971fab18724cbfc9a0579dd9cb6e370891991ccc8f85f3390d81392a3c0" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7086a645aa58bae979312f64e3029ac760ac1b577f5cd2417844842a2ca07f" +checksum = "ac391df81890fc9f820461e76fb344bcebcbf72614ef99bdd03d9fb1a8cdcc5e" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5225b4dec45f3f3dbf383f12560fac5ce8d780f399893607e21406e12e77f491" +checksum = "712de3ed567438f3ca42d12547dbf30d92aef37d63ae45eabe32dd53c4ee5d00" dependencies = [ "serde", "serde_derive", @@ -1915,9 +1924,9 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "858fb3331e53492a95979378d6df5208dd1d0d315f19c052be8115f4efc888e0" +checksum = "68e6fc48d06ef89c1ad3675fe093f2642d260eea8ceb96a9ee9ae94e51698277" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -1928,7 +1937,7 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli", + "gimli 0.32.0", "hashbrown 0.15.2", "log", "pulley-interpreter", @@ -1942,36 +1951,37 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456715b9d5f12398f156d5081096e7b5d039f01b9ecc49790a011c8e43e65b5f" +checksum = "a45a98cfcd528bd06c6ef2fd1846cda3695d41bd4b2823ce965a82f4abec362f" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", "cranelift-srcgen", + "heck 0.5.0", "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0306041099499833f167a0ddb707e1e54100f1a84eab5631bc3dad249708f482" +checksum = "66b12b2fef743dffdb51a5cdb95f5f92ab263ed518a7ec73aa272a4a86ea17bf" [[package]] name = "cranelift-control" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1672945e1f9afc2297f49c92623f5eabc64398e2cb0d824f8f72a2db2df5af23" +checksum = "5dc203df5ac23968c8ded672b6c4b6dbc0639521e50b8d27ac67c2e221f3c98b" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa3cd55eb5f3825b9ae5de1530887907360a6334caccdc124c52f6d75246c98a" +checksum = "2d01c5dca220ed9c664a4c0cf2085aa0bebaddc306be365bdd2691d4a55dd2ae" dependencies = [ "cranelift-bitset", "serde", @@ -1980,9 +1990,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781f9905f8139b8de22987b66b522b416fe63eb76d823f0b3a8c02c8fd9500c7" +checksum = "ecd02bd4641b10658668bf195ef92af0ecffa49a8a563de8e98f0c2d843a229d" dependencies = [ "cranelift-codegen", "log", @@ -1992,15 +2002,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05337a2b02c3df00b4dd9a263a027a07b3dff49f61f7da3b5d195c21eaa633d" +checksum = "51da2281ea3db0b1f6029b4321acf541ef856baafdf16e990d64953c9737bc3f" [[package]] name = "cranelift-native" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eee7a496dd66380082c9c5b6f2d5fa149cec0ec383feec5caf079ca2b3671c2" +checksum = "ff037ce35e9d513dcf64e9f613ec4816cb7b0b1b0b4e23788745f2200d278fec" dependencies = [ "cranelift-codegen", "libc", @@ -2009,9 +2019,9 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b530783809a55cb68d070e0de60cfbb3db0dc94c8850dd5725411422bedcf6bb" +checksum = "d13dc01a8588b7f7733de0c31b766d85cac04aec078897cde706cebd891f8212" [[package]] name = "crc32fast" @@ -3493,6 +3503,12 @@ name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "gimli" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93563d740bc9ef04104f9ed6f86f1e3275c2cdafb95664e26584b9ca807a8ffe" dependencies = [ "fallible-iterator 0.3.0", "indexmap 2.7.1", @@ -5018,9 +5034,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" dependencies = [ "value-bag", ] @@ -5697,6 +5713,15 @@ name = "object" version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "crc32fast", "hashbrown 0.15.2", @@ -6687,9 +6712,9 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89c4319786b16c1a6a38ee04788d32c669b61ba4b69da2162c868c18be99c1b" +checksum = "9c53c41637e4052ec0010b923a3ffc99a124f2b6f19062147eae6458904d3e46" dependencies = [ "cranelift-bitset", "log", @@ -6699,9 +6724,9 @@ dependencies = [ [[package]] name = "pulley-macros" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938543690519c20c3a480d20a8efcc8e69abeb44093ab1df4e7c1f81f26c677a" +checksum = "aed513b785fd6b142c6708c29990d92475971df8370b018c2c236dfd1c47b77d" dependencies = [ "proc-macro2", "quote", @@ -8324,14 +8349,14 @@ dependencies = [ "tokio", "toml", "tracing", - "wasm-encoder 0.235.0", - "wasm-metadata 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasm-metadata 0.236.1", + "wasmparser 0.236.1", "wasmtime", "wasmtime-wasi", "wat", - "wit-component 0.235.0", - "wit-parser 0.235.0", + "wit-component 0.236.1", + "wit-parser 0.236.1", ] [[package]] @@ -8418,10 +8443,10 @@ dependencies = [ "wac-graph", "wac-types", "wasm-pkg-client", - "wasmparser 0.235.0", - "wit-component 0.235.0", + "wasmparser 0.236.1", + "wit-component 0.236.1", "wit-encoder", - "wit-parser 0.235.0", + "wit-parser 0.236.1", ] [[package]] @@ -8914,11 +8939,11 @@ dependencies = [ "tokio-util", "tracing", "walkdir", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", "wat", - "wit-component 0.235.0", - "wit-parser 0.235.0", + "wit-component 0.236.1", + "wit-parser 0.236.1", ] [[package]] @@ -9623,7 +9648,7 @@ name = "test-components" version = "0.1.0" dependencies = [ "cargo_toml", - "wit-component 0.235.0", + "wit-component 0.236.1", ] [[package]] @@ -10177,17 +10202,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trait-variant" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -10840,6 +10854,16 @@ dependencies = [ "wasmparser 0.235.0", ] +[[package]] +name = "wasm-encoder" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" +dependencies = [ + "leb128fmt", + "wasmparser 0.236.1", +] + [[package]] name = "wasm-metadata" version = "0.224.1" @@ -10876,6 +10900,25 @@ dependencies = [ "wasmparser 0.235.0", ] +[[package]] +name = "wasm-metadata" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c909f94a49a8de3365f3c0344f064818f1e369ff1740c5b04f455f85d454768e" +dependencies = [ + "anyhow", + "auditable-serde", + "flate2", + "indexmap 2.7.1", + "serde", + "serde_derive", + "serde_json", + "spdx", + "url", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", +] + [[package]] name = "wasm-pkg-client" version = "0.11.0" @@ -10980,6 +11023,19 @@ dependencies = [ "serde", ] +[[package]] +name = "wasmparser" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" +dependencies = [ + "bitflags 2.6.0", + "hashbrown 0.15.2", + "indexmap 2.7.1", + "semver", + "serde", +] + [[package]] name = "wasmprinter" version = "0.2.80" @@ -10992,22 +11048,22 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75aa8e9076de6b9544e6dab4badada518cca0bf4966d35b131bbd057aed8fa0a" +checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.235.0", + "wasmparser 0.236.1", ] [[package]] name = "wasmtime" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe976922a16af3b0d67172c473d1fd4f1aa5d0af9c8ba6538c741f3af686f4" +checksum = "72eb410993c268be048b7745a49649e3390348b0fe9ee050253a74a79192574f" dependencies = [ - "addr2line", + "addr2line 0.25.0", "anyhow", "async-trait", "bitflags 2.6.0", @@ -11016,7 +11072,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "gimli", + "gimli 0.32.0", "hashbrown 0.15.2", "indexmap 2.7.1", "ittapi", @@ -11024,7 +11080,7 @@ dependencies = [ "log", "mach2", "memfd", - "object", + "object 0.37.3", "once_cell", "postcard", "pulley-interpreter", @@ -11036,9 +11092,8 @@ dependencies = [ "serde_json", "smallvec", "target-lexicon", - "trait-variant", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-asm-macros", "wasmtime-internal-cache", @@ -11054,23 +11109,23 @@ dependencies = [ "wasmtime-internal-versioned-export-macros", "wasmtime-internal-winch", "wat", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-environ" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b6264a78d806924abbc76bbc75eac24976bc83bdfb938e5074ae551242436f" +checksum = "88d3047dfcd4c0eeb2dbd9d639dd4eef65cbe53f17211c549543f208466246ed" dependencies = [ "anyhow", "cpp_demangle", "cranelift-bitset", "cranelift-entity", - "gimli", + "gimli 0.32.0", "indexmap 2.7.1", "log", - "object", + "object 0.37.3", "postcard", "rustc-demangle", "semver", @@ -11078,26 +11133,26 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", - "wasmprinter 0.235.0", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", + "wasmprinter 0.236.1", "wasmtime-internal-component-util", ] [[package]] name = "wasmtime-internal-asm-macros" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6775a9b516559716e5710e95a8014ca0adcc81e5bf4d3ad7899d89ae40094d1a" +checksum = "82c3ac22f7209c35a913b4423a9f83fc12b74239af3cb5ac6c39a5df34e1970b" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-internal-cache" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e33ad4bd120f3b1c77d6d0dcdce0de8239555495befcda89393a40ba5e324" +checksum = "dbd49572a149c84a28079a0fb06f2c67c6290e75405f71855e943e4bb4703ae0" dependencies = [ "anyhow", "base64 0.22.1", @@ -11109,15 +11164,15 @@ dependencies = [ "serde_derive", "sha2", "toml", - "windows-sys 0.59.0", + "windows-sys 0.60.2", "zstd", ] [[package]] name = "wasmtime-internal-component-macro" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc3d098205e405e6b5ced06c1815621b823464b6ea289eaafe494139b0aee287" +checksum = "0badcd2acaa2901910a2ec0815abd24b80ffeecb5683029082e26220be2b44c5" dependencies = [ "anyhow", "proc-macro2", @@ -11125,20 +11180,20 @@ dependencies = [ "syn 2.0.87", "wasmtime-internal-component-util", "wasmtime-internal-wit-bindgen", - "wit-parser 0.235.0", + "wit-parser 0.236.1", ] [[package]] name = "wasmtime-internal-component-util" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219252067216242ed2b32665611b0ee356d6e92cbb897ecb9a10cae0b97bdeca" +checksum = "399a9f4d25c0dcf4829751cbb63de438f3b715abc49277c15c86460539f4a7e7" [[package]] name = "wasmtime-internal-cranelift" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec9ad7565e6a8de7cb95484e230ff689db74a4a085219e0da0cbd637a29c01c" +checksum = "41370ede67231853b2f96a7f03b8e3db61802ad3ee0d7497b366f815e616f4fc" dependencies = [ "anyhow", "cfg-if", @@ -11147,15 +11202,15 @@ dependencies = [ "cranelift-entity", "cranelift-frontend", "cranelift-native", - "gimli", + "gimli 0.32.0", "itertools 0.14.0", "log", - "object", + "object 0.37.3", "pulley-interpreter", "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.235.0", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-math", "wasmtime-internal-versioned-export-macros", @@ -11163,9 +11218,9 @@ dependencies = [ [[package]] name = "wasmtime-internal-fiber" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b636ff8b220ebaf29dfe3b23770e4b2bad317b9683e3bf7345e162387385b39" +checksum = "6baf30fe62eb18fdc83395011ebd32dd74af3e86cecffb74dec05d8af2243515" dependencies = [ "anyhow", "cc", @@ -11174,66 +11229,66 @@ dependencies = [ "rustix 1.0.5", "wasmtime-internal-asm-macros", "wasmtime-internal-versioned-export-macros", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-internal-jit-debug" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61d8693995ab3df48e88777b6ee3b2f441f2c4f895ab938996cdac3db26f256c" +checksum = "416e2d2193073fe65355315bd144a9a26cbdf1f0c27faa7fdd3266a09b2689d3" dependencies = [ "cc", - "object", + "object 0.37.3", "rustix 1.0.5", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4417e06b7f80baff87d9770852c757a39b8d7f11d78b2620ca992b8725f16f50" +checksum = "b787315e8acb988ce5da8439ce827f84a01b912d3b157aafe0ddd8779fef219e" dependencies = [ "anyhow", "cfg-if", "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-internal-math" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7710d5c4ecdaa772927fd11e5dc30a9a62d1fc8fe933e11ad5576ad596ab6612" +checksum = "08d8b81a4083aa76d3cd3ebf24f0564b6d17d4faffd47c42dd218798aa5894d4" dependencies = [ "libm", ] [[package]] name = "wasmtime-internal-slab" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ab22fabe1eed27ab01fd47cd89deacf43ad222ed7fd169ba6f4dd1fbddc53b" +checksum = "8e701cdea321a3c288990dcc1ed7b4c89d120e10bf50052e942243251e710c42" [[package]] name = "wasmtime-internal-unwinder" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307708f302f5dcf19c1bbbfb3d9f2cbc837dd18088a7988747b043a46ba38ecc" +checksum = "60ddcc1b024ae8e16f043b0dbea676048f3b710efbaa63f2647bc287315b8704" dependencies = [ "anyhow", "cfg-if", "cranelift-codegen", "log", - "object", + "object 0.37.3", ] [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342b0466f92b7217a4de9e114175fedee1907028567d2548bcd42f71a8b5b016" +checksum = "e4bd56c30d60d617935d1a68272223341b67c27fb3776fee025e481f3ac53cd0" dependencies = [ "proc-macro2", "quote", @@ -11242,16 +11297,16 @@ dependencies = [ [[package]] name = "wasmtime-internal-winch" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2012e7384c25b91aab2f1b6a1e1cbab9d0f199bbea06cc873597a3f047f05730" +checksum = "e9a56b31bc1c5b6a62cb400e996947944a3a0545dc8e11790964074269876137" dependencies = [ "anyhow", "cranelift-codegen", - "gimli", - "object", + "gimli 0.32.0", + "object 0.37.3", "target-lexicon", - "wasmparser 0.235.0", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-cranelift", "winch-codegen", @@ -11259,21 +11314,22 @@ dependencies = [ [[package]] name = "wasmtime-internal-wit-bindgen" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae057d44a5b60e6ec529b0c21809a9d1fc92e91ef6e0f6771ed11dd02a94a08" +checksum = "8c9816c753aaa5591c45f3ccfb9f2ecf9ea9bbffabc1ad628818803bd12e34ba" dependencies = [ "anyhow", + "bitflags 2.6.0", "heck 0.5.0", "indexmap 2.7.1", - "wit-parser 0.235.0", + "wit-parser 0.236.1", ] [[package]] name = "wasmtime-wasi" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d252bc54438b6b979320dc48fe8328429761aaef62cee12a848b0389b1f255c" +checksum = "c43f4163d631ecb72245b34aae03f5a0b07e58c2004692b4258caf8bf7aacca5" dependencies = [ "anyhow", "async-trait", @@ -11297,14 +11353,14 @@ dependencies = [ "wasmtime", "wasmtime-wasi-io", "wiggle", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-wasi-http" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de4cddef458af6d8efac0b03df4bae4446d90db007999da76b789ddb921f98" +checksum = "9a9730c0a3f24c25a8fa40fecbd4a1a3e77dff5bb730d98e16861c9dfcc2ca33" dependencies = [ "anyhow", "async-trait", @@ -11326,9 +11382,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi-io" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2664b7dabe650a102559ae49108fb00f884f319aadefcf20806ab5f2dbd535" +checksum = "a6a1700b7b7a2b9b704ed9501745798e3791f575ee6973d7d821e2386a94adbf" dependencies = [ "anyhow", "async-trait", @@ -11348,24 +11404,24 @@ dependencies = [ [[package]] name = "wast" -version = "235.0.0" +version = "236.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13" +checksum = "d3bec4b4db9c6808d394632fd4b0cd4654c32c540bd3237f55ee6a40fff6e51f" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width 0.2.0", - "wasm-encoder 0.235.0", + "wasm-encoder 0.236.1", ] [[package]] name = "wat" -version = "1.235.0" +version = "1.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa" +checksum = "64475e2f77d6071ce90624098fc236285ddafa8c3ea1fb386f2c4154b6c2bbdb" dependencies = [ - "wast 235.0.0", + "wast 236.0.1", ] [[package]] @@ -11503,9 +11559,9 @@ dependencies = [ [[package]] name = "wiggle" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3ea480ce117a35b61e466e4f77422f2b29f744400e05de3ad87d73b8a1877c" +checksum = "0047009d1851c65dfeb197ff53a1d1bf94358d56604ac5e9419397ba381bfa17" dependencies = [ "anyhow", "async-trait", @@ -11518,9 +11574,9 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec945b902cacd960fe5d441b60146b24639d81b887451a30bf86824a8185d79" +checksum = "af67f0f2a0e2e7841e9a561aff21cec8f6125b5b8d2c43adecc974e36e9cbbd9" dependencies = [ "anyhow", "heck 0.5.0", @@ -11532,9 +11588,9 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5872fbe512b73acd514e7ef5bd5aee0ff951a12c1fed0293e1f7992de30df9f" +checksum = "c6f1ed189ba5962988a017f86bc73b03cc69e1b8d3040922beab307855ce594d" dependencies = [ "proc-macro2", "quote", @@ -11575,19 +11631,19 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839a334ef7c62d8368dbd427e767a6fbb1ba08cc12ecce19cbb666c10613b585" +checksum = "88ac81262abfb835f3f46f64715863fa2737c2928fab58db74ec98710e3e261a" dependencies = [ "anyhow", "cranelift-assembler-x64", "cranelift-codegen", - "gimli", + "gimli 0.32.0", "regalloc2", "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.235.0", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-cranelift", "wasmtime-internal-math", @@ -11785,6 +11841,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -11824,13 +11889,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows-threading" version = "0.1.0" @@ -11858,6 +11940,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -11876,6 +11964,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -11894,12 +11988,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -11918,6 +12024,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -11936,6 +12048,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -11954,6 +12072,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -11972,6 +12096,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.6.20" @@ -12051,10 +12181,29 @@ dependencies = [ "wasm-encoder 0.235.0", "wasm-metadata 0.235.0", "wasmparser 0.235.0", - "wat", "wit-parser 0.235.0", ] +[[package]] +name = "wit-component" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3622959ed7ed6341c38e5aa35af243632534b0a36226852faa802939ce11e00f" +dependencies = [ + "anyhow", + "bitflags 2.6.0", + "indexmap 2.7.1", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.236.1", + "wasm-metadata 0.236.1", + "wasmparser 0.236.1", + "wat", + "wit-parser 0.236.1", +] + [[package]] name = "wit-encoder" version = "0.235.0" @@ -12104,6 +12253,24 @@ dependencies = [ "wasmparser 0.235.0", ] +[[package]] +name = "wit-parser" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.7.1", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.236.1", +] + [[package]] name = "witx" version = "0.9.1" diff --git a/Cargo.toml b/Cargo.toml index a72fa96abd..9b8da3ae90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -169,16 +169,16 @@ tower-service = "0.3.3" tracing = { version = "0.1.41", features = ["log"] } url = "2" walkdir = "2" -wasm-encoder = "0.235" -wasm-metadata = "0.235" +wasm-encoder = "0.236.1" +wasm-metadata = "0.236.1" wasm-pkg-client = "0.11" wasm-pkg-common = "0.11" -wasmparser = "0.235" -wasmtime = "35.0.0" -wasmtime-wasi = "35.0.0" -wasmtime-wasi-http = "35.0.0" -wit-component = "0.235" -wit-parser = "0.235" +wasmparser = "0.236.1" +wasmtime = "36.0.1" +wasmtime-wasi = "36.0.1" +wasmtime-wasi-http = "36.0.1" +wit-component = "0.236.1" +wit-parser = "0.236.1" spin-componentize = { path = "crates/componentize" } diff --git a/crates/componentize/src/abi_conformance/mod.rs b/crates/componentize/src/abi_conformance/mod.rs index 1ef0611784..938af8789e 100644 --- a/crates/componentize/src/abi_conformance/mod.rs +++ b/crates/componentize/src/abi_conformance/mod.rs @@ -36,8 +36,8 @@ use wasmtime::{ component::{Component, HasSelf, InstancePre, Linker}, Engine, Store, }; -use wasmtime_wasi::p2::{pipe::MemoryOutputPipe, IoView, WasiCtx, WasiCtxBuilder, WasiView}; -use wasmtime_wasi::ResourceTable; +use wasmtime_wasi::p2::pipe::MemoryOutputPipe; +use wasmtime_wasi::{ResourceTable, WasiCtx, WasiCtxBuilder, WasiCtxView, WasiView}; pub use test_key_value::KeyValueReport; pub use test_llm::LlmReport; @@ -60,8 +60,7 @@ mod test_wasi; wasmtime::component::bindgen!({ path: "../../wit", world: "fermyon:spin/host", - async: true, - trappable_imports: true, + imports: { default: async | trappable }, }); pub use fermyon::spin::*; @@ -264,15 +263,12 @@ impl Context { } } -impl IoView for Context { - fn table(&mut self) -> &mut ResourceTable { - &mut self.table - } -} - impl WasiView for Context { - fn ctx(&mut self) -> &mut WasiCtx { - &mut self.wasi + fn ctx(&mut self) -> WasiCtxView<'_> { + WasiCtxView { + ctx: &mut self.wasi, + table: &mut self.table, + } } } @@ -321,7 +317,7 @@ async fn run_command( // ownership once we return. let table = ResourceTable::new(); store.data_mut().wasi = WasiCtxBuilder::new().build(); - *store.data_mut().table() = table; + *store.data_mut().ctx().table = table; let stderr = std::mem::replace(&mut store.data_mut().stderr, MemoryOutputPipe::new(1024)); diff --git a/crates/componentize/src/lib.rs b/crates/componentize/src/lib.rs index 76ee8f7a28..fa08f9f8cf 100644 --- a/crates/componentize/src/lib.rs +++ b/crates/componentize/src/lib.rs @@ -267,10 +267,8 @@ mod tests { component::{Component, Linker}, Config, Engine, Store, }, - wasmtime_wasi::p2::{ - bindings::Command, pipe::MemoryInputPipe, IoView, WasiCtx, WasiCtxBuilder, WasiView, - }, - wasmtime_wasi::ResourceTable, + wasmtime_wasi::p2::{bindings::Command, pipe::MemoryInputPipe}, + wasmtime_wasi::{ResourceTable, WasiCtx, WasiCtxBuilder, WasiCtxView, WasiView}, }; async fn run_spin(module: &[u8]) -> Result<()> { @@ -359,14 +357,12 @@ mod tests { ctx: WasiCtx, table: ResourceTable, } - impl IoView for Wasi { - fn table(&mut self) -> &mut ResourceTable { - &mut self.table - } - } impl WasiView for Wasi { - fn ctx(&mut self) -> &mut WasiCtx { - &mut self.ctx + fn ctx(&mut self) -> WasiCtxView<'_> { + WasiCtxView { + ctx: &mut self.ctx, + table: &mut self.table, + } } } diff --git a/crates/factor-outbound-http/src/wasi.rs b/crates/factor-outbound-http/src/wasi.rs index 312382bc2f..c141be76b5 100644 --- a/crates/factor-outbound-http/src/wasi.rs +++ b/crates/factor-outbound-http/src/wasi.rs @@ -32,7 +32,6 @@ use tokio_rustls::client::TlsStream; use tower_service::Service; use tracing::{field::Empty, instrument, Instrument}; use wasmtime::component::HasData; -use wasmtime_wasi::p2::{IoImpl, IoView}; use wasmtime_wasi_http::{ bindings::http::types::ErrorCode, body::HyperOutgoingBody, @@ -60,7 +59,7 @@ where C: spin_factors::InitContext, { let (state, table) = C::get_data_with_table(store); - WasiHttpImpl(IoImpl(WasiHttpImplInner { state, table })) + WasiHttpImpl(WasiHttpImplInner { state, table }) } let get_http = get_http:: as fn(&mut C::StoreData) -> WasiHttpImpl>; let linker = ctx.linker(); @@ -84,7 +83,7 @@ impl OutboundHttpFactor { runtime_instance_state: &mut impl RuntimeFactorsInstanceState, ) -> Option> { let (state, table) = runtime_instance_state.get_with_table::()?; - Some(WasiHttpImpl(IoImpl(WasiHttpImplInner { state, table }))) + Some(WasiHttpImpl(WasiHttpImplInner { state, table })) } } @@ -123,17 +122,15 @@ pub(crate) struct WasiHttpImplInner<'a> { table: &'a mut ResourceTable, } -impl IoView for WasiHttpImplInner<'_> { - fn table(&mut self) -> &mut ResourceTable { - self.table - } -} - impl WasiHttpView for WasiHttpImplInner<'_> { fn ctx(&mut self) -> &mut WasiHttpCtx { &mut self.state.wasi_http_ctx } + fn table(&mut self) -> &mut ResourceTable { + self.table + } + #[instrument( name = "spin_outbound_http.send_request", skip_all, diff --git a/crates/factor-outbound-http/src/wasi_2023_10_18.rs b/crates/factor-outbound-http/src/wasi_2023_10_18.rs index 3f51fcbb0d..642781f4e7 100644 --- a/crates/factor-outbound-http/src/wasi_2023_10_18.rs +++ b/crates/factor-outbound-http/src/wasi_2023_10_18.rs @@ -9,10 +9,8 @@ mod bindings { wasmtime::component::bindgen!({ path: "../../wit", world: "wasi:http/proxy@0.2.0-rc-2023-10-18", - async: { - // Only need async exports - only_imports: [], - }, + imports: { default: trappable }, + exports: { default: async }, with: { "wasi:io/poll/pollable": latest::io::poll::Pollable, "wasi:io/streams/input-stream": latest::io::streams::InputStream, @@ -29,7 +27,6 @@ mod bindings { "wasi:http/types/future-incoming-response": latest::http::types::FutureIncomingResponse, "wasi:http/types/future-trailers": latest::http::types::FutureTrailers, }, - trappable_imports: true, }); } diff --git a/crates/factor-outbound-http/src/wasi_2023_11_10.rs b/crates/factor-outbound-http/src/wasi_2023_11_10.rs index ba0f09796b..0dac3797f4 100644 --- a/crates/factor-outbound-http/src/wasi_2023_11_10.rs +++ b/crates/factor-outbound-http/src/wasi_2023_11_10.rs @@ -12,10 +12,8 @@ mod bindings { wasmtime::component::bindgen!({ path: "../../wit", world: "wasi:http/proxy@0.2.0-rc-2023-11-10", - async: { - // Only need async exports - only_imports: [], - }, + imports: { default: trappable }, + exports: { default: async }, with: { "wasi:io/poll/pollable": latest::io::poll::Pollable, "wasi:io/streams/input-stream": latest::io::streams::InputStream, @@ -33,7 +31,6 @@ mod bindings { "wasi:http/types/future-trailers": latest::http::types::FutureTrailers, "wasi:http/types/request-options": latest::http::types::RequestOptions, }, - trappable_imports: true, }); } diff --git a/crates/factor-outbound-networking/tests/factor_test.rs b/crates/factor-outbound-networking/tests/factor_test.rs index 4faf17f059..7c7120599b 100644 --- a/crates/factor-outbound-networking/tests/factor_test.rs +++ b/crates/factor-outbound-networking/tests/factor_test.rs @@ -4,7 +4,7 @@ use spin_factor_variables::VariablesFactor; use spin_factor_wasi::{DummyFilesMounter, WasiFactor}; use spin_factors::{anyhow, RuntimeFactors}; use spin_factors_test::{toml, TestEnvironment}; -use wasmtime_wasi::p2::{bindings::sockets::instance_network::Host, IoView}; +use wasmtime_wasi::p2::bindings::sockets::instance_network::Host; use wasmtime_wasi::SocketAddrUse; #[derive(RuntimeFactors)] @@ -38,7 +38,7 @@ async fn configures_wasi_socket_addr_check() -> anyhow::Result<()> { let mut wasi = WasiFactor::get_wasi_impl(&mut state).unwrap(); let network_resource = wasi.instance_network()?; - let network = wasi.table().get(&network_resource)?; + let network = wasi.table.get(&network_resource)?; network .check_socket_addr( diff --git a/crates/factor-wasi/src/io.rs b/crates/factor-wasi/src/io.rs index f448af1fe7..f914f3e9fe 100644 --- a/crates/factor-wasi/src/io.rs +++ b/crates/factor-wasi/src/io.rs @@ -1,11 +1,13 @@ -use std::io::{Read, Write}; +use std::io::{self, Read, Write}; +use std::pin::Pin; use std::sync::{Arc, Mutex}; +use std::task::{Context, Poll}; use async_trait::async_trait; use spin_factors::anyhow; -use wasmtime_wasi::p2::{ - InputStream, OutputStream, Pollable, StdinStream, StdoutStream, StreamError, -}; +use tokio::io::{AsyncRead, AsyncWrite}; +use wasmtime_wasi::cli::{IsTerminal, StdinStream, StdoutStream}; +use wasmtime_wasi::p2::{InputStream, OutputStream, Pollable, StreamError}; /// A [`OutputStream`] that writes to a `Write` type. /// @@ -54,16 +56,37 @@ impl OutputStream for PipedWriteStream { } } -impl StdoutStream for PipedWriteStream { - fn stream(&self) -> Box { - Box::new(self.clone()) +impl AsyncWrite for PipedWriteStream { + fn poll_write( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + Poll::Ready(self.0.lock().unwrap().write(buf)) + } + fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(self.0.lock().unwrap().flush()) } + fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } +} - fn isatty(&self) -> bool { +impl IsTerminal for PipedWriteStream { + fn is_terminal(&self) -> bool { false } } +impl StdoutStream for PipedWriteStream { + fn p2_stream(&self) -> Box { + Box::new(self.clone()) + } + fn async_stream(&self) -> Box { + Box::new(self.clone()) + } +} + #[async_trait] impl Pollable for PipedWriteStream { async fn ready(&mut self) {} @@ -95,6 +118,12 @@ impl Clone for PipeReadStream { } } +impl IsTerminal for PipeReadStream { + fn is_terminal(&self) -> bool { + false + } +} + impl InputStream for PipeReadStream { fn read(&mut self, size: usize) -> wasmtime_wasi::p2::StreamResult { let size = size.min(self.buffer.len()); @@ -113,17 +142,33 @@ impl InputStream for PipeReadStream { } } +impl AsyncRead for PipeReadStream { + fn poll_read( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + buf: &mut tokio::io::ReadBuf<'_>, + ) -> Poll> { + let result = self + .inner + .lock() + .unwrap() + .read(buf.initialize_unfilled()) + .map(|n| buf.advance(n)); + Poll::Ready(result) + } +} + #[async_trait] impl Pollable for PipeReadStream { async fn ready(&mut self) {} } impl StdinStream for PipeReadStream { - fn stream(&self) -> Box { + fn p2_stream(&self) -> Box { Box::new(self.clone()) } - fn isatty(&self) -> bool { - false + fn async_stream(&self) -> Box { + Box::new(self.clone()) } } diff --git a/crates/factor-wasi/src/lib.rs b/crates/factor-wasi/src/lib.rs index 8b24197b63..e4a5c3e62a 100644 --- a/crates/factor-wasi/src/lib.rs +++ b/crates/factor-wasi/src/lib.rs @@ -16,10 +16,9 @@ use spin_factors::{ RuntimeFactors, RuntimeFactorsInstanceState, }; use wasmtime::component::HasData; -use wasmtime_wasi::p2::{ - IoImpl, IoView, StdinStream, StdoutStream, WasiCtx, WasiCtxBuilder, WasiImpl, WasiView, -}; -use wasmtime_wasi::{DirPerms, FilePerms, ResourceTable}; +use wasmtime_wasi::cli::{StdinStream, StdoutStream}; +use wasmtime_wasi::random::WasiRandomCtx; +use wasmtime_wasi::{DirPerms, FilePerms, ResourceTable, WasiCtx, WasiCtxBuilder, WasiCtxView}; pub use wasmtime_wasi::SocketAddrUse; @@ -36,12 +35,12 @@ impl WasiFactor { pub fn get_wasi_impl( runtime_instance_state: &mut impl RuntimeFactorsInstanceState, - ) -> Option> { + ) -> Option> { let (state, table) = runtime_instance_state.get_with_table::()?; - Some(WasiImpl(IoImpl(WasiImplInner { + Some(WasiCtxView { ctx: &mut state.ctx, table, - }))) + }) } } @@ -50,33 +49,34 @@ impl WasiFactor { /// signatures. #[allow(clippy::type_complexity, reason = "sorry, blame alex")] trait InitContextExt: InitContext { - fn get_io(data: &mut Self::StoreData) -> IoImpl> { - let (state, table) = Self::get_data_with_table(data); - IoImpl(WasiImplInner { - ctx: &mut state.ctx, - table, - }) + fn get_table(data: &mut Self::StoreData) -> &mut ResourceTable { + let (_state, table) = Self::get_data_with_table(data); + table } fn link_io_bindings( &mut self, add_to_linker: fn( &mut wasmtime::component::Linker, - fn(&mut Self::StoreData) -> IoImpl>, + fn(&mut Self::StoreData) -> &mut ResourceTable, ) -> anyhow::Result<()>, ) -> anyhow::Result<()> { - add_to_linker(self.linker(), Self::get_io) + add_to_linker(self.linker(), Self::get_table) } - fn get_wasi(data: &mut Self::StoreData) -> WasiImpl> { - WasiImpl(Self::get_io(data)) + fn get_wasi(data: &mut Self::StoreData) -> WasiCtxView<'_> { + let (state, table) = Self::get_data_with_table(data); + WasiCtxView { + ctx: &mut state.ctx, + table, + } } fn link_wasi_bindings( &mut self, add_to_linker: fn( &mut wasmtime::component::Linker, - fn(&mut Self::StoreData) -> WasiImpl>, + fn(&mut Self::StoreData) -> WasiCtxView<'_>, ) -> anyhow::Result<()>, ) -> anyhow::Result<()> { add_to_linker(self.linker(), Self::get_wasi) @@ -87,7 +87,7 @@ trait InitContextExt: InitContext { add_to_linker: fn( &mut wasmtime::component::Linker, &O, - fn(&mut Self::StoreData) -> WasiImpl>, + fn(&mut Self::StoreData) -> WasiCtxView<'_>, ) -> anyhow::Result<()>, ) -> anyhow::Result<()> where @@ -95,6 +95,19 @@ trait InitContextExt: InitContext { { add_to_linker(self.linker(), &O::default(), Self::get_wasi) } + + fn link_random_bindings( + &mut self, + add_to_linker: fn( + &mut wasmtime::component::Linker, + fn(&mut Self::StoreData) -> &mut WasiRandomCtx, + ) -> anyhow::Result<()>, + ) -> anyhow::Result<()> { + add_to_linker(self.linker(), |data| { + let (state, _table) = Self::get_data_with_table(data); + state.ctx.random() + }) + } } impl InitContextExt for T where T: InitContext {} @@ -102,13 +115,19 @@ impl InitContextExt for T where T: InitContext {} struct HasWasi; impl HasData for HasWasi { - type Data<'a> = WasiImpl>; + type Data<'a> = WasiCtxView<'a>; } struct HasIo; impl HasData for HasIo { - type Data<'a> = IoImpl>; + type Data<'a> = &'a mut ResourceTable; +} + +struct HasRandom; + +impl HasData for HasRandom { + type Data<'a> = &'a mut WasiRandomCtx; } impl Factor for WasiFactor { @@ -126,9 +145,9 @@ impl Factor for WasiFactor { ctx.link_io_bindings(bindings::io::error::add_to_linker::<_, HasIo>)?; ctx.link_io_bindings(bindings::io::poll::add_to_linker::<_, HasIo>)?; ctx.link_io_bindings(bindings::io::streams::add_to_linker::<_, HasIo>)?; - ctx.link_wasi_bindings(bindings::random::random::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::random::insecure::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::random::insecure_seed::add_to_linker::<_, HasWasi>)?; + ctx.link_random_bindings(bindings::random::random::add_to_linker::<_, HasRandom>)?; + ctx.link_random_bindings(bindings::random::insecure::add_to_linker::<_, HasRandom>)?; + ctx.link_random_bindings(bindings::random::insecure_seed::add_to_linker::<_, HasRandom>)?; ctx.link_wasi_default_bindings(bindings::cli::exit::add_to_linker::<_, HasWasi>)?; ctx.link_wasi_bindings(bindings::cli::environment::add_to_linker::<_, HasWasi>)?; ctx.link_wasi_bindings(bindings::cli::stdin::add_to_linker::<_, HasWasi>)?; @@ -330,20 +349,3 @@ impl InstanceBuilder { pub struct InstanceState { ctx: WasiCtx, } - -struct WasiImplInner<'a> { - ctx: &'a mut WasiCtx, - table: &'a mut ResourceTable, -} - -impl WasiView for WasiImplInner<'_> { - fn ctx(&mut self) -> &mut WasiCtx { - self.ctx - } -} - -impl IoView for WasiImplInner<'_> { - fn table(&mut self) -> &mut ResourceTable { - self.table - } -} diff --git a/crates/factor-wasi/src/wasi_2023_10_18.rs b/crates/factor-wasi/src/wasi_2023_10_18.rs index 2bb13b5e0f..cc3c338f51 100644 --- a/crates/factor-wasi/src/wasi_2023_10_18.rs +++ b/crates/factor-wasi/src/wasi_2023_10_18.rs @@ -1,8 +1,8 @@ use spin_factors::anyhow::{self, Result}; use std::mem; use wasmtime::component::{Linker, Resource}; -use wasmtime_wasi::p2::{DynPollable, IoView, WasiImpl, WasiView}; -use wasmtime_wasi::TrappableError; +use wasmtime_wasi::p2::DynPollable; +use wasmtime_wasi::{TrappableError, WasiCtxView}; mod latest { pub use wasmtime_wasi::p2::bindings::*; @@ -15,63 +15,59 @@ mod bindings { wasmtime::component::bindgen!({ path: "../../wit", world: "wasi:cli/reactor@0.2.0-rc-2023-10-18", - async: { - only_imports: [ - "[drop]output-stream", - "[drop]input-stream", - "[method]descriptor.access-at", - "[method]descriptor.advise", - "[method]descriptor.change-directory-permissions-at", - "[method]descriptor.change-file-permissions-at", - "[method]descriptor.create-directory-at", - "[method]descriptor.get-flags", - "[method]descriptor.get-type", - "[method]descriptor.is-same-object", - "[method]descriptor.link-at", - "[method]descriptor.lock-exclusive", - "[method]descriptor.lock-shared", - "[method]descriptor.metadata-hash", - "[method]descriptor.metadata-hash-at", - "[method]descriptor.open-at", - "[method]descriptor.read", - "[method]descriptor.read-directory", - "[method]descriptor.readlink-at", - "[method]descriptor.remove-directory-at", - "[method]descriptor.rename-at", - "[method]descriptor.set-size", - "[method]descriptor.set-times", - "[method]descriptor.set-times-at", - "[method]descriptor.stat", - "[method]descriptor.stat-at", - "[method]descriptor.symlink-at", - "[method]descriptor.sync", - "[method]descriptor.sync-data", - "[method]descriptor.try-lock-exclusive", - "[method]descriptor.try-lock-shared", - "[method]descriptor.unlink-file-at", - "[method]descriptor.unlock", - "[method]descriptor.write", - "[method]input-stream.blocking-read", - "[method]input-stream.blocking-skip", - "[method]output-stream.forward", - "[method]output-stream.blocking-splice", - "[method]output-stream.blocking-flush", - "[method]output-stream.blocking-write", - "[method]output-stream.blocking-write-and-flush", - "[method]output-stream.blocking-write-zeroes-and-flush", - "[method]directory-entry-stream.read-directory-entry", - "poll-list", - "poll-one", - - "[method]tcp-socket.start-bind", - "[method]tcp-socket.start-connect", - "[method]udp-socket.finish-connect", - "[method]udp-socket.receive", - "[method]udp-socket.send", - "[method]udp-socket.start-bind", - "[method]udp-socket.stream", - "[method]outgoing-datagram-stream.send", - ], + imports: { + "wasi:io/streams/[drop]output-stream": async | trappable, + "wasi:io/streams/[drop]input-stream": async | trappable, + "wasi:filesystem/types/[method]descriptor.access-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.advise": async | trappable, + "wasi:filesystem/types/[method]descriptor.change-directory-permissions-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.change-file-permissions-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.create-directory-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.get-flags": async | trappable, + "wasi:filesystem/types/[method]descriptor.get-type": async | trappable, + "wasi:filesystem/types/[method]descriptor.is-same-object": async | trappable, + "wasi:filesystem/types/[method]descriptor.link-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.lock-exclusive": async | trappable, + "wasi:filesystem/types/[method]descriptor.lock-shared": async | trappable, + "wasi:filesystem/types/[method]descriptor.metadata-hash": async | trappable, + "wasi:filesystem/types/[method]descriptor.metadata-hash-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.open-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.read": async | trappable, + "wasi:filesystem/types/[method]descriptor.read-directory": async | trappable, + "wasi:filesystem/types/[method]descriptor.readlink-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.remove-directory-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.rename-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.set-size": async | trappable, + "wasi:filesystem/types/[method]descriptor.set-times": async | trappable, + "wasi:filesystem/types/[method]descriptor.set-times-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.stat": async | trappable, + "wasi:filesystem/types/[method]descriptor.stat-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.symlink-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.sync": async | trappable, + "wasi:filesystem/types/[method]descriptor.sync-data": async | trappable, + "wasi:filesystem/types/[method]descriptor.try-lock-exclusive": async | trappable, + "wasi:filesystem/types/[method]descriptor.try-lock-shared": async | trappable, + "wasi:filesystem/types/[method]descriptor.unlink-file-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.unlock": async | trappable, + "wasi:filesystem/types/[method]descriptor.write": async | trappable, + "wasi:filesystem/types/[method]directory-entry-stream.read-directory-entry": async | trappable, + "wasi:io/streams/[method]input-stream.blocking-read": async | trappable, + "wasi:io/streams/[method]input-stream.blocking-skip": async | trappable, + "wasi:io/streams/[method]output-stream.forward": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-splice": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-flush": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-write-and-flush": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-write-zeroes-and-flush": async | trappable, + "wasi:io/poll/poll-list": async | trappable, + "wasi:io/poll/poll-one": async | trappable, + + "wasi:sockets/tcp/[method]tcp-socket.start-bind": async | trappable, + "wasi:sockets/tcp/[method]tcp-socket.start-connect": async | trappable, + "wasi:sockets/udp/[method]udp-socket.finish-connect": async | trappable, + "wasi:sockets/udp/[method]udp-socket.receive": async | trappable, + "wasi:sockets/udp/[method]udp-socket.send": async | trappable, + "wasi:sockets/udp/[method]udp-socket.start-bind": async | trappable, + default: trappable, }, with: { "wasi:io/poll/pollable": latest::io::poll::Pollable, @@ -87,7 +83,6 @@ mod bindings { "wasi:sockets/network/network": latest::sockets::network::Network, "wasi:sockets/ip-name-lookup/resolve-address-stream": latest::sockets::ip_name_lookup::ResolveAddressStream, }, - trappable_imports: true, }); } @@ -117,11 +112,11 @@ use wasi::sockets::tcp::{ }; use wasi::sockets::udp::Datagram; -use crate::{HasWasi, WasiImplInner}; +use crate::HasWasi; pub fn add_to_linker( linker: &mut Linker, - closure: fn(&mut T) -> WasiImpl>, + closure: fn(&mut T) -> WasiCtxView<'_>, ) -> Result<()> where T: Send + 'static, @@ -155,10 +150,7 @@ where Ok(()) } -impl wasi::clocks::monotonic_clock::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::clocks::monotonic_clock::Host for WasiCtxView<'_> { fn now(&mut self) -> wasmtime::Result { latest::clocks::monotonic_clock::Host::now(self) } @@ -180,10 +172,7 @@ where } } -impl wasi::clocks::wall_clock::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::clocks::wall_clock::Host for WasiCtxView<'_> { fn now(&mut self) -> wasmtime::Result { Ok(latest::clocks::wall_clock::Host::now(self)?.into()) } @@ -193,10 +182,7 @@ where } } -impl wasi::filesystem::types::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::types::Host for WasiCtxView<'_> { fn filesystem_error_code( &mut self, err: Resource, @@ -205,10 +191,7 @@ where } } -impl wasi::filesystem::types::HostDescriptor for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::types::HostDescriptor for WasiCtxView<'_> { fn read_via_stream( &mut self, self_: Resource, @@ -602,10 +585,7 @@ where } } -impl wasi::filesystem::types::HostDirectoryEntryStream for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::types::HostDirectoryEntryStream for WasiCtxView<'_> { async fn read_directory_entry( &mut self, self_: Resource, @@ -622,62 +602,47 @@ where } } -impl wasi::filesystem::preopens::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::preopens::Host for WasiCtxView<'_> { fn get_directories(&mut self) -> wasmtime::Result, String)>> { latest::filesystem::preopens::Host::get_directories(self) } } -impl wasi::io::poll::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::io::poll::Host for WasiCtxView<'_> { async fn poll_list(&mut self, list: Vec>) -> wasmtime::Result> { - latest::io::poll::Host::poll(&mut self.0, list).await + latest::io::poll::Host::poll(self.table, list).await } async fn poll_one(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::poll::HostPollable::block(&mut self.0, rep).await + latest::io::poll::HostPollable::block(self.table, rep).await } } -impl wasi::io::poll::HostPollable for WasiImpl -where - T: WasiView, -{ +impl wasi::io::poll::HostPollable for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::poll::HostPollable::drop(&mut self.0, rep) + latest::io::poll::HostPollable::drop(self.table, rep) } } -impl wasi::io::streams::Host for WasiImpl where T: WasiView {} +impl wasi::io::streams::Host for WasiCtxView<'_> {} -impl wasi::io::streams::HostError for WasiImpl -where - T: WasiView, -{ +impl wasi::io::streams::HostError for WasiCtxView<'_> { fn to_debug_string(&mut self, self_: Resource) -> wasmtime::Result { - latest::io::error::HostError::to_debug_string(&mut self.0, self_) + latest::io::error::HostError::to_debug_string(self.table, self_) } fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::error::HostError::drop(&mut self.0, rep) + latest::io::error::HostError::drop(self.table, rep) } } -impl wasi::io::streams::HostInputStream for WasiImpl -where - T: WasiView, -{ +impl wasi::io::streams::HostInputStream for WasiCtxView<'_> { fn read( &mut self, self_: Resource, len: u64, ) -> wasmtime::Result, StreamError>> { - let result = latest::io::streams::HostInputStream::read(&mut self.0, self_, len); + let result = latest::io::streams::HostInputStream::read(self.table, self_, len); convert_stream_result(self, result) } @@ -687,7 +652,7 @@ where len: u64, ) -> wasmtime::Result, StreamError>> { let result = - latest::io::streams::HostInputStream::blocking_read(&mut self.0, self_, len).await; + latest::io::streams::HostInputStream::blocking_read(self.table, self_, len).await; convert_stream_result(self, result) } @@ -696,7 +661,7 @@ where self_: Resource, len: u64, ) -> wasmtime::Result> { - let result = latest::io::streams::HostInputStream::skip(&mut self.0, self_, len); + let result = latest::io::streams::HostInputStream::skip(self.table, self_, len); convert_stream_result(self, result) } @@ -706,7 +671,7 @@ where len: u64, ) -> wasmtime::Result> { let result = - latest::io::streams::HostInputStream::blocking_skip(&mut self.0, self_, len).await; + latest::io::streams::HostInputStream::blocking_skip(self.table, self_, len).await; convert_stream_result(self, result) } @@ -714,23 +679,20 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - latest::io::streams::HostInputStream::subscribe(&mut self.0, self_) + latest::io::streams::HostInputStream::subscribe(self.table, self_) } async fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::streams::HostInputStream::drop(&mut self.0, rep).await + latest::io::streams::HostInputStream::drop(self.table, rep).await } } -impl wasi::io::streams::HostOutputStream for WasiImpl -where - T: WasiView, -{ +impl wasi::io::streams::HostOutputStream for WasiCtxView<'_> { fn check_write( &mut self, self_: Resource, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::check_write(&mut self.0, self_); + let result = latest::io::streams::HostOutputStream::check_write(self.table, self_); convert_stream_result(self, result) } @@ -739,7 +701,7 @@ where self_: Resource, contents: Vec, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::write(&mut self.0, self_, contents); + let result = latest::io::streams::HostOutputStream::write(self.table, self_, contents); convert_stream_result(self, result) } @@ -749,9 +711,7 @@ where contents: Vec, ) -> wasmtime::Result> { let result = latest::io::streams::HostOutputStream::blocking_write_and_flush( - &mut self.0, - self_, - contents, + self.table, self_, contents, ) .await; convert_stream_result(self, result) @@ -761,7 +721,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::flush(&mut self.0, self_); + let result = latest::io::streams::HostOutputStream::flush(self.table, self_); convert_stream_result(self, result) } @@ -769,8 +729,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let result = - latest::io::streams::HostOutputStream::blocking_flush(&mut self.0, self_).await; + let result = latest::io::streams::HostOutputStream::blocking_flush(self.table, self_).await; convert_stream_result(self, result) } @@ -778,7 +737,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - latest::io::streams::HostOutputStream::subscribe(&mut self.0, self_) + latest::io::streams::HostOutputStream::subscribe(self.table, self_) } fn write_zeroes( @@ -786,7 +745,7 @@ where self_: Resource, len: u64, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::write_zeroes(&mut self.0, self_, len); + let result = latest::io::streams::HostOutputStream::write_zeroes(self.table, self_, len); convert_stream_result(self, result) } @@ -796,9 +755,7 @@ where len: u64, ) -> wasmtime::Result> { let result = latest::io::streams::HostOutputStream::blocking_write_zeroes_and_flush( - &mut self.0, - self_, - len, + self.table, self_, len, ) .await; convert_stream_result(self, result) @@ -810,7 +767,7 @@ where src: Resource, len: u64, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::splice(&mut self.0, self_, src, len); + let result = latest::io::streams::HostOutputStream::splice(self.table, self_, src, len); convert_stream_result(self, result) } @@ -821,7 +778,7 @@ where len: u64, ) -> wasmtime::Result> { let result = - latest::io::streams::HostOutputStream::blocking_splice(&mut self.0, self_, src, len) + latest::io::streams::HostOutputStream::blocking_splice(self.table, self_, src, len) .await; convert_stream_result(self, result) } @@ -835,58 +792,43 @@ where } async fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::streams::HostOutputStream::drop(&mut self.0, rep).await + latest::io::streams::HostOutputStream::drop(self.table, rep).await } } -impl wasi::random::random::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::random::random::Host for WasiCtxView<'_> { fn get_random_bytes(&mut self, len: u64) -> wasmtime::Result> { - latest::random::random::Host::get_random_bytes(self, len) + latest::random::random::Host::get_random_bytes(self.ctx.random(), len) } fn get_random_u64(&mut self) -> wasmtime::Result { - latest::random::random::Host::get_random_u64(self) + latest::random::random::Host::get_random_u64(self.ctx.random()) } } -impl wasi::random::insecure::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::random::insecure::Host for WasiCtxView<'_> { fn get_insecure_random_bytes(&mut self, len: u64) -> wasmtime::Result> { - latest::random::insecure::Host::get_insecure_random_bytes(self, len) + latest::random::insecure::Host::get_insecure_random_bytes(self.ctx.random(), len) } fn get_insecure_random_u64(&mut self) -> wasmtime::Result { - latest::random::insecure::Host::get_insecure_random_u64(self) + latest::random::insecure::Host::get_insecure_random_u64(self.ctx.random()) } } -impl wasi::random::insecure_seed::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::random::insecure_seed::Host for WasiCtxView<'_> { fn insecure_seed(&mut self) -> wasmtime::Result<(u64, u64)> { - latest::random::insecure_seed::Host::insecure_seed(self) + latest::random::insecure_seed::Host::insecure_seed(self.ctx.random()) } } -impl wasi::cli::exit::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::exit::Host for WasiCtxView<'_> { fn exit(&mut self, status: Result<(), ()>) -> wasmtime::Result<()> { latest::cli::exit::Host::exit(self, status) } } -impl wasi::cli::environment::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::environment::Host for WasiCtxView<'_> { fn get_environment(&mut self) -> wasmtime::Result> { latest::cli::environment::Host::get_environment(self) } @@ -900,88 +842,61 @@ where } } -impl wasi::cli::stdin::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::stdin::Host for WasiCtxView<'_> { fn get_stdin(&mut self) -> wasmtime::Result> { latest::cli::stdin::Host::get_stdin(self) } } -impl wasi::cli::stdout::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::stdout::Host for WasiCtxView<'_> { fn get_stdout(&mut self) -> wasmtime::Result> { latest::cli::stdout::Host::get_stdout(self) } } -impl wasi::cli::stderr::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::stderr::Host for WasiCtxView<'_> { fn get_stderr(&mut self) -> wasmtime::Result> { latest::cli::stderr::Host::get_stderr(self) } } -impl wasi::cli::terminal_stdin::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_stdin::Host for WasiCtxView<'_> { fn get_terminal_stdin(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdin::Host::get_terminal_stdin(self) } } -impl wasi::cli::terminal_stdout::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_stdout::Host for WasiCtxView<'_> { fn get_terminal_stdout(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdout::Host::get_terminal_stdout(self) } } -impl wasi::cli::terminal_stderr::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_stderr::Host for WasiCtxView<'_> { fn get_terminal_stderr(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stderr::Host::get_terminal_stderr(self) } } -impl wasi::cli::terminal_input::Host for WasiImpl where T: WasiView {} +impl wasi::cli::terminal_input::Host for WasiCtxView<'_> {} -impl wasi::cli::terminal_input::HostTerminalInput for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_input::HostTerminalInput for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_input::HostTerminalInput::drop(self, rep) } } -impl wasi::cli::terminal_output::Host for WasiImpl where T: WasiView {} +impl wasi::cli::terminal_output::Host for WasiCtxView<'_> {} -impl wasi::cli::terminal_output::HostTerminalOutput for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_output::HostTerminalOutput for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_output::HostTerminalOutput::drop(self, rep) } } -impl wasi::sockets::tcp::Host for WasiImpl where T: WasiView {} +impl wasi::sockets::tcp::Host for WasiCtxView<'_> {} -impl wasi::sockets::tcp::HostTcpSocket for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::tcp::HostTcpSocket for WasiCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1226,10 +1141,7 @@ where } } -impl wasi::sockets::tcp_create_socket::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::tcp_create_socket::Host for WasiCtxView<'_> { fn create_tcp_socket( &mut self, address_family: IpAddressFamily, @@ -1241,7 +1153,7 @@ where } } -impl wasi::sockets::udp::Host for WasiImpl where T: WasiView {} +impl wasi::sockets::udp::Host for WasiCtxView<'_> {} /// Between the snapshot of WASI that this file is implementing and the current /// implementation of WASI UDP sockets were redesigned slightly to deal with @@ -1261,12 +1173,12 @@ pub enum UdpSocket { } impl UdpSocket { - async fn finish_connect( - table: &mut WasiImpl, + async fn finish_connect( + table: &mut WasiCtxView<'_>, socket: &Resource, explicit: bool, ) -> wasmtime::Result> { - let state = table.table().get_mut(socket)?; + let state = table.table.get_mut(socket)?; let (new_socket, addr) = match mem::replace(state, UdpSocket::Dummy) { // Implicit finishes will call `stream` for sockets in the initial // state. @@ -1286,7 +1198,7 @@ impl UdpSocket { Ok(pair) => pair, Err(e) => return Ok(Err(e)), }; - *table.table().get_mut(socket)? = UdpSocket::Connected { + *table.table.get_mut(socket)? = UdpSocket::Connected { socket: new_socket, incoming, outgoing, @@ -1305,17 +1217,14 @@ impl UdpSocket { } } -impl wasi::sockets::udp::HostUdpSocket for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::udp::HostUdpSocket for WasiCtxView<'_> { async fn start_bind( &mut self, self_: Resource, network: Resource, local_address: IpSocketAddress, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result( latest::sockets::udp::HostUdpSocket::start_bind( self, @@ -1331,7 +1240,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::finish_bind( self, socket, )) @@ -1343,7 +1252,7 @@ where _network: Resource, remote_address: IpSocketAddress, ) -> wasmtime::Result> { - let socket = self.table().get_mut(&self_)?; + let socket = self.table.get_mut(&self_)?; let (new_state, result) = match mem::replace(socket, UdpSocket::Dummy) { UdpSocket::Initial(socket) => (UdpSocket::Connecting(socket, remote_address), Ok(())), other => (other, Err(SocketErrorCode::ConcurrencyConflict)), @@ -1372,7 +1281,7 @@ where // Use our connected state to acquire the `incoming-datagram-stream` // resource, then receive some datagrams. - let incoming = match self.table().get(&self_)? { + let incoming = match self.table.get(&self_)? { UdpSocket::Connected { incoming, .. } => Resource::new_borrow(incoming.rep()), _ => return Ok(Err(SocketErrorCode::ConcurrencyConflict)), }; @@ -1401,7 +1310,7 @@ where // Use our connected state to acquire the `outgoing-datagram-stream` // resource. - let outgoing = match self.table().get(&self_)? { + let outgoing = match self.table.get(&self_)? { UdpSocket::Connected { outgoing, .. } => Resource::new_borrow(outgoing.rep()), _ => return Ok(Err(SocketErrorCode::ConcurrencyConflict)), }; @@ -1441,7 +1350,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::local_address( self, socket, )) @@ -1451,14 +1360,14 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::remote_address( self, socket, )) } fn address_family(&mut self, self_: Resource) -> wasmtime::Result { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; latest::sockets::udp::HostUdpSocket::address_family(self, socket).map(|e| e.into()) } @@ -1481,7 +1390,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::unicast_hop_limit( self, socket, )) @@ -1492,7 +1401,7 @@ where self_: Resource, value: u8, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::set_unicast_hop_limit( self, socket, value, )) @@ -1502,7 +1411,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::receive_buffer_size( self, socket, )) @@ -1513,7 +1422,7 @@ where self_: Resource, value: u64, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result( latest::sockets::udp::HostUdpSocket::set_receive_buffer_size(self, socket, value), ) @@ -1523,7 +1432,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::send_buffer_size( self, socket, )) @@ -1534,19 +1443,19 @@ where self_: Resource, value: u64, ) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; convert_result(latest::sockets::udp::HostUdpSocket::set_send_buffer_size( self, socket, value, )) } fn subscribe(&mut self, self_: Resource) -> wasmtime::Result> { - let socket = self.table().get(&self_)?.inner()?; + let socket = self.table.get(&self_)?.inner()?; latest::sockets::udp::HostUdpSocket::subscribe(self, socket) } fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - let me = self.table().delete(rep)?; + let me = self.table.delete(rep)?; let socket = match me { UdpSocket::Initial(s) => s, UdpSocket::Connecting(s, _) => s, @@ -1565,10 +1474,7 @@ where } } -impl wasi::sockets::udp_create_socket::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::udp_create_socket::Host for WasiCtxView<'_> { fn create_udp_socket( &mut self, address_family: IpAddressFamily, @@ -1581,35 +1487,26 @@ where Ok(socket) => socket, Err(e) => return Ok(Err(e)), }; - let socket = self.table().push(UdpSocket::Initial(socket))?; + let socket = self.table.push(UdpSocket::Initial(socket))?; Ok(Ok(socket)) } } -impl wasi::sockets::instance_network::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::instance_network::Host for WasiCtxView<'_> { fn instance_network(&mut self) -> wasmtime::Result> { latest::sockets::instance_network::Host::instance_network(self) } } -impl wasi::sockets::network::Host for WasiImpl where T: WasiView {} +impl wasi::sockets::network::Host for WasiCtxView<'_> {} -impl wasi::sockets::network::HostNetwork for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::network::HostNetwork for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::sockets::network::HostNetwork::drop(self, rep) } } -impl wasi::sockets::ip_name_lookup::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::ip_name_lookup::Host for WasiCtxView<'_> { fn resolve_addresses( &mut self, network: Resource, @@ -1623,10 +1520,7 @@ where } } -impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiCtxView<'_> { fn resolve_next_address( &mut self, self_: Resource, @@ -1666,7 +1560,7 @@ where } fn convert_stream_result( - mut view: impl WasiView, + view: &mut WasiCtxView<'_>, result: Result, ) -> wasmtime::Result> where @@ -1676,7 +1570,7 @@ where Ok(e) => Ok(Ok(e.into())), Err(wasmtime_wasi::p2::StreamError::Closed) => Ok(Err(StreamError::Closed)), Err(wasmtime_wasi::p2::StreamError::LastOperationFailed(e)) => { - let e = view.table().push(e)?; + let e = view.table.push(e)?; Ok(Err(StreamError::LastOperationFailed(e))) } Err(wasmtime_wasi::p2::StreamError::Trap(e)) => Err(e), diff --git a/crates/factor-wasi/src/wasi_2023_11_10.rs b/crates/factor-wasi/src/wasi_2023_11_10.rs index 48cf09dc24..50c59cddfa 100644 --- a/crates/factor-wasi/src/wasi_2023_11_10.rs +++ b/crates/factor-wasi/src/wasi_2023_11_10.rs @@ -1,7 +1,7 @@ use super::wasi_2023_10_18::{convert, convert_result}; use spin_factors::anyhow::{self, Result}; use wasmtime::component::{Linker, Resource}; -use wasmtime_wasi::p2::{WasiImpl, WasiView}; +use wasmtime_wasi::WasiCtxView; mod latest { pub use wasmtime_wasi::p2::bindings::*; @@ -13,52 +13,50 @@ mod bindings { wasmtime::component::bindgen!({ path: "../../wit", world: "wasi:cli/reactor@0.2.0-rc-2023-11-10", - async: { - only_imports: [ - "[drop]input-stream", - "[drop]output-stream", - "[method]descriptor.advise", - "[method]descriptor.create-directory-at", - "[method]descriptor.get-flags", - "[method]descriptor.get-type", - "[method]descriptor.is-same-object", - "[method]descriptor.link-at", - "[method]descriptor.metadata-hash", - "[method]descriptor.metadata-hash-at", - "[method]descriptor.open-at", - "[method]descriptor.read", - "[method]descriptor.read-directory", - "[method]descriptor.readlink-at", - "[method]descriptor.remove-directory-at", - "[method]descriptor.rename-at", - "[method]descriptor.set-size", - "[method]descriptor.set-times", - "[method]descriptor.set-times-at", - "[method]descriptor.stat", - "[method]descriptor.stat-at", - "[method]descriptor.symlink-at", - "[method]descriptor.sync", - "[method]descriptor.sync-data", - "[method]descriptor.unlink-file-at", - "[method]descriptor.write", - "[method]input-stream.blocking-read", - "[method]input-stream.blocking-skip", - "[method]output-stream.blocking-splice", - "[method]output-stream.blocking-flush", - "[method]output-stream.blocking-write", - "[method]output-stream.blocking-write-and-flush", - "[method]output-stream.blocking-write-zeroes-and-flush", - "[method]directory-entry-stream.read-directory-entry", - "[method]pollable.block", - "[method]pollable.ready", - "poll", - - "[method]tcp-socket.start-bind", - "[method]tcp-socket.start-connect", - "[method]udp-socket.start-bind", - "[method]udp-socket.stream", - "[method]outgoing-datagram-stream.send", - ] + imports: { + "wasi:io/streams/[drop]input-stream": async | trappable, + "wasi:io/streams/[drop]output-stream": async | trappable, + "wasi:filesystem/types/[method]descriptor.advise": async | trappable, + "wasi:filesystem/types/[method]descriptor.create-directory-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.get-flags": async | trappable, + "wasi:filesystem/types/[method]descriptor.get-type": async | trappable, + "wasi:filesystem/types/[method]descriptor.is-same-object": async | trappable, + "wasi:filesystem/types/[method]descriptor.link-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.metadata-hash": async | trappable, + "wasi:filesystem/types/[method]descriptor.metadata-hash-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.open-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.read": async | trappable, + "wasi:filesystem/types/[method]descriptor.read-directory": async | trappable, + "wasi:filesystem/types/[method]descriptor.readlink-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.remove-directory-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.rename-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.set-size": async | trappable, + "wasi:filesystem/types/[method]descriptor.set-times": async | trappable, + "wasi:filesystem/types/[method]descriptor.set-times-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.stat": async | trappable, + "wasi:filesystem/types/[method]descriptor.stat-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.symlink-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.sync": async | trappable, + "wasi:filesystem/types/[method]descriptor.sync-data": async | trappable, + "wasi:filesystem/types/[method]descriptor.unlink-file-at": async | trappable, + "wasi:filesystem/types/[method]descriptor.write": async | trappable, + "wasi:io/streams/[method]input-stream.blocking-read": async | trappable, + "wasi:io/streams/[method]input-stream.blocking-skip": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-splice": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-flush": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-write-and-flush": async | trappable, + "wasi:io/streams/[method]output-stream.blocking-write-zeroes-and-flush": async | trappable, + "wasi:filesystem/types/[method]directory-entry-stream.read-directory-entry": async | trappable, + "wasi:io/poll/[method]pollable.block": async | trappable, + "wasi:io/poll/[method]pollable.ready": async | trappable, + "wasi:io/poll/poll": async | trappable, + + "wasi:sockets/tcp/[method]tcp-socket.start-bind": async | trappable, + "wasi:sockets/tcp/[method]tcp-socket.start-connect": async | trappable, + "wasi:sockets/udp/[method]udp-socket.start-bind": async | trappable, + "wasi:sockets/udp/[method]udp-socket.stream": async | trappable, + "wasi:sockets/udp/[method]outgoing-datagram-stream.send": async | trappable, + default: trappable, }, with: { "wasi:io/poll/pollable": latest::io::poll::Pollable, @@ -76,7 +74,6 @@ mod bindings { "wasi:sockets/network/network": latest::sockets::network::Network, "wasi:sockets/ip-name-lookup/resolve-address-stream": latest::sockets::ip_name_lookup::ResolveAddressStream, }, - trappable_imports: true, }); } @@ -109,11 +106,11 @@ use wasi::sockets::udp::{ IncomingDatagram, IncomingDatagramStream, OutgoingDatagram, OutgoingDatagramStream, UdpSocket, }; -use crate::{HasWasi, WasiImplInner}; +use crate::HasWasi; pub fn add_to_linker( linker: &mut Linker, - closure: fn(&mut T) -> WasiImpl>, + closure: fn(&mut T) -> WasiCtxView<'_>, ) -> Result<()> where T: Send + 'static, @@ -148,10 +145,7 @@ where Ok(()) } -impl wasi::clocks::monotonic_clock::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::clocks::monotonic_clock::Host for WasiCtxView<'_> { fn now(&mut self) -> wasmtime::Result { latest::clocks::monotonic_clock::Host::now(self) } @@ -169,10 +163,7 @@ where } } -impl wasi::clocks::wall_clock::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::clocks::wall_clock::Host for WasiCtxView<'_> { fn now(&mut self) -> wasmtime::Result { Ok(latest::clocks::wall_clock::Host::now(self)?.into()) } @@ -182,10 +173,7 @@ where } } -impl wasi::filesystem::types::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::types::Host for WasiCtxView<'_> { fn filesystem_error_code( &mut self, err: Resource, @@ -194,10 +182,7 @@ where } } -impl wasi::filesystem::types::HostDescriptor for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::types::HostDescriptor for WasiCtxView<'_> { fn read_via_stream( &mut self, self_: Resource, @@ -521,10 +506,7 @@ where } } -impl wasi::filesystem::types::HostDirectoryEntryStream for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::types::HostDirectoryEntryStream for WasiCtxView<'_> { async fn read_directory_entry( &mut self, self_: Resource, @@ -541,58 +523,46 @@ where } } -impl wasi::filesystem::preopens::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::filesystem::preopens::Host for WasiCtxView<'_> { fn get_directories(&mut self) -> wasmtime::Result, String)>> { latest::filesystem::preopens::Host::get_directories(self) } } -impl wasi::io::poll::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::io::poll::Host for WasiCtxView<'_> { async fn poll(&mut self, list: Vec>) -> wasmtime::Result> { - latest::io::poll::Host::poll(&mut self.0, list).await + latest::io::poll::Host::poll(self.table, list).await } } -impl wasi::io::poll::HostPollable for WasiImpl -where - T: WasiView, -{ +impl wasi::io::poll::HostPollable for WasiCtxView<'_> { async fn block(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::poll::HostPollable::block(&mut self.0, rep).await + latest::io::poll::HostPollable::block(self.table, rep).await } async fn ready(&mut self, rep: Resource) -> wasmtime::Result { - latest::io::poll::HostPollable::ready(&mut self.0, rep).await + latest::io::poll::HostPollable::ready(self.table, rep).await } fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::poll::HostPollable::drop(&mut self.0, rep) + latest::io::poll::HostPollable::drop(self.table, rep) } } -impl wasi::io::error::Host for WasiImpl where T: WasiView {} +impl wasi::io::error::Host for WasiCtxView<'_> {} -impl wasi::io::error::HostError for WasiImpl -where - T: WasiView, -{ +impl wasi::io::error::HostError for WasiCtxView<'_> { fn to_debug_string(&mut self, self_: Resource) -> wasmtime::Result { - latest::io::error::HostError::to_debug_string(&mut self.0, self_) + latest::io::error::HostError::to_debug_string(self.table, self_) } fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::error::HostError::drop(&mut self.0, rep) + latest::io::error::HostError::drop(self.table, rep) } } fn convert_stream_result( - mut view: impl WasiView, + view: &mut WasiCtxView<'_>, result: Result, ) -> wasmtime::Result> where @@ -602,25 +572,22 @@ where Ok(e) => Ok(Ok(e.into())), Err(wasmtime_wasi::p2::StreamError::Closed) => Ok(Err(StreamError::Closed)), Err(wasmtime_wasi::p2::StreamError::LastOperationFailed(e)) => { - let e = view.table().push(e)?; + let e = view.table.push(e)?; Ok(Err(StreamError::LastOperationFailed(e))) } Err(wasmtime_wasi::p2::StreamError::Trap(e)) => Err(e), } } -impl wasi::io::streams::Host for WasiImpl where T: WasiView {} +impl wasi::io::streams::Host for WasiCtxView<'_> {} -impl wasi::io::streams::HostInputStream for WasiImpl -where - T: WasiView, -{ +impl wasi::io::streams::HostInputStream for WasiCtxView<'_> { fn read( &mut self, self_: Resource, len: u64, ) -> wasmtime::Result, StreamError>> { - let result = latest::io::streams::HostInputStream::read(&mut self.0, self_, len); + let result = latest::io::streams::HostInputStream::read(self.table, self_, len); convert_stream_result(self, result) } @@ -630,7 +597,7 @@ where len: u64, ) -> wasmtime::Result, StreamError>> { let result = - latest::io::streams::HostInputStream::blocking_read(&mut self.0, self_, len).await; + latest::io::streams::HostInputStream::blocking_read(self.table, self_, len).await; convert_stream_result(self, result) } @@ -639,7 +606,7 @@ where self_: Resource, len: u64, ) -> wasmtime::Result> { - let result = latest::io::streams::HostInputStream::skip(&mut self.0, self_, len); + let result = latest::io::streams::HostInputStream::skip(self.table, self_, len); convert_stream_result(self, result) } @@ -649,28 +616,25 @@ where len: u64, ) -> wasmtime::Result> { let result = - latest::io::streams::HostInputStream::blocking_skip(&mut self.0, self_, len).await; + latest::io::streams::HostInputStream::blocking_skip(self.table, self_, len).await; convert_stream_result(self, result) } fn subscribe(&mut self, self_: Resource) -> wasmtime::Result> { - latest::io::streams::HostInputStream::subscribe(&mut self.0, self_) + latest::io::streams::HostInputStream::subscribe(self.table, self_) } async fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::streams::HostInputStream::drop(&mut self.0, rep).await + latest::io::streams::HostInputStream::drop(self.table, rep).await } } -impl wasi::io::streams::HostOutputStream for WasiImpl -where - T: WasiView, -{ +impl wasi::io::streams::HostOutputStream for WasiCtxView<'_> { fn check_write( &mut self, self_: Resource, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::check_write(&mut self.0, self_); + let result = latest::io::streams::HostOutputStream::check_write(self.table, self_); convert_stream_result(self, result) } @@ -679,7 +643,7 @@ where self_: Resource, contents: Vec, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::write(&mut self.0, self_, contents); + let result = latest::io::streams::HostOutputStream::write(self.table, self_, contents); convert_stream_result(self, result) } @@ -689,9 +653,7 @@ where contents: Vec, ) -> wasmtime::Result> { let result = latest::io::streams::HostOutputStream::blocking_write_and_flush( - &mut self.0, - self_, - contents, + self.table, self_, contents, ) .await; convert_stream_result(self, result) @@ -701,7 +663,7 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::flush(&mut self.0, self_); + let result = latest::io::streams::HostOutputStream::flush(self.table, self_); convert_stream_result(self, result) } @@ -709,13 +671,12 @@ where &mut self, self_: Resource, ) -> wasmtime::Result> { - let result = - latest::io::streams::HostOutputStream::blocking_flush(&mut self.0, self_).await; + let result = latest::io::streams::HostOutputStream::blocking_flush(self.table, self_).await; convert_stream_result(self, result) } fn subscribe(&mut self, self_: Resource) -> wasmtime::Result> { - latest::io::streams::HostOutputStream::subscribe(&mut self.0, self_) + latest::io::streams::HostOutputStream::subscribe(self.table, self_) } fn write_zeroes( @@ -723,7 +684,7 @@ where self_: Resource, len: u64, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::write_zeroes(&mut self.0, self_, len); + let result = latest::io::streams::HostOutputStream::write_zeroes(self.table, self_, len); convert_stream_result(self, result) } @@ -733,9 +694,7 @@ where len: u64, ) -> wasmtime::Result> { let result = latest::io::streams::HostOutputStream::blocking_write_zeroes_and_flush( - &mut self.0, - self_, - len, + self.table, self_, len, ) .await; convert_stream_result(self, result) @@ -747,7 +706,7 @@ where src: Resource, len: u64, ) -> wasmtime::Result> { - let result = latest::io::streams::HostOutputStream::splice(&mut self.0, self_, src, len); + let result = latest::io::streams::HostOutputStream::splice(self.table, self_, src, len); convert_stream_result(self, result) } @@ -758,64 +717,49 @@ where len: u64, ) -> wasmtime::Result> { let result = - latest::io::streams::HostOutputStream::blocking_splice(&mut self.0, self_, src, len) + latest::io::streams::HostOutputStream::blocking_splice(self.table, self_, src, len) .await; convert_stream_result(self, result) } async fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { - latest::io::streams::HostOutputStream::drop(&mut self.0, rep).await + latest::io::streams::HostOutputStream::drop(self.table, rep).await } } -impl wasi::random::random::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::random::random::Host for WasiCtxView<'_> { fn get_random_bytes(&mut self, len: u64) -> wasmtime::Result> { - latest::random::random::Host::get_random_bytes(self, len) + latest::random::random::Host::get_random_bytes(self.ctx.random(), len) } fn get_random_u64(&mut self) -> wasmtime::Result { - latest::random::random::Host::get_random_u64(self) + latest::random::random::Host::get_random_u64(self.ctx.random()) } } -impl wasi::random::insecure::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::random::insecure::Host for WasiCtxView<'_> { fn get_insecure_random_bytes(&mut self, len: u64) -> wasmtime::Result> { - latest::random::insecure::Host::get_insecure_random_bytes(self, len) + latest::random::insecure::Host::get_insecure_random_bytes(self.ctx.random(), len) } fn get_insecure_random_u64(&mut self) -> wasmtime::Result { - latest::random::insecure::Host::get_insecure_random_u64(self) + latest::random::insecure::Host::get_insecure_random_u64(self.ctx.random()) } } -impl wasi::random::insecure_seed::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::random::insecure_seed::Host for WasiCtxView<'_> { fn insecure_seed(&mut self) -> wasmtime::Result<(u64, u64)> { - latest::random::insecure_seed::Host::insecure_seed(self) + latest::random::insecure_seed::Host::insecure_seed(self.ctx.random()) } } -impl wasi::cli::exit::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::exit::Host for WasiCtxView<'_> { fn exit(&mut self, status: Result<(), ()>) -> wasmtime::Result<()> { latest::cli::exit::Host::exit(self, status) } } -impl wasi::cli::environment::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::environment::Host for WasiCtxView<'_> { fn get_environment(&mut self) -> wasmtime::Result> { latest::cli::environment::Host::get_environment(self) } @@ -829,88 +773,61 @@ where } } -impl wasi::cli::stdin::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::stdin::Host for WasiCtxView<'_> { fn get_stdin(&mut self) -> wasmtime::Result> { latest::cli::stdin::Host::get_stdin(self) } } -impl wasi::cli::stdout::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::stdout::Host for WasiCtxView<'_> { fn get_stdout(&mut self) -> wasmtime::Result> { latest::cli::stdout::Host::get_stdout(self) } } -impl wasi::cli::stderr::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::stderr::Host for WasiCtxView<'_> { fn get_stderr(&mut self) -> wasmtime::Result> { latest::cli::stderr::Host::get_stderr(self) } } -impl wasi::cli::terminal_stdin::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_stdin::Host for WasiCtxView<'_> { fn get_terminal_stdin(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdin::Host::get_terminal_stdin(self) } } -impl wasi::cli::terminal_stdout::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_stdout::Host for WasiCtxView<'_> { fn get_terminal_stdout(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdout::Host::get_terminal_stdout(self) } } -impl wasi::cli::terminal_stderr::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_stderr::Host for WasiCtxView<'_> { fn get_terminal_stderr(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stderr::Host::get_terminal_stderr(self) } } -impl wasi::cli::terminal_input::Host for WasiImpl where T: WasiView {} +impl wasi::cli::terminal_input::Host for WasiCtxView<'_> {} -impl wasi::cli::terminal_input::HostTerminalInput for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_input::HostTerminalInput for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_input::HostTerminalInput::drop(self, rep) } } -impl wasi::cli::terminal_output::Host for WasiImpl where T: WasiView {} +impl wasi::cli::terminal_output::Host for WasiCtxView<'_> {} -impl wasi::cli::terminal_output::HostTerminalOutput for WasiImpl -where - T: WasiView, -{ +impl wasi::cli::terminal_output::HostTerminalOutput for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_output::HostTerminalOutput::drop(self, rep) } } -impl wasi::sockets::tcp::Host for WasiImpl where T: WasiView {} +impl wasi::sockets::tcp::Host for WasiCtxView<'_> {} -impl wasi::sockets::tcp::HostTcpSocket for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::tcp::HostTcpSocket for WasiCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1201,10 +1118,7 @@ where } } -impl wasi::sockets::tcp_create_socket::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::tcp_create_socket::Host for WasiCtxView<'_> { fn create_tcp_socket( &mut self, address_family: IpAddressFamily, @@ -1216,12 +1130,9 @@ where } } -impl wasi::sockets::udp::Host for WasiImpl where T: WasiView {} +impl wasi::sockets::udp::Host for WasiCtxView<'_> {} -impl wasi::sockets::udp::HostUdpSocket for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::udp::HostUdpSocket for WasiCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1374,10 +1285,7 @@ where } } -impl wasi::sockets::udp::HostOutgoingDatagramStream for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::udp::HostOutgoingDatagramStream for WasiCtxView<'_> { fn check_send( &mut self, self_: Resource, @@ -1412,10 +1320,7 @@ where } } -impl wasi::sockets::udp::HostIncomingDatagramStream for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::udp::HostIncomingDatagramStream for WasiCtxView<'_> { fn receive( &mut self, self_: Resource, @@ -1441,10 +1346,7 @@ where } } -impl wasi::sockets::udp_create_socket::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::udp_create_socket::Host for WasiCtxView<'_> { fn create_udp_socket( &mut self, address_family: IpAddressFamily, @@ -1456,30 +1358,21 @@ where } } -impl wasi::sockets::instance_network::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::instance_network::Host for WasiCtxView<'_> { fn instance_network(&mut self) -> wasmtime::Result> { latest::sockets::instance_network::Host::instance_network(self) } } -impl wasi::sockets::network::Host for WasiImpl where T: WasiView {} +impl wasi::sockets::network::Host for WasiCtxView<'_> {} -impl wasi::sockets::network::HostNetwork for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::network::HostNetwork for WasiCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::sockets::network::HostNetwork::drop(self, rep) } } -impl wasi::sockets::ip_name_lookup::Host for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::ip_name_lookup::Host for WasiCtxView<'_> { fn resolve_addresses( &mut self, network: Resource, @@ -1491,10 +1384,7 @@ where } } -impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiImpl -where - T: WasiView, -{ +impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiCtxView<'_> { fn resolve_next_address( &mut self, self_: Resource, diff --git a/crates/trigger-http/src/wasi.rs b/crates/trigger-http/src/wasi.rs index d64dde9965..2a38d6d664 100644 --- a/crates/trigger-http/src/wasi.rs +++ b/crates/trigger-http/src/wasi.rs @@ -12,7 +12,6 @@ use spin_http::routes::RouteMatch; use spin_http::trigger::HandlerType; use tokio::{sync::oneshot, task}; use tracing::{instrument, Instrument, Level}; -use wasmtime_wasi::p2::IoView; use wasmtime_wasi_http::bindings::http::types::Scheme; use wasmtime_wasi_http::{bindings::Proxy, body::HyperIncomingBody as Body, WasiHttpView}; diff --git a/crates/world/src/lib.rs b/crates/world/src/lib.rs index cbc2283aba..5c3a8f504d 100644 --- a/crates/world/src/lib.rs +++ b/crates/world/src/lib.rs @@ -16,7 +16,8 @@ wasmtime::component::bindgen!({ } "#, path: "../../wit", - async: true, + imports: { default: async | trappable }, + exports: { default: async }, // The following is a roundabout way of saying "the host implementations for these interfaces don't trap" trappable_error_type: { "fermyon:spin/config/error" => v1::config::Error, @@ -39,7 +40,6 @@ wasmtime::component::bindgen!({ "wasi:keyvalue/store/error" => wasi::keyvalue::store::Error, "wasi:keyvalue/atomics/cas-error" => wasi::keyvalue::atomics::CasError, }, - trappable_imports: true, }); pub use fermyon::spin as v1; diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index 1b49bfa064..f6db5d5a99 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -8,7 +8,16 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli 0.31.1", +] + +[[package]] +name = "addr2line" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9acbfca36652500c911ddb767ed433e3ed99b032b5d935be73c6923662db1d43" +dependencies = [ + "gimli 0.32.0", ] [[package]] @@ -784,11 +793,11 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.7", "rustc-demangle", "windows-targets 0.52.6", ] @@ -1190,36 +1199,36 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae7b60ec3fd7162427d3b3801520a1908bef7c035b52983cd3ca11b8e7deb51" +checksum = "3870e823d79cafc9c868fbea77e83fc12ec9c0e87f17ad392c71a55ec01f12a9" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6511c200fed36452697b4b6b161eae57d917a2044e6333b1c1389ed63ccadeee" +checksum = "0a9fe971fab18724cbfc9a0579dd9cb6e370891991ccc8f85f3390d81392a3c0" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7086a645aa58bae979312f64e3029ac760ac1b577f5cd2417844842a2ca07f" +checksum = "ac391df81890fc9f820461e76fb344bcebcbf72614ef99bdd03d9fb1a8cdcc5e" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5225b4dec45f3f3dbf383f12560fac5ce8d780f399893607e21406e12e77f491" +checksum = "712de3ed567438f3ca42d12547dbf30d92aef37d63ae45eabe32dd53c4ee5d00" dependencies = [ "serde", "serde_derive", @@ -1227,9 +1236,9 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "858fb3331e53492a95979378d6df5208dd1d0d315f19c052be8115f4efc888e0" +checksum = "68e6fc48d06ef89c1ad3675fe093f2642d260eea8ceb96a9ee9ae94e51698277" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -1240,7 +1249,7 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli", + "gimli 0.32.0", "hashbrown 0.15.2", "log", "pulley-interpreter", @@ -1254,36 +1263,37 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456715b9d5f12398f156d5081096e7b5d039f01b9ecc49790a011c8e43e65b5f" +checksum = "a45a98cfcd528bd06c6ef2fd1846cda3695d41bd4b2823ce965a82f4abec362f" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", "cranelift-srcgen", + "heck 0.5.0", "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0306041099499833f167a0ddb707e1e54100f1a84eab5631bc3dad249708f482" +checksum = "66b12b2fef743dffdb51a5cdb95f5f92ab263ed518a7ec73aa272a4a86ea17bf" [[package]] name = "cranelift-control" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1672945e1f9afc2297f49c92623f5eabc64398e2cb0d824f8f72a2db2df5af23" +checksum = "5dc203df5ac23968c8ded672b6c4b6dbc0639521e50b8d27ac67c2e221f3c98b" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa3cd55eb5f3825b9ae5de1530887907360a6334caccdc124c52f6d75246c98a" +checksum = "2d01c5dca220ed9c664a4c0cf2085aa0bebaddc306be365bdd2691d4a55dd2ae" dependencies = [ "cranelift-bitset", "serde", @@ -1292,9 +1302,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781f9905f8139b8de22987b66b522b416fe63eb76d823f0b3a8c02c8fd9500c7" +checksum = "ecd02bd4641b10658668bf195ef92af0ecffa49a8a563de8e98f0c2d843a229d" dependencies = [ "cranelift-codegen", "log", @@ -1304,15 +1314,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05337a2b02c3df00b4dd9a263a027a07b3dff49f61f7da3b5d195c21eaa633d" +checksum = "51da2281ea3db0b1f6029b4321acf541ef856baafdf16e990d64953c9737bc3f" [[package]] name = "cranelift-native" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eee7a496dd66380082c9c5b6f2d5fa149cec0ec383feec5caf079ca2b3671c2" +checksum = "ff037ce35e9d513dcf64e9f613ec4816cb7b0b1b0b4e23788745f2200d278fec" dependencies = [ "cranelift-codegen", "libc", @@ -1321,9 +1331,9 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b530783809a55cb68d070e0de60cfbb3db0dc94c8850dd5725411422bedcf6bb" +checksum = "d13dc01a8588b7f7733de0c31b766d85cac04aec078897cde706cebd891f8212" [[package]] name = "crc32fast" @@ -1568,7 +1578,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.0", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -2005,6 +2015,12 @@ name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "gimli" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93563d740bc9ef04104f9ed6f86f1e3275c2cdafb95664e26584b9ca807a8ffe" dependencies = [ "fallible-iterator 0.3.0", "indexmap 2.9.0", @@ -3137,6 +3153,15 @@ name = "object" version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "crc32fast", "hashbrown 0.15.2", @@ -3675,9 +3700,9 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89c4319786b16c1a6a38ee04788d32c669b61ba4b69da2162c868c18be99c1b" +checksum = "9c53c41637e4052ec0010b923a3ffc99a124f2b6f19062147eae6458904d3e46" dependencies = [ "cranelift-bitset", "log", @@ -3687,9 +3712,9 @@ dependencies = [ [[package]] name = "pulley-macros" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938543690519c20c3a480d20a8efcc8e69abeb44093ab1df4e7c1f81f26c677a" +checksum = "aed513b785fd6b142c6708c29990d92475971df8370b018c2c236dfd1c47b77d" dependencies = [ "proc-macro2", "quote", @@ -4763,9 +4788,9 @@ version = "3.4.0-pre0" dependencies = [ "anyhow", "tracing", - "wasm-encoder 0.235.0", - "wasm-metadata 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasm-metadata 0.236.1", + "wasmparser 0.236.1", "wit-component", "wit-parser", ] @@ -5989,17 +6014,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trait-variant" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "trigger-timer" version = "0.1.0" @@ -6181,9 +6195,9 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" [[package]] name = "wac-graph" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94268a683b67ae20210565b5f91e106fe05034c36b931e739fe90377ed80b98" +checksum = "0d94f428d894714ffba71621dd5fde3b5a52feb6a0ec96aded6207f85057dffc" dependencies = [ "anyhow", "id-arena", @@ -6193,23 +6207,23 @@ dependencies = [ "semver", "thiserror 1.0.69", "wac-types", - "wasm-encoder 0.202.0", - "wasm-metadata 0.202.0", - "wasmparser 0.202.0", + "wasm-encoder 0.235.0", + "wasm-metadata 0.235.0", + "wasmparser 0.235.0", ] [[package]] name = "wac-types" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5028a15e266f4c8fed48beb95aebb76af5232dcd554fd849a305a4e5cce1563" +checksum = "6690e903d48e7258ea5e623c3269452c81ce1c9bfa8ffcb9c8909d77861fff6a" dependencies = [ "anyhow", "id-arena", "indexmap 2.9.0", "semver", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", ] [[package]] @@ -6327,44 +6341,48 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.202.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" dependencies = [ - "leb128", + "leb128fmt", + "wasmparser 0.235.0", ] [[package]] name = "wasm-encoder" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" +checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" dependencies = [ "leb128fmt", - "wasmparser 0.235.0", + "wasmparser 0.236.1", ] [[package]] name = "wasm-metadata" -version = "0.202.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "094aea3cb90e09f16ee25a4c0e324b3e8c934e7fd838bfa039aef5352f44a917" +checksum = "b055604ba04189d54b8c0ab2c2fc98848f208e103882d5c0b984f045d5ea4d20" dependencies = [ "anyhow", + "auditable-serde", + "flate2", "indexmap 2.9.0", "serde", "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "url", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", ] [[package]] name = "wasm-metadata" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b055604ba04189d54b8c0ab2c2fc98848f208e103882d5c0b984f045d5ea4d20" +checksum = "c909f94a49a8de3365f3c0344f064818f1e369ff1740c5b04f455f85d454768e" dependencies = [ "anyhow", "auditable-serde", @@ -6375,8 +6393,8 @@ dependencies = [ "serde_json", "spdx", "url", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", ] [[package]] @@ -6411,20 +6429,22 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.202.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ "bitflags 2.9.0", + "hashbrown 0.15.2", "indexmap 2.9.0", "semver", + "serde", ] [[package]] name = "wasmparser" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" +checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" dependencies = [ "bitflags 2.9.0", "hashbrown 0.15.2", @@ -6435,22 +6455,22 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75aa8e9076de6b9544e6dab4badada518cca0bf4966d35b131bbd057aed8fa0a" +checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.235.0", + "wasmparser 0.236.1", ] [[package]] name = "wasmtime" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe976922a16af3b0d67172c473d1fd4f1aa5d0af9c8ba6538c741f3af686f4" +checksum = "72eb410993c268be048b7745a49649e3390348b0fe9ee050253a74a79192574f" dependencies = [ - "addr2line", + "addr2line 0.25.0", "anyhow", "async-trait", "bitflags 2.9.0", @@ -6459,7 +6479,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "gimli", + "gimli 0.32.0", "hashbrown 0.15.2", "indexmap 2.9.0", "ittapi", @@ -6467,7 +6487,7 @@ dependencies = [ "log", "mach2", "memfd", - "object", + "object 0.37.3", "once_cell", "postcard", "pulley-interpreter", @@ -6479,9 +6499,8 @@ dependencies = [ "serde_json", "smallvec", "target-lexicon", - "trait-variant", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-asm-macros", "wasmtime-internal-cache", @@ -6497,23 +6516,23 @@ dependencies = [ "wasmtime-internal-versioned-export-macros", "wasmtime-internal-winch", "wat", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-environ" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b6264a78d806924abbc76bbc75eac24976bc83bdfb938e5074ae551242436f" +checksum = "88d3047dfcd4c0eeb2dbd9d639dd4eef65cbe53f17211c549543f208466246ed" dependencies = [ "anyhow", "cpp_demangle", "cranelift-bitset", "cranelift-entity", - "gimli", + "gimli 0.32.0", "indexmap 2.9.0", "log", - "object", + "object 0.37.3", "postcard", "rustc-demangle", "semver", @@ -6521,26 +6540,26 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", "wasmprinter", "wasmtime-internal-component-util", ] [[package]] name = "wasmtime-internal-asm-macros" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6775a9b516559716e5710e95a8014ca0adcc81e5bf4d3ad7899d89ae40094d1a" +checksum = "82c3ac22f7209c35a913b4423a9f83fc12b74239af3cb5ac6c39a5df34e1970b" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-internal-cache" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e33ad4bd120f3b1c77d6d0dcdce0de8239555495befcda89393a40ba5e324" +checksum = "dbd49572a149c84a28079a0fb06f2c67c6290e75405f71855e943e4bb4703ae0" dependencies = [ "anyhow", "base64 0.22.1", @@ -6552,15 +6571,15 @@ dependencies = [ "serde_derive", "sha2", "toml", - "windows-sys 0.59.0", + "windows-sys 0.60.2", "zstd", ] [[package]] name = "wasmtime-internal-component-macro" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc3d098205e405e6b5ced06c1815621b823464b6ea289eaafe494139b0aee287" +checksum = "0badcd2acaa2901910a2ec0815abd24b80ffeecb5683029082e26220be2b44c5" dependencies = [ "anyhow", "proc-macro2", @@ -6573,15 +6592,15 @@ dependencies = [ [[package]] name = "wasmtime-internal-component-util" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219252067216242ed2b32665611b0ee356d6e92cbb897ecb9a10cae0b97bdeca" +checksum = "399a9f4d25c0dcf4829751cbb63de438f3b715abc49277c15c86460539f4a7e7" [[package]] name = "wasmtime-internal-cranelift" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec9ad7565e6a8de7cb95484e230ff689db74a4a085219e0da0cbd637a29c01c" +checksum = "41370ede67231853b2f96a7f03b8e3db61802ad3ee0d7497b366f815e616f4fc" dependencies = [ "anyhow", "cfg-if", @@ -6590,15 +6609,15 @@ dependencies = [ "cranelift-entity", "cranelift-frontend", "cranelift-native", - "gimli", + "gimli 0.32.0", "itertools 0.14.0", "log", - "object", + "object 0.37.3", "pulley-interpreter", "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.235.0", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-math", "wasmtime-internal-versioned-export-macros", @@ -6606,9 +6625,9 @@ dependencies = [ [[package]] name = "wasmtime-internal-fiber" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b636ff8b220ebaf29dfe3b23770e4b2bad317b9683e3bf7345e162387385b39" +checksum = "6baf30fe62eb18fdc83395011ebd32dd74af3e86cecffb74dec05d8af2243515" dependencies = [ "anyhow", "cc", @@ -6617,66 +6636,66 @@ dependencies = [ "rustix 1.0.5", "wasmtime-internal-asm-macros", "wasmtime-internal-versioned-export-macros", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-internal-jit-debug" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61d8693995ab3df48e88777b6ee3b2f441f2c4f895ab938996cdac3db26f256c" +checksum = "416e2d2193073fe65355315bd144a9a26cbdf1f0c27faa7fdd3266a09b2689d3" dependencies = [ "cc", - "object", + "object 0.37.3", "rustix 1.0.5", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4417e06b7f80baff87d9770852c757a39b8d7f11d78b2620ca992b8725f16f50" +checksum = "b787315e8acb988ce5da8439ce827f84a01b912d3b157aafe0ddd8779fef219e" dependencies = [ "anyhow", "cfg-if", "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-internal-math" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7710d5c4ecdaa772927fd11e5dc30a9a62d1fc8fe933e11ad5576ad596ab6612" +checksum = "08d8b81a4083aa76d3cd3ebf24f0564b6d17d4faffd47c42dd218798aa5894d4" dependencies = [ "libm", ] [[package]] name = "wasmtime-internal-slab" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ab22fabe1eed27ab01fd47cd89deacf43ad222ed7fd169ba6f4dd1fbddc53b" +checksum = "8e701cdea321a3c288990dcc1ed7b4c89d120e10bf50052e942243251e710c42" [[package]] name = "wasmtime-internal-unwinder" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307708f302f5dcf19c1bbbfb3d9f2cbc837dd18088a7988747b043a46ba38ecc" +checksum = "60ddcc1b024ae8e16f043b0dbea676048f3b710efbaa63f2647bc287315b8704" dependencies = [ "anyhow", "cfg-if", "cranelift-codegen", "log", - "object", + "object 0.37.3", ] [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342b0466f92b7217a4de9e114175fedee1907028567d2548bcd42f71a8b5b016" +checksum = "e4bd56c30d60d617935d1a68272223341b67c27fb3776fee025e481f3ac53cd0" dependencies = [ "proc-macro2", "quote", @@ -6685,16 +6704,16 @@ dependencies = [ [[package]] name = "wasmtime-internal-winch" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2012e7384c25b91aab2f1b6a1e1cbab9d0f199bbea06cc873597a3f047f05730" +checksum = "e9a56b31bc1c5b6a62cb400e996947944a3a0545dc8e11790964074269876137" dependencies = [ "anyhow", "cranelift-codegen", - "gimli", - "object", + "gimli 0.32.0", + "object 0.37.3", "target-lexicon", - "wasmparser 0.235.0", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-cranelift", "winch-codegen", @@ -6702,11 +6721,12 @@ dependencies = [ [[package]] name = "wasmtime-internal-wit-bindgen" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae057d44a5b60e6ec529b0c21809a9d1fc92e91ef6e0f6771ed11dd02a94a08" +checksum = "8c9816c753aaa5591c45f3ccfb9f2ecf9ea9bbffabc1ad628818803bd12e34ba" dependencies = [ "anyhow", + "bitflags 2.9.0", "heck 0.5.0", "indexmap 2.9.0", "wit-parser", @@ -6714,9 +6734,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d252bc54438b6b979320dc48fe8328429761aaef62cee12a848b0389b1f255c" +checksum = "c43f4163d631ecb72245b34aae03f5a0b07e58c2004692b4258caf8bf7aacca5" dependencies = [ "anyhow", "async-trait", @@ -6740,14 +6760,14 @@ dependencies = [ "wasmtime", "wasmtime-wasi-io", "wiggle", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "wasmtime-wasi-http" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de4cddef458af6d8efac0b03df4bae4446d90db007999da76b789ddb921f98" +checksum = "9a9730c0a3f24c25a8fa40fecbd4a1a3e77dff5bb730d98e16861c9dfcc2ca33" dependencies = [ "anyhow", "async-trait", @@ -6769,9 +6789,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi-io" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2664b7dabe650a102559ae49108fb00f884f319aadefcf20806ab5f2dbd535" +checksum = "a6a1700b7b7a2b9b704ed9501745798e3791f575ee6973d7d821e2386a94adbf" dependencies = [ "anyhow", "async-trait", @@ -6791,24 +6811,24 @@ dependencies = [ [[package]] name = "wast" -version = "235.0.0" +version = "236.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13" +checksum = "d3bec4b4db9c6808d394632fd4b0cd4654c32c540bd3237f55ee6a40fff6e51f" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width", - "wasm-encoder 0.235.0", + "wasm-encoder 0.236.1", ] [[package]] name = "wat" -version = "1.235.0" +version = "1.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa" +checksum = "64475e2f77d6071ce90624098fc236285ddafa8c3ea1fb386f2c4154b6c2bbdb" dependencies = [ - "wast 235.0.0", + "wast 236.0.1", ] [[package]] @@ -6853,9 +6873,9 @@ dependencies = [ [[package]] name = "wiggle" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3ea480ce117a35b61e466e4f77422f2b29f744400e05de3ad87d73b8a1877c" +checksum = "0047009d1851c65dfeb197ff53a1d1bf94358d56604ac5e9419397ba381bfa17" dependencies = [ "anyhow", "async-trait", @@ -6868,9 +6888,9 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec945b902cacd960fe5d441b60146b24639d81b887451a30bf86824a8185d79" +checksum = "af67f0f2a0e2e7841e9a561aff21cec8f6125b5b8d2c43adecc974e36e9cbbd9" dependencies = [ "anyhow", "heck 0.5.0", @@ -6882,9 +6902,9 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5872fbe512b73acd514e7ef5bd5aee0ff951a12c1fed0293e1f7992de30df9f" +checksum = "c6f1ed189ba5962988a017f86bc73b03cc69e1b8d3040922beab307855ce594d" dependencies = [ "proc-macro2", "quote", @@ -6925,19 +6945,19 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "35.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839a334ef7c62d8368dbd427e767a6fbb1ba08cc12ecce19cbb666c10613b585" +checksum = "88ac81262abfb835f3f46f64715863fa2737c2928fab58db74ec98710e3e261a" dependencies = [ "anyhow", "cranelift-assembler-x64", "cranelift-codegen", - "gimli", + "gimli 0.32.0", "regalloc2", "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.235.0", + "wasmparser 0.236.1", "wasmtime-environ", "wasmtime-internal-cranelift", "wasmtime-internal-math", @@ -7012,9 +7032,9 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-numerics" @@ -7034,7 +7054,7 @@ checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ "windows-result", "windows-strings 0.3.1", - "windows-targets 0.53.0", + "windows-targets 0.53.3", ] [[package]] @@ -7082,6 +7102,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -7100,10 +7129,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.0" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ + "windows-link", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -7240,9 +7270,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a57a11109cc553396f89f3a38a158a97d0b1adaec113bd73e0f64d30fb601f" +checksum = "3622959ed7ed6341c38e5aa35af243632534b0a36226852faa802939ce11e00f" dependencies = [ "anyhow", "bitflags 2.9.0", @@ -7251,17 +7281,17 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.235.0", - "wasm-metadata 0.235.0", - "wasmparser 0.235.0", + "wasm-encoder 0.236.1", + "wasm-metadata 0.236.1", + "wasmparser 0.236.1", "wit-parser", ] [[package]] name = "wit-parser" -version = "0.235.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1f95a87d03a33e259af286b857a95911eb46236a0f726cbaec1227b3dfc67a" +checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15" dependencies = [ "anyhow", "id-arena", @@ -7272,7 +7302,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.235.0", + "wasmparser 0.236.1", ] [[package]] diff --git a/examples/spin-timer/Cargo.toml b/examples/spin-timer/Cargo.toml index 510b2456f7..80eafe0552 100644 --- a/examples/spin-timer/Cargo.toml +++ b/examples/spin-timer/Cargo.toml @@ -13,6 +13,6 @@ spin-runtime-factors = { path = "../../crates/runtime-factors" } spin-trigger = { path = "../../crates/trigger" } tokio = { version = "1", features = ["full"] } tokio-scoped = "0.2.0" -wasmtime = "35.0.0" +wasmtime = "36.0.1" [workspace] diff --git a/examples/spin-timer/src/lib.rs b/examples/spin-timer/src/lib.rs index ae18f9e30e..6aedc921e9 100644 --- a/examples/spin-timer/src/lib.rs +++ b/examples/spin-timer/src/lib.rs @@ -8,7 +8,8 @@ use spin_trigger::{App, Trigger, TriggerApp}; wasmtime::component::bindgen!({ path: ".", world: "spin-timer", - async: true + imports: { default: async }, + exports: { default: async }, }); #[derive(Args)]