diff --git a/Cargo.lock b/Cargo.lock index af70269..1bac962 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -208,12 +208,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -323,9 +317,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cap-fs-ext" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f78efdd7378980d79c0f36b519e51191742d2c9f91ffa5e228fba9f3806d2e1" +checksum = "e41cc18551193fe8fa6f15c1e3c799bc5ec9e2cfbfaa8ed46f37013e3e6c173c" dependencies = [ "cap-primitives", "cap-std", @@ -335,21 +329,21 @@ dependencies = [ [[package]] name = "cap-net-ext" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac68674a6042af2bcee1adad9f6abd432642cf03444ce3a5b36c3f39f23baf8" +checksum = "9f83833816c66c986e913b22ac887cec216ea09301802054316fc5301809702c" dependencies = [ "cap-primitives", "cap-std", - "rustix", + "rustix 1.0.7", "smallvec", ] [[package]] name = "cap-primitives" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc15faeed2223d8b8e8cc1857f5861935a06d06713c4ac106b722ae9ce3c369" +checksum = "0a1e394ed14f39f8bc26f59d4c0c010dbe7f0a1b9bafff451b1f98b67c8af62a" dependencies = [ "ambient-authority", "fs-set-times", @@ -357,16 +351,17 @@ dependencies = [ "io-lifetimes", "ipnet", "maybe-owned", - "rustix", + "rustix 1.0.7", + "rustix-linux-procfs", "windows-sys 0.59.0", "winx", ] [[package]] name = "cap-rand" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea13372b49df066d1ae654e5c6e41799c1efd9f6b36794b921e877ea4037977" +checksum = "0acb89ccf798a28683f00089d0630dfaceec087234eae0d308c05ddeaa941b40" dependencies = [ "ambient-authority", "rand", @@ -374,27 +369,27 @@ dependencies = [ [[package]] name = "cap-std" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3dbd3e8e8d093d6ccb4b512264869e1281cdb032f7940bd50b2894f96f25609" +checksum = "07c0355ca583dd58f176c3c12489d684163861ede3c9efa6fd8bba314c984189" dependencies = [ "cap-primitives", "io-extras", "io-lifetimes", - "rustix", + "rustix 1.0.7", ] [[package]] name = "cap-time-ext" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd736b20fc033f564a1995fb82fc349146de43aabba19c7368b4cb17d8f9ea53" +checksum = "491af520b8770085daa0466978c75db90368c71896523f2464214e38359b1a5b" dependencies = [ "ambient-authority", "cap-primitives", "iana-time-zone", "once_cell", - "rustix", + "rustix 1.0.7", "winx", ] @@ -468,16 +463,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] -name = "component-init" +name = "component-init-transform" version = "0.1.0" -source = "git+https://github.com/dicej/component-init?rev=2db53ece#2db53ecea9b398849bbb8cde5469aebd6be22c0d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602204303fafe3d9582c7b6f80d8ec594ff7ee033ee584f29b269ee698fc198c" dependencies = [ "anyhow", "async-trait", "futures", - "wasm-convert", - "wasm-encoder 0.227.1", - "wasmparser 0.227.1", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", ] [[package]] @@ -491,7 +486,7 @@ dependencies = [ "bytes", "cap-std", "clap", - "component-init", + "component-init-transform", "componentize-py-shared", "flate2", "fs_extra", @@ -513,14 +508,12 @@ dependencies = [ "test-generator", "tokio", "toml", - "wasi-common", - "wasm-convert", - "wasm-encoder 0.227.1", - "wasmparser 0.227.1", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", "wasmtime", "wasmtime-wasi", - "wit-component", - "wit-parser 0.227.1", + "wit-component 0.235.0", + "wit-parser 0.235.0", "zstd", ] @@ -577,33 +570,36 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b83fcf2fc1c8954561490d02079b496fd0c757da88129981e15bfe3a548229" +checksum = "226b7077389885873ffad5d778e8512742580a6e11b0f723072f41f305d3652f" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7496a6e92b5cee48c5d772b0443df58816dee30fed6ba19b2a28e78037ecedf" +checksum = "e9cfeae5a23c8cf9c43381f49211f3ce6dc1da1d46f1c5d06966e6258cc483fa" +dependencies = [ + "cranelift-srcgen", +] [[package]] name = "cranelift-bforest" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a9dc0a8d3d49ee772101924968830f1c1937d650c571d3c2dd69dc36a68f41" +checksum = "8c88c577c6af92b550cb83455c331cf8e1bc89fe0ccc3e7eb0fa617ed1d63056" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573c641174c40ef31021ae4a5a3ad78974e280633502d0dfc6e362385e0c100f" +checksum = "370f0aa7f1816bf0f838048d69b72d6cf12ef2fc3b37f6997fe494ffb9feb3ad" dependencies = [ "serde", "serde_derive", @@ -611,9 +607,9 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7c94d572615156f2db682181cadbd96342892c31e08cc26a757344319a9220" +checksum = "7d1a10a8a2958b68ecd261e565eef285249e242a8447ac959978319eabbb4a55" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -633,39 +629,41 @@ dependencies = [ "serde", "smallvec", "target-lexicon", + "wasmtime-math", ] [[package]] name = "cranelift-codegen-meta" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beecd9fcf2c3e06da436d565de61a42676097ea6eb6b4499346ac6264b6bb9ce" +checksum = "f319986d5ae1386cfec625c70f8c01e52dc1f910aa6aaee7740bf8842d4e19c7" dependencies = [ - "cranelift-assembler-x64", + "cranelift-assembler-x64-meta", "cranelift-codegen-shared", + "cranelift-srcgen", "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4ff8d2e1235f2d6e7fc3c6738be6954ba972cd295f09079ebffeca2f864e22" +checksum = "ed52f5660397039c3c741c3acf18746445f4e20629b7280d9f2ccfe57e2b1efd" [[package]] name = "cranelift-control" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001312e9fbc7d9ca9517474d6fe71e29d07e52997fd7efe18f19e8836446ceb2" +checksum = "79bde8d48e1840702574e28c5d7d4499441435af71e6c47450881f84ce2b60a5" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0fd6d4aae680275fcbceb08683416b744e65c8b607352043d3f0951d72b3b2" +checksum = "e0335ac187211ac94c254826b6e78d23b8654ae09ebf0830506a827a2647162f" dependencies = [ "cranelift-bitset", "serde", @@ -674,9 +672,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd44e7e5dcea20ca104d45894748205c51365ce4cdb18f4418e3ba955971d1b" +checksum = "f4fce5fcf93c1fece95d0175b15fbaf0808b187430bc06c8ecde80db0ed58c5e" dependencies = [ "cranelift-codegen", "log", @@ -686,21 +684,27 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f900e0a3847d51eed0321f0777947fb852ccfce0da7fb070100357f69a2f37fc" +checksum = "13fc8d838a2bf28438dbaf6ccdbc34531b6a972054f43fd23be7f124121ce6e0" [[package]] name = "cranelift-native" -version = "0.117.2" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7617f13f392ebb63c5126258aca8b8eca739636ca7e4eeee301d3eff68489a6a" +checksum = "0975ce66adcf2e0729d06b1d3efea0398d793d1f39c2e0a6f52a347537836693" dependencies = [ "cranelift-codegen", "libc", "target-lexicon", ] +[[package]] +name = "cranelift-srcgen" +version = "0.121.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4493a9b500bb02837ea2fb7d4b58c1c21c37a470ae33c92659f4e637aad14c9" + [[package]] name = "crc32fast" version = "1.4.2" @@ -780,26 +784,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -892,7 +876,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix", + "rustix 0.38.44", "windows-sys 0.52.0", ] @@ -970,7 +954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ "io-lifetimes", - "rustix", + "rustix 0.38.44", "windows-sys 0.52.0", ] @@ -1406,9 +1390,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1505,6 +1489,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "log" version = "0.4.22" @@ -1538,7 +1528,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix", + "rustix 0.38.44", ] [[package]] @@ -1691,12 +1681,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -1838,15 +1822,27 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0ecb9823083f71df8735f21f6c44f2f2b55986d674802831df20f27e26c907" +checksum = "fe0e8f39bc99694ce6fc8df7df7ed258d38d255a9268e2ff964f67f4a6588cdb" dependencies = [ "cranelift-bitset", "log", + "pulley-macros", "wasmtime-math", ] +[[package]] +name = "pulley-macros" +version = "34.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9276d404009cc49f3b8befeb8ffc1d868c5ea732bd9d72ab3e64231187f908c5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pyo3" version = "0.25.0" @@ -2005,14 +2001,14 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.65", ] [[package]] name = "regalloc2" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145c1c267e14f20fb0f88aa76a1c5ffec42d592c1d28b3cd9148ae35916158d3" +checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" dependencies = [ "allocator-api2", "bumpalo", @@ -2058,7 +2054,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" dependencies = [ "async-compression", - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-channel", @@ -2132,13 +2128,34 @@ checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags", "errno", - "itoa", "libc", - "linux-raw-sys", - "once_cell", + "linux-raw-sys 0.4.14", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] +[[package]] +name = "rustix-linux-procfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056" +dependencies = [ + "once_cell", + "rustix 1.0.7", +] + [[package]] name = "rustls" version = "0.23.26" @@ -2307,15 +2324,6 @@ dependencies = [ "digest", ] -[[package]] -name = "shellexpand" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" -dependencies = [ - "dirs", -] - [[package]] name = "shlex" version = "1.3.0" @@ -2369,12 +2377,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "sptr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2445,7 +2447,7 @@ dependencies = [ "cap-std", "fd-lock", "io-lifetimes", - "rustix", + "rustix 0.38.44", "windows-sys 0.52.0", "winx", ] @@ -2476,7 +2478,7 @@ dependencies = [ "cfg-if", "fastrand", "once_cell", - "rustix", + "rustix 0.38.44", "windows-sys 0.59.0", ] @@ -2511,7 +2513,16 @@ version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.65", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2525,6 +2536,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -2673,7 +2695,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2832,31 +2853,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasi-common" -version = "30.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd843e80e63252198c08122b0a5889e384f5b0a0c172f3436017bc27c1915" -dependencies = [ - "anyhow", - "bitflags", - "cap-fs-ext", - "cap-rand", - "cap-std", - "cap-time-ext", - "fs-set-times", - "io-extras", - "io-lifetimes", - "log", - "rustix", - "system-interface", - "thiserror", - "tracing", - "wasmtime", - "wiggle", - "windows-sys 0.59.0", -] - [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -2929,32 +2925,33 @@ dependencies = [ ] [[package]] -name = "wasm-convert" -version = "0.1.0" -source = "git+https://github.com/dicej/wasm-convert?rev=713e2d6a#713e2d6a724f33d94c2f3b88b759ad993608f12e" +name = "wasm-encoder" +version = "0.227.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bb72f02e7fbf07183443b27b0f3d4144abf8c114189f2e088ed95b696a7822" dependencies = [ - "wasm-encoder 0.227.1", + "leb128fmt", "wasmparser 0.227.1", ] [[package]] name = "wasm-encoder" -version = "0.224.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab7a13a23790fe91ea4eb7526a1f3131001d874e3e00c2976c48861f2e82920" +checksum = "9679ae3cf7cfa2ca3a327f7fab97f27f3294d402fd1a76ca8ab514e17973e4d3" dependencies = [ - "leb128", - "wasmparser 0.224.1", + "leb128fmt", + "wasmparser 0.233.0", ] [[package]] name = "wasm-encoder" -version = "0.227.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80bb72f02e7fbf07183443b27b0f3d4144abf8c114189f2e088ed95b696a7822" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" dependencies = [ "leb128fmt", - "wasmparser 0.227.1", + "wasmparser 0.235.0", ] [[package]] @@ -2976,11 +2973,35 @@ dependencies = [ "wasmparser 0.227.1", ] +[[package]] +name = "wasm-metadata" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b055604ba04189d54b8c0ab2c2fc98848f208e103882d5c0b984f045d5ea4d20" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", +] + [[package]] name = "wasmparser" -version = "0.224.1" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f17a5917c2ddd3819e84c661fae0d6ba29d7b9c1f0e96c708c65a9c4188e11" +checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2" +dependencies = [ + "bitflags", + "hashbrown", + "indexmap", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.233.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b51cb03afce7964bbfce46602d6cb358726f36430b6ba084ac6020d8ce5bc102" dependencies = [ "bitflags", "hashbrown", @@ -2991,9 +3012,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.227.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ "bitflags", "hashbrown", @@ -3004,20 +3025,20 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.224.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0095b53a3b09cbc2f90f789ea44aa1b17ecc2dad8b267e657c7391f3ded6293d" +checksum = "abf8e5b732895c99b21aa615f1b73352e51bbe2b2cb6c87eae7f990d07c1ac18" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.224.1", + "wasmparser 0.233.0", ] [[package]] name = "wasmtime" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809cc8780708f1deed0a7c3fcab46954f0e8c08a6fe0252772481fbc88fcf946" +checksum = "2523d3347356a74e9c312c2c96e709c82d998dcafdca97f6d620e69c032fd043" dependencies = [ "addr2line", "anyhow", @@ -3038,22 +3059,20 @@ dependencies = [ "memfd", "object", "once_cell", - "paste", "postcard", "psm", "pulley-interpreter", "rayon", - "rustix", + "rustix 1.0.7", "semver", "serde", "serde_derive", "serde_json", "smallvec", - "sptr", "target-lexicon", "trait-variant", - "wasm-encoder 0.224.1", - "wasmparser 0.224.1", + "wasm-encoder 0.233.0", + "wasmparser 0.233.0", "wasmtime-asm-macros", "wasmtime-cache", "wasmtime-component-macro", @@ -3073,25 +3092,25 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236964b6b35af0f08879c9c56dbfbc5adc12e8d624672341a0121df31adaa3fa" +checksum = "7c45ecc343d3ad4629d5882e94f3b0f0fac22a043c07e64373381168ae00c259" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5d75ac36ee28647f6d871a93eefc7edcb729c3096590031ba50857fac44fa8" +checksum = "3eb1976337108c8b9f80b05e9b909bf603f85c4ea97e31c112876a36d3cdcb98" dependencies = [ "anyhow", - "base64 0.21.7", + "base64", "directories-next", "log", "postcard", - "rustix", + "rustix 1.0.7", "serde", "serde_derive", "sha2", @@ -3102,9 +3121,9 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581ef04bf33904db9a902ffb558e7b2de534d6a4881ee985ea833f187a78fdf" +checksum = "3491c0f2511be561a92ac9b086351abc3a0f48c5f5f7d14f3975e246c13838be" dependencies = [ "anyhow", "proc-macro2", @@ -3112,20 +3131,20 @@ dependencies = [ "syn", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.224.1", + "wit-parser 0.233.0", ] [[package]] name = "wasmtime-component-util" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7108498a8a0afc81c7d2d81b96cdc509cd631d7bbaa271b7db5137026f10e3" +checksum = "26bc084e249f74e61c79077d8937c34fb0af223752b9b1725e3d7ed94b006f23" [[package]] name = "wasmtime-cranelift" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abcc9179097235c91f299a8ff56b358ee921266b61adff7d14d6e48428954dd2" +checksum = "0010bd93362c634837e6bb13e213c2d83673b28dc12208b64ddd821fa55f7d33" dependencies = [ "anyhow", "cfg-if", @@ -3141,17 +3160,18 @@ dependencies = [ "pulley-interpreter", "smallvec", "target-lexicon", - "thiserror", - "wasmparser 0.224.1", + "thiserror 2.0.12", + "wasmparser 0.233.0", "wasmtime-environ", + "wasmtime-math", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e90f6cba665939381839bbf2ddf12d732fca03278867910348ef1281b700954" +checksum = "36a035dc308ff6be3d790dafdc2e41a128415e20ad864580da49470073e21dc1" dependencies = [ "anyhow", "cpp_demangle", @@ -3168,22 +3188,23 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasm-encoder 0.224.1", - "wasmparser 0.224.1", + "wasm-encoder 0.233.0", + "wasmparser 0.233.0", "wasmprinter", "wasmtime-component-util", ] [[package]] name = "wasmtime-fiber" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5c2ac21f0b39d72d2dac198218a12b3ddeb4ab388a8fa0d2e429855876783c" +checksum = "fdc3c1e4e70cdd3a4572dff79062caa48988f7f1ccf6850d98a4e4c41bf3cfc8" dependencies = [ "anyhow", "cc", "cfg-if", - "rustix", + "libc", + "rustix 1.0.7", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.59.0", @@ -3191,21 +3212,21 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74812989369947f4f5a33f4ae8ff551eb6c8a97ff55e0269a9f5f0fac93cd755" +checksum = "a5d83fa2dea686f76b5437b66045aae6351d359ee11cc4124f9842de63837b81" dependencies = [ "cc", "object", - "rustix", + "rustix 1.0.7", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f180cc0d2745e3a5df5d02231cd3046f49c75512eaa987b8202363b112e125d" +checksum = "44c71d64e8ebe132cd45e9d299a4d0daf261d66bd05cf50a204a1bf8cf96ff1f" dependencies = [ "anyhow", "cfg-if", @@ -3215,24 +3236,24 @@ dependencies = [ [[package]] name = "wasmtime-math" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f04c5dcf5b2f88f81cfb8d390294b2f67109dc4d0197ea7303c60a092df27c" +checksum = "222bfa4769c6931c985711eb49a92748ea0acc4ca85fcd24e945a2f1bacda0c1" dependencies = [ "libm", ] [[package]] name = "wasmtime-slab" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9681707f1ae9a4708ca22058722fca5c135775c495ba9b9624fe3732b94c97" +checksum = "5ac42c7fb0639f7c3e0c1ed0c984050245c55410f3fae334dd5b102e0edfab14" [[package]] name = "wasmtime-versioned-export-macros" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd2fe69d04986a12fc759d2e79494100d600adcb3bb79e63dedfc8e6bb2ab03e" +checksum = "4e052e1d9c30b8f31aff64380caaaff492a9890a412658bcc8866fe626b8e91f" dependencies = [ "proc-macro2", "quote", @@ -3241,9 +3262,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ce639c7d398586bc539ae9bba752084c1db7a49ab0f391a3230dcbcc6a64cfd" +checksum = "e8392e2256e2b56167a69c4d5ea5505fc3cd164f088ce7009824ee0abd1671dc" dependencies = [ "anyhow", "async-trait", @@ -3258,9 +3279,9 @@ dependencies = [ "futures", "io-extras", "io-lifetimes", - "rustix", + "rustix 1.0.7", "system-interface", - "thiserror", + "thiserror 2.0.12", "tokio", "tracing", "url", @@ -3272,9 +3293,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi-io" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdcad7178fddaa07786abe8ff5e043acb4bc8c8f737eb117f11e028b48d92792" +checksum = "92a8348338594ee5b46c2decdb921a54fabaaed4cb448f6effb97c49d09e44e7" dependencies = [ "anyhow", "async-trait", @@ -3285,16 +3306,16 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9c8eae8395d530bb00a388030de9f543528674c382326f601de47524376975" +checksum = "f2d71e002033124221f6633a462c26067280519fdd7527ba2751f585db779cc6" dependencies = [ "anyhow", "cranelift-codegen", "gimli", "object", "target-lexicon", - "wasmparser 0.224.1", + "wasmparser 0.233.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -3302,14 +3323,14 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a5531455e2c55994a1540355140369bb7ec0e46d2699731c5ee9f4cf9c3f7d4" +checksum = "f967f5efaaac7694e6bd0d67542a5a036830860e4adf95684260181e85a5d299" dependencies = [ "anyhow", "heck", "indexmap", - "wit-parser 0.224.1", + "wit-parser 0.233.0", ] [[package]] @@ -3323,24 +3344,24 @@ dependencies = [ [[package]] name = "wast" -version = "227.0.1" +version = "235.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c14e5042b16c9d267da3b9b0f4529870455178415286312c25c34dfc1b2816" +checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width", - "wasm-encoder 0.227.1", + "wasm-encoder 0.235.0", ] [[package]] name = "wat" -version = "1.227.1" +version = "1.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d394d5bef7006ff63338d481ca10f1af76601e65ebdf5ed33d29302994e9cc" +checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa" dependencies = [ - "wast 227.0.1", + "wast 235.0.0", ] [[package]] @@ -3355,14 +3376,14 @@ dependencies = [ [[package]] name = "wiggle" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a4ea7722c042a659dc70caab0b56d7f45220e8bae1241cf5ebc7ab7efb0dfb" +checksum = "ab89466227933ce3d44f2b60eedd2cc46ba3dfd350cf1e938b6422bea18aa422" dependencies = [ "anyhow", "async-trait", "bitflags", - "thiserror", + "thiserror 2.0.12", "tracing", "wasmtime", "wiggle-macro", @@ -3370,24 +3391,23 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f786d9d3e006152a360f1145bdc18e56ea22fd5d2356f1ddc2ecfcf7529a77b" +checksum = "f650b2d5981c3359778c49eada0796fcc98e9135bc6f7bb894cab2e2bc4fd04d" dependencies = [ "anyhow", "heck", "proc-macro2", "quote", - "shellexpand", "syn", "witx", ] [[package]] name = "wiggle-macro" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceac9f94f22ccc0485aeab08187b9f211d1993aaf0ed6eeb8aed43314f6e717c" +checksum = "e4e5f692091b53dbb0835f74cfc03cbd8f384fd3fb493bde6bdc96426e105e84" dependencies = [ "proc-macro2", "quote", @@ -3428,20 +3448,22 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "30.0.2" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dbd4e07bd92c7ddace2f3267bdd31d4197b5ec58c315751325d45c19bfb56df" +checksum = "7d2bf456780101aff8950642fdf984f182816d7f555d5375699200242be78762" dependencies = [ "anyhow", + "cranelift-assembler-x64", "cranelift-codegen", "gimli", "regalloc2", "smallvec", "target-lexicon", - "thiserror", - "wasmparser 0.224.1", + "thiserror 2.0.12", + "wasmparser 0.233.0", "wasmtime-cranelift", "wasmtime-environ", + "wasmtime-math", ] [[package]] @@ -3694,9 +3716,9 @@ dependencies = [ "indexmap", "prettyplease", "syn", - "wasm-metadata", + "wasm-metadata 0.227.1", "wit-bindgen-core", - "wit-component", + "wit-component 0.227.1", ] [[package]] @@ -3728,16 +3750,35 @@ dependencies = [ "serde_derive", "serde_json", "wasm-encoder 0.227.1", - "wasm-metadata", + "wasm-metadata 0.227.1", "wasmparser 0.227.1", "wit-parser 0.227.1", ] +[[package]] +name = "wit-component" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a57a11109cc553396f89f3a38a158a97d0b1adaec113bd73e0f64d30fb601f" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.235.0", + "wasm-metadata 0.235.0", + "wasmparser 0.235.0", + "wit-parser 0.235.0", +] + [[package]] name = "wit-parser" -version = "0.224.1" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3477d8d0acb530d76beaa8becbdb1e3face08929db275f39934963eb4f716f8" +checksum = "ddf445ed5157046e4baf56f9138c124a0824d4d1657e7204d71886ad8ce2fc11" dependencies = [ "anyhow", "id-arena", @@ -3748,14 +3789,14 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.224.1", + "wasmparser 0.227.1", ] [[package]] name = "wit-parser" -version = "0.227.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf445ed5157046e4baf56f9138c124a0824d4d1657e7204d71886ad8ce2fc11" +checksum = "f22f1cd55247a2e616870b619766e9522df36b7abafbb29bbeb34b7a9da7e9f0" dependencies = [ "anyhow", "id-arena", @@ -3766,7 +3807,25 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.227.1", + "wasmparser 0.233.0", +] + +[[package]] +name = "wit-parser" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1f95a87d03a33e259af286b857a95911eb46236a0f726cbaec1227b3dfc67a" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.235.0", ] [[package]] @@ -3777,7 +3836,7 @@ checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" dependencies = [ "anyhow", "log", - "thiserror", + "thiserror 1.0.65", "wast 35.0.2", ] @@ -3788,8 +3847,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "linux-raw-sys 0.4.14", + "rustix 0.38.44", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2a84001..f102d47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,10 @@ tar = "0.4.42" tempfile = "3.13.0" zstd = "0.13.2" componentize-py-shared = { path = "shared" } -wasm-encoder = "0.227.0" -wit-parser = "0.227.0" -wit-component = "0.227.0" -wasmparser = "0.227.0" +wasm-encoder = "0.235.0" +wit-parser = "0.235.0" +wit-component = "0.235.0" +wasmparser = "0.235.0" indexmap = "2.6.0" bincode = "1.3.3" heck = "0.5.0" @@ -28,12 +28,10 @@ pyo3 = { git = "https://github.com/dicej/pyo3", branch = "v0.25.0-no-wasm32-unwi "abi3-py39", "extension-module", ], optional = true } -wasmtime = "30.0.2" -wasmtime-wasi = "30.0.2" -wasi-common = "30.0.2" +wasmtime = "34.0.1" +wasmtime-wasi = "34.0.1" once_cell = "1.20.2" -component-init = { git = "https://github.com/dicej/component-init", rev = "2db53ece" } -wasm-convert = { git = "https://github.com/dicej/wasm-convert", rev = "713e2d6a" } +component-init-transform = "0.1" async-trait = "0.1.83" futures = "0.3.31" tokio = { version = "1.41.0", features = [ diff --git a/examples/http/README.md b/examples/http/README.md index e56b7f9..8083727 100644 --- a/examples/http/README.md +++ b/examples/http/README.md @@ -27,7 +27,7 @@ First, build the app and run it: ``` componentize-py -d ../../wit -w wasi:http/proxy@0.2.0 componentize app -o http.wasm -wasmtime serve --wasi common http.wasm +wasmtime serve -Scli http.wasm ``` Then, in another terminal, use cURL to send a request to the app: diff --git a/src/bindgen.rs b/src/bindgen.rs index ba1db42..c5c0156 100644 --- a/src/bindgen.rs +++ b/src/bindgen.rs @@ -2200,8 +2200,8 @@ impl<'a> FunctionBindgen<'a> { self.push(match ty { ValType::I32 => Ins::I32Const(0), ValType::I64 => Ins::I64Const(0), - ValType::F32 => Ins::F32Const(0.0), - ValType::F64 => Ins::F64Const(0.0), + ValType::F32 => Ins::F32Const(0.0.into()), + ValType::F64 => Ins::F64Const(0.0.into()), _ => unreachable!(), }) } diff --git a/src/lib.rs b/src/lib.rs index 9d8951c..5a8685b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ use { anyhow::{anyhow, bail, ensure, Context, Error, Result}, async_trait::async_trait, bytes::Bytes, - component_init::Invoker, + component_init_transform::Invoker, futures::future::FutureExt, heck::ToSnakeCase, indexmap::{IndexMap, IndexSet}, @@ -22,8 +22,11 @@ use { Config, Engine, Store, }, wasmtime_wasi::{ - pipe::{MemoryInputPipe, MemoryOutputPipe}, - DirPerms, FilePerms, IoView, WasiCtx, WasiCtxBuilder, WasiView, + p2::{ + pipe::{MemoryInputPipe, MemoryOutputPipe}, + IoView, WasiCtx, WasiCtxBuilder, WasiView, + }, + DirPerms, FilePerms, }, wit_parser::{Resolve, TypeDefKind, UnresolvedPackageGroup, WorldId, WorldItem, WorldKey}, }; @@ -348,9 +351,10 @@ pub async fn componentize( None }; - // Pre-initialize the component by running it through `component_init::initialize`. Currently, this is the - // application's first and only chance to load any standard or third-party modules since we do not yet include - // a virtual filesystem in the component to make those modules available at runtime. + // Pre-initialize the component by running it through `component_init_transform::initialize`. + // Currently, this is the application's first and only chance to load any standard or + // third-party modules since we do not yet include a virtual filesystem in the component to + // make those modules available at runtime. let stdout = MemoryOutputPipe::new(10000); let stderr = MemoryOutputPipe::new(10000); @@ -511,7 +515,7 @@ pub async fn componentize( let mut store = Store::new(&engine, Ctx { wasi, table }); let app_name = app_name.to_owned(); - let component = component_init::initialize_staged( + let component = component_init_transform::initialize_staged( &component, stubbed_component .as_ref() @@ -585,7 +589,7 @@ fn add_wasi_and_stubs( worlds: &IndexSet, linker: &mut Linker, ) -> Result<()> { - wasmtime_wasi::add_to_linker_async(linker)?; + wasmtime_wasi::p2::add_to_linker_async(linker)?; enum Stub<'a> { Function(&'a String), diff --git a/src/stubwasi.rs b/src/stubwasi.rs index 4b3e620..613a101 100644 --- a/src/stubwasi.rs +++ b/src/stubwasi.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use anyhow::{bail, Error}; -use wasm_convert::IntoValType; use wasm_encoder::{ CodeSection, ExportKind, ExportSection, Function, FunctionSection, Instruction as Ins, Module, TypeSection, @@ -37,8 +36,8 @@ pub fn link_stub_modules(libraries: Vec) -> Result) -> Vec let mut exports = ExportSection::new(); let mut code = CodeSection::new(); + use wasm_encoder::reencode::{Reencode, RoundtripReencoder as R}; + for (index, (name, ty)) in stubs.iter().enumerate() { let index = u32::try_from(index).unwrap(); types.ty().function( - ty.params().iter().map(|&v| IntoValType(v).into()), - ty.results().iter().map(|&v| IntoValType(v).into()), + ty.params().iter().map(|&v| R.val_type(v).unwrap()), + ty.results().iter().map(|&v| R.val_type(v).unwrap()), ); functions.function(index); exports.export(name, ExportKind::Func, index); diff --git a/src/summary.rs b/src/summary.rs index a7d9e0f..fdbaf1a 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -1111,13 +1111,11 @@ impl<'a> Summary<'a> { if packages.len() == 1 { (*name).to_owned() } else { - format!("{}-{}-{name}", package_namespace, package_name) + format!("{package_namespace}-{package_name}-{name}") } } else { format!( - "{}-{}-{name}-{}", - package_namespace, - package_name, + "{package_namespace}-{package_name}-{name}-{}", version.to_string().replace('.', "-") ) } @@ -1128,7 +1126,7 @@ impl<'a> Summary<'a> { } else if packages.len() == 1 { (*name).to_owned() } else { - format!("{}-{}-{name}", package_namespace, package_name) + format!("{package_namespace}-{package_name}-{name}",) } ) .is_none()); diff --git a/src/test.rs b/src/test.rs index 0a0574e..66bc8c2 100644 --- a/src/test.rs +++ b/src/test.rs @@ -14,7 +14,7 @@ use { component::{Component, InstancePre, Linker, ResourceTable}, Config, Engine, Store, }, - wasmtime_wasi::{WasiCtx, WasiCtxBuilder}, + wasmtime_wasi::p2::{WasiCtx, WasiCtxBuilder}, }; mod echoes; diff --git a/src/test/echoes.rs b/src/test/echoes.rs index 8c92f60..53cdf37 100644 --- a/src/test/echoes.rs +++ b/src/test/echoes.rs @@ -4,7 +4,7 @@ use { once_cell::sync::Lazy, proptest::strategy::{Just, Strategy}, wasmtime::{ - component::{InstancePre, Linker}, + component::{HasSelf, InstancePre, Linker}, Store, }, }; @@ -189,8 +189,8 @@ impl super::Host for Host { type World = EchoesTest; fn add_to_linker(linker: &mut Linker) -> Result<()> { - wasmtime_wasi::add_to_linker_async(&mut *linker)?; - componentize_py::test::echoes::add_to_linker(linker, |ctx| ctx)?; + wasmtime_wasi::p2::add_to_linker_async(&mut *linker)?; + componentize_py::test::echoes::add_to_linker::<_, HasSelf<_>>(linker, |ctx| ctx)?; Ok(()) } diff --git a/src/test/tests.rs b/src/test/tests.rs index ad62663..aad2e42 100644 --- a/src/test/tests.rs +++ b/src/test/tests.rs @@ -6,10 +6,13 @@ use { once_cell::sync::Lazy, std::str, wasmtime::{ - component::{InstancePre, Linker, Resource, ResourceAny}, + component::{HasSelf, InstancePre, Linker, Resource, ResourceAny}, Store, }, - wasmtime_wasi::{DirPerms, FilePerms, IoView, WasiCtxBuilder}, + wasmtime_wasi::{ + p2::{IoView, WasiCtxBuilder}, + DirPerms, FilePerms, + }, }; wasmtime::component::bindgen!({ @@ -93,9 +96,9 @@ impl super::Host for Host { type World = Tests; fn add_to_linker(linker: &mut Linker) -> Result<()> { - wasmtime_wasi::add_to_linker_async(linker)?; - Tests::add_to_linker(linker, |ctx| ctx)?; - foo_sdk::FooWorld::add_to_linker(linker, |ctx| ctx)?; + wasmtime_wasi::p2::add_to_linker_async(linker)?; + Tests::add_to_linker::<_, HasSelf<_>>(linker, |ctx| ctx)?; + foo_sdk::FooWorld::add_to_linker::<_, HasSelf<_>>(linker, |ctx| ctx)?; Ok(()) } diff --git a/test-generator/src/lib.rs b/test-generator/src/lib.rs index 1e2d668..01621bc 100644 --- a/test-generator/src/lib.rs +++ b/test-generator/src/lib.rs @@ -699,7 +699,7 @@ pub fn generate() -> Result<()> { writeln!( &mut typed_function_inits, - r#"echo{test_index}: instance.get_typed_func::<({params}), ({result_type},)>(&mut *store, component.export_index(Some(&index), "echo{test_index}").unwrap().1)?,"# + r#"echo{test_index}: instance.get_typed_func::<({params}), ({result_type},)>(&mut *store, component.get_export_index(Some(&index), "echo{test_index}").unwrap())?,"# ) .unwrap(); } @@ -802,7 +802,7 @@ use {{ once_cell::sync::Lazy, proptest::strategy::{{Just, Strategy}}, wasmtime::{{ - component::{{Instance, InstancePre, Linker, TypedFunc}}, + component::{{Instance, InstancePre, Linker, TypedFunc, HasSelf}}, Store, }}, }}; @@ -828,8 +828,8 @@ impl super::Host for Host {{ type World = Exports; fn add_to_linker(linker: &mut Linker) -> Result<()> {{ - wasmtime_wasi::add_to_linker_async(&mut *linker)?; - {PREFIX}::add_to_linker(linker, |ctx| ctx)?; + wasmtime_wasi::p2::add_to_linker_async(&mut *linker)?; + {PREFIX}::add_to_linker::<_, HasSelf<_>>(linker, |ctx| ctx)?; Ok(()) }} @@ -838,7 +838,7 @@ impl super::Host for Host {{ pre: InstancePre, ) -> Result {{ let component = pre.component(); - let (_, index) = component.export_index(None, "componentize-py:test/echoes-generated").unwrap(); + let index = component.get_export_index(None, "componentize-py:test/echoes-generated").unwrap(); let instance = pre.instantiate_async(&mut *store).await?; Ok((Self::World {{ {typed_function_inits} diff --git a/tests/componentize.rs b/tests/componentize.rs index ccc1e55..713501c 100644 --- a/tests/componentize.rs +++ b/tests/componentize.rs @@ -76,7 +76,7 @@ fn http_example() -> anyhow::Result<()> { let mut handle = std::process::Command::new("wasmtime") .current_dir(&path) - .args(["serve", "--wasi", "common", "http.wasm"]) + .args(["serve", "-Scli", "http.wasm"]) .spawn()?; let content = "’Twas brillig, and the slithy toves