diff --git a/Cargo.lock b/Cargo.lock index c5df7eae..c8662a29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,22 +204,13 @@ dependencies = [ "syn 2.0.33", ] -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.3", -] - [[package]] name = "addr2line" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.0", + "gimli", ] [[package]] @@ -382,12 +373,12 @@ version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.21.0", + "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object", "rustc-demangle", ] @@ -523,38 +514,50 @@ dependencies = [ [[package]] name = "cap-fs-ext" -version = "1.0.15" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc48200a1a0fa6fba138b1802ad7def18ec1cdd92f7b2a04e21f1bd887f7b9" +checksum = "b779b2d0a001c125b4584ad586268fb4b92d957bff8d26d7fe0dd78283faa814" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.2", "windows-sys", ] +[[package]] +name = "cap-net-ext" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ffc30dee200c20b4dcb80572226f42658e1d9c4b668656d7cc59c33d50e396e" +dependencies = [ + "cap-primitives", + "cap-std", + "rustix 0.38.13", + "smallvec", +] + [[package]] name = "cap-primitives" -version = "1.0.15" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b6df5b295dca8d56f35560be8c391d59f0420f72e546997154e24e765e6451" +checksum = "2bf30c373a3bee22c292b1b6a7a26736a38376840f1af3d2d806455edf8c3899" dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.2", "ipnet", "maybe-owned", - "rustix 0.37.23", + "rustix 0.38.13", "windows-sys", - "winx 0.35.1", + "winx", ] [[package]] name = "cap-rand" -version = "1.0.15" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25555efacb0b5244cf1d35833d55d21abc916fff0eaad254b8e2453ea9b8ab" +checksum = "577de6cff7c2a47d6b13efe5dd28bf116bd7f8f7db164ea95b7cc2640711f522" dependencies = [ "ambient-authority", "rand", @@ -562,26 +565,26 @@ dependencies = [ [[package]] name = "cap-std" -version = "1.0.15" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3373a62accd150b4fcba056d4c5f3b552127f0ec86d3c8c102d60b978174a012" +checksum = "84bade423fa6403efeebeafe568fdb230e8c590a275fba2ba978dd112efcf6e9" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 1.0.11", - "rustix 0.37.23", + "io-lifetimes 2.0.2", + "rustix 0.38.13", ] [[package]] name = "cap-time-ext" -version = "1.0.15" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e95002993b7baee6b66c8950470e59e5226a23b3af39fc59c47fe416dd39821a" +checksum = "f8f52b3c8f4abfe3252fd0a071f3004aaa3b18936ec97bdbd8763ce03aff6247" dependencies = [ "cap-primitives", "once_cell", - "rustix 0.37.23", - "winx 0.35.1", + "rustix 0.38.13", + "winx", ] [[package]] @@ -769,18 +772,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aae6f552c4c0ccfb30b9559b77bc985a387d998e1736cbbe6b14c903f3656cf" +checksum = "03b9d1a9e776c27ad55d7792a380785d1fe8c2d7b099eed8dbd8f4af2b598192" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95551de96900cefae691ce895ff2abc691ae3a0b97911a76b45faf99e432937b" +checksum = "5528483314c2dd5da438576cd8a9d0b3cedad66fb8a4727f90cd319a81950038" dependencies = [ "bumpalo", "cranelift-bforest", @@ -789,8 +792,8 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.27.3", - "hashbrown 0.13.2", + "gimli", + "hashbrown 0.14.0", "log", "regalloc2", "smallvec", @@ -799,42 +802,43 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a3ad7b2bb03de3383f258b00ca29d80234bebd5130cb6ef3bae37ada5baab0" +checksum = "0f46a8318163f7682e35b8730ba93c1b586a2da8ce12a0ed545efc1218550f70" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915918fee4142c85fb04bafe0bcd697e2fd6c15a260301ea6f8d2ea332a30e86" +checksum = "37d1239cfd50eecfaed468d46943f8650e32969591868ad50111613704da6c70" [[package]] name = "cranelift-control" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e447d548cd7f4fcb87fbd10edbd66a4f77966d17785ed50a08c8f3835483c8" +checksum = "bcc530560c8f16cc1d4dd7ea000c56f519c60d1a914977abe849ce555c35a61d" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8ab3352a1e5966968d7ab424bd3de8e6b58314760745c3817c2eec3fa2f918" +checksum = "f333fa641a9ad2bff0b107767dcb972c18c2bfab7969805a1d7e42449ccb0408" dependencies = [ "serde", + "serde_derive", ] [[package]] name = "cranelift-frontend" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bffa38431f7554aa1594f122263b87c9e04abc55c9f42b81d37342ac44f79f0" +checksum = "06abf6563015a80f03f8bc4df307d0a81363f4eb73108df3a34f6e66fb6d5307" dependencies = [ "cranelift-codegen", "log", @@ -844,15 +848,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84cef66a71c77938148b72bf006892c89d6be9274a08f7e669ff15a56145d701" +checksum = "0eb29d0edc8a5c029ed0f7ca77501f272738e3c410020b4a00f42ffe8ad2a8aa" [[package]] name = "cranelift-native" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33c7e5eb446e162d2d10b17fe68e1f091020cc2e4e38b5501c21099600b0a1b" +checksum = "006056a7fa920870bad06bf8e1b3033d70cbb7ee625b035efa9d90882a931868" dependencies = [ "cranelift-codegen", "libc", @@ -861,9 +865,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.97.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f7b64fa6a8c5b980eb6a17ef22089e15cb9f779f1ed3bd3072beab0686c09" +checksum = "7b3d08c05f82903a1f6a04d89c4b9ecb47a4035710f89a39a21a147a80214672" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -871,7 +875,7 @@ dependencies = [ "itertools", "log", "smallvec", - "wasmparser 0.107.0", + "wasmparser", "wasmtime-types", ] @@ -914,7 +918,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", + "memoffset", "scopeguard", ] @@ -1137,9 +1141,9 @@ dependencies = [ [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" @@ -1158,16 +1162,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "file-per-thread-logger" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3cc21c33af89af0930c8cae4ade5e6fdc17b5d2c97b3d2e2edb67a1cf683f3" -dependencies = [ - "env_logger 0.10.0", - "log", -] - [[package]] name = "flate2" version = "1.0.27" @@ -1210,15 +1204,29 @@ dependencies = [ [[package]] name = "fs-set-times" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d167b646a876ba8fda6b50ac645cfd96242553cbaf0ca4fccaa39afcbf0801f" +checksum = "dd738b84894214045e8414eaded76359b4a5773f0a0a56b16575110739cdcf39" dependencies = [ - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.2", "rustix 0.38.13", "windows-sys", ] +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.28" @@ -1226,6 +1234,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -1260,6 +1269,7 @@ checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", + "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -1312,21 +1322,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" dependencies = [ "fallible-iterator", - "indexmap 1.9.3", + "indexmap 2.0.0", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - [[package]] name = "git2" version = "0.17.2" @@ -1387,6 +1391,9 @@ name = "hashbrown" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "ahash", +] [[package]] name = "heck" @@ -1555,7 +1562,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -1571,11 +1577,11 @@ dependencies = [ [[package]] name = "io-extras" -version = "0.17.4" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde93d48f0d9277f977a333eca8313695ddd5301dc96f7e02aeddcb0dd99096f" +checksum = "9d3c230ee517ee76b1cc593b52939ff68deda3fae9e41eca426c6b4993df51c4" dependencies = [ - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.2", "windows-sys", ] @@ -1840,15 +1846,6 @@ dependencies = [ "rustix 0.37.23", ] -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -1952,24 +1949,15 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.30.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ + "crc32fast", + "hashbrown 0.14.0", + "indexmap 2.0.0", "memchr", ] @@ -2229,6 +2217,17 @@ dependencies = [ "unicase", ] +[[package]] +name = "pulldown-cmark" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -2491,10 +2490,8 @@ dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes 1.0.11", - "itoa", "libc", "linux-raw-sys 0.3.8", - "once_cell", "windows-sys", ] @@ -2506,8 +2503,10 @@ checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ "bitflags 2.4.0", "errno", + "itoa", "libc", "linux-raw-sys 0.4.7", + "once_cell", "windows-sys", ] @@ -2785,9 +2784,9 @@ dependencies = [ [[package]] name = "system-interface" -version = "0.25.9" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10081a99cbecbc363d381b9503563785f0b02735fccbb0d4c1a2cb3d39f7e7fe" +checksum = "27ce32341b2c0b70c144bbf35627fdc1ef18c76ced5e5e7b3ee8b5ba6b2ab6a0" dependencies = [ "bitflags 2.4.0", "cap-fs-ext", @@ -2796,7 +2795,7 @@ dependencies = [ "io-lifetimes 2.0.2", "rustix 0.38.13", "windows-sys", - "winx 0.36.2", + "winx", ] [[package]] @@ -3178,9 +3177,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2fe3aaf51c1e1a04a490e89f0a9cab789d21a496c0ce398d49a24f8df883a58" +checksum = "ec076cd75f207327f5bfaebb915ef03d82c3a01a6d9b5d0deb6eafffceab3095" dependencies = [ "anyhow", "async-trait", @@ -3190,10 +3189,10 @@ dependencies = [ "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.2", "is-terminal", "once_cell", - "rustix 0.37.23", + "rustix 0.38.13", "system-interface", "tracing", "wasi-common", @@ -3202,17 +3201,17 @@ dependencies = [ [[package]] name = "wasi-common" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74e9a2c8bfda59870a8bff38a31b9ba80b6fdb7abdfd2487177b85537d2e8a8" +checksum = "3f391b334c783c1154369be62c31dc8598ffa1a6c34ea05d7f8cf0b18ce7c272" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "cap-rand", "cap-std", "io-extras", "log", - "rustix 0.37.23", + "rustix 0.38.13", "thiserror", "tracing", "wasmtime", @@ -3286,15 +3285,6 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" -[[package]] -name = "wasm-encoder" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" -dependencies = [ - "leb128", -] - [[package]] name = "wasm-encoder" version = "0.32.0" @@ -3342,16 +3332,6 @@ dependencies = [ "wws-server", ] -[[package]] -name = "wasmparser" -version = "0.107.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" -dependencies = [ - "indexmap 1.9.3", - "semver", -] - [[package]] name = "wasmparser" version = "0.112.0" @@ -3369,14 +3349,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ddf5892036cd4b780d505eff1194a0cbc10ed896097656fdcea3744b5e7c2f" dependencies = [ "anyhow", - "wasmparser 0.112.0", + "wasmparser", ] [[package]] name = "wasmtime" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc104ced94ff0a6981bde77a0bc29aab4af279914a4143b8d1af9fd4b2c9d41" +checksum = "16ed7db409c1acf60d33128b2a38bee25aaf38c4bd955ab98a5b623c8294593c" dependencies = [ "anyhow", "async-trait", @@ -3385,18 +3365,20 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 1.9.3", + "indexmap 2.0.0", "libc", "log", - "object 0.30.4", + "object", "once_cell", "paste", "psm", "rayon", "serde", + "serde_derive", "serde_json", "target-lexicon", - "wasmparser 0.107.0", + "wasm-encoder", + "wasmparser", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -3412,27 +3394,27 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b28e5661a9b5f7610a62ab3c69222fa161f7bd31d04529e856461d8c3e706b" +checksum = "53af0f8f6271bd687fe5632c8fe0a0f061d0aa1b99a0cd4e1df8e4cbeb809d2f" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f58ddfe801df3886feaf466d883ea37e941bcc6d841b9f644a08c7acabfe7f8" +checksum = "41376a7c094335ee08abe6a4eff79a32510cc805a249eff1b5e7adf0a42e7cdf" dependencies = [ "anyhow", "base64", "bincode", "directories-next", - "file-per-thread-logger", "log", - "rustix 0.37.23", + "rustix 0.38.13", "serde", + "serde_derive", "sha2", "toml 0.5.11", "windows-sys", @@ -3441,81 +3423,84 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39725d9633fb064bd3a6d83c5ea5077289256de0862d3d96295822edb13419c0" +checksum = "74ab5b291f2dad56f1e6929cc61fb7cac68845766ca77c3838b5d05d82c33976" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.33", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.8.0", + "wit-parser 0.11.1", ] [[package]] name = "wasmtime-component-util" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1153feafc824f95dc69472cb89a3396b3b05381f781a7508b01840f9df7b1a51" +checksum = "21436177bf19f6b60dc0b83ad5872e849892a4a90c3572785e1a28c0e2e1132c" [[package]] name = "wasmtime-cranelift" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc1e39ce9aa0fa0b319541ed423960b06cfa7343eca1574f811ea34275739c2" +checksum = "920e42058862d1f7a3dd3fca73cb495a20d7506e3ada4bbc0a9780cd636da7ca" dependencies = [ "anyhow", + "cfg-if", "cranelift-codegen", "cranelift-control", "cranelift-entity", "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.27.3", + "gimli", "log", - "object 0.30.4", + "object", "target-lexicon", "thiserror", - "wasmparser 0.107.0", + "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", + "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-cranelift-shared" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dd32739326690e51c76551d7cbf29d371e7de4dc7b37d2d503be314ab5b7d04" +checksum = "516d63bbe18219e64a9705cf3a2c865afe1fb711454ea03091dc85a1d708194d" dependencies = [ "anyhow", "cranelift-codegen", "cranelift-control", "cranelift-native", - "gimli 0.27.3", - "object 0.30.4", + "gimli", + "object", "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b60e4ae5c9ae81750d8bc59110bf25444aa1d9266c19999c3b64b801db3c73" +checksum = "59cef239d663885f1427f8b8f4fde7be6075249c282580d94b480f11953ca194" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", + "gimli", + "indexmap 2.0.0", "log", - "object 0.30.4", + "object", "serde", + "serde_derive", "target-lexicon", "thiserror", - "wasm-encoder 0.29.0", - "wasmparser 0.107.0", + "wasm-encoder", + "wasmparser", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -3523,35 +3508,37 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd40c8d869916ee6b1f3fcf1858c52041445475ca8550aee81c684c0eb530ca" +checksum = "2ef118b557df6193cd82cfb45ab57cd12388fedfe2bb76f090b2d77c96c1b56e" dependencies = [ "cc", "cfg-if", - "rustix 0.37.23", + "rustix 0.38.13", "wasmtime-asm-macros", + "wasmtime-versioned-export-macros", "windows-sys", ] [[package]] name = "wasmtime-jit" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655b23a10eddfe7814feb548a466f3f25aa4bb4f43098a147305c544a2de28e1" +checksum = "c8089d5909b8f923aad57702ebaacb7b662aa9e43a3f71e83e025c5379a1205f" dependencies = [ - "addr2line 0.19.0", + "addr2line", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.27.3", + "gimli", "ittapi", "log", - "object 0.30.4", + "object", "rustc-demangle", - "rustix 0.37.23", + "rustix 0.38.13", "serde", + "serde_derive", "target-lexicon", "wasmtime-environ", "wasmtime-jit-debug", @@ -3562,20 +3549,21 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46b7e98979a69d3df093076bde8431204e3c96a770e8d216fea365c627d88a4" +checksum = "9b13924aedf6799ad66edb25500a20e3226629978b30a958c55285352bad130a" dependencies = [ - "object 0.30.4", + "object", "once_cell", - "rustix 0.37.23", + "rustix 0.38.13", + "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb1e7c68ede63dc7a98c3e473162954e224951854e229c8b4e74697fe17dbdd" +checksum = "c6ff5f3707a5e3797deeeeac6ac26b2e1dd32dbc06693c0ab52e8ac4d18ec706" dependencies = [ "cfg-if", "libc", @@ -3584,62 +3572,84 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843e33bf9e0f0c57902c87a1dea1389cc23865c65f007214318dbdfcb3fd4ae5" +checksum = "11ab4ce04ac05342edfa7f42895f2a5d8b16ee914330869acb865cd1facf265f" dependencies = [ "anyhow", "cc", "cfg-if", "encoding_rs", - "indexmap 1.9.3", + "indexmap 2.0.0", "libc", "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand", - "rustix 0.37.23", + "rustix 0.38.13", "sptr", + "wasm-encoder", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-fiber", "wasmtime-jit-debug", + "wasmtime-versioned-export-macros", + "wasmtime-wmemcheck", "windows-sys", ] [[package]] name = "wasmtime-types" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7473a07bebd85671bada453123e3d465c8e0a59668ff79f5004076e6a2235ef5" +checksum = "ecf61e21d5bd95e1ad7fa42b7bdabe21220682d6a6046d376edca29760849222" dependencies = [ "cranelift-entity", "serde", + "serde_derive", "thiserror", - "wasmparser 0.107.0", + "wasmparser", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe877472cbdd6d96b4ecdc112af764e3b9d58c2e4175a87828f892ab94c60643" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.33", ] [[package]] name = "wasmtime-wasi" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff7b3b3272ad5b4ba63c9aac6248da6f06a8227d0c0d6017d89225d794e966c" +checksum = "b6db393deb775e8bece53a6869be6425e46b28426aa7709df8c529a19759f4be" dependencies = [ "anyhow", "async-trait", - "bitflags 1.3.2", + "bitflags 2.4.0", + "bytes", "cap-fs-ext", + "cap-net-ext", "cap-rand", "cap-std", "cap-time-ext", "fs-set-times", + "futures", "io-extras", + "io-lifetimes 2.0.2", + "is-terminal", "libc", - "rustix 0.37.23", + "once_cell", + "rustix 0.38.13", "system-interface", "thiserror", + "tokio", "tracing", "wasi-cap-std-sync", "wasi-common", @@ -3650,29 +3660,31 @@ dependencies = [ [[package]] name = "wasmtime-wasi-nn" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f354a4d2eae69bf5cd2cbe7d89079c65d964d23a8c75d90158548db2a17c902" +checksum = "2acfac514a240b19f77ca5e27d936bf313d73184d2ac28a4c55e8e9da342d6c3" dependencies = [ "anyhow", "openvino", "thiserror", + "tracing", "walkdir", + "wasmtime", "wiggle", ] [[package]] name = "wasmtime-winch" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351c9d4e60658dd0cf616c12c5508f86cc2cefcc0cff307eed0a31b23d3c0b70" +checksum = "0bc5a770003807c55f2187a0092dea01722b0e24151e35816bd5091538bb8e88" dependencies = [ "anyhow", "cranelift-codegen", - "gimli 0.27.3", - "object 0.30.4", + "gimli", + "object", "target-lexicon", - "wasmparser 0.107.0", + "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -3680,15 +3692,22 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f114407efbd09e4ef67053b6ae54c16455a821ef2f6096597fcba83b7625e59c" +checksum = "62003d48822f89cc393e93643366ddbee1766779c0874353b8ba2ede4679fbf9" dependencies = [ "anyhow", "heck 0.4.1", - "wit-parser 0.8.0", + "indexmap 2.0.0", + "wit-parser 0.11.1", ] +[[package]] +name = "wasmtime-wmemcheck" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5412bb464066d64c3398c96e6974348f90fa2a55110ad7da3f9295438cd4de84" + [[package]] name = "wast" version = "35.0.2" @@ -3707,7 +3726,7 @@ dependencies = [ "leb128", "memchr", "unicode-width", - "wasm-encoder 0.32.0", + "wasm-encoder", ] [[package]] @@ -3758,13 +3777,13 @@ dependencies = [ [[package]] name = "wiggle" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63f150c6e39ef29a58139564c5ed7a0ef34d6df8a8eecd4233af85a576968d9" +checksum = "da341f21516453768bd115bdc17b186c0a1ab6773c2b2eeab44a062db49bd616" dependencies = [ "anyhow", "async-trait", - "bitflags 1.3.2", + "bitflags 2.4.0", "thiserror", "tracing", "wasmtime", @@ -3773,28 +3792,28 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f31e961fb0a5ad3ff10689c85f327f4abf10b4cac033b9d7372ccbb106aea24" +checksum = "e22c6bd943a4bae37052b79d249fb32d7afa22b3f6a147a5f2e7bc2b9f901879" dependencies = [ "anyhow", "heck 0.4.1", "proc-macro2", "quote", "shellexpand", - "syn 1.0.109", + "syn 2.0.33", "witx", ] [[package]] name = "wiggle-macro" -version = "10.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a28ae3d6b90f212beca7fab5910d0a3b1a171290c06eaa81bb39f41e6f74589" +checksum = "7d72d838b7c9302b2ca7c44f36d6af5ce1988239a16deba951d99c4630d17caf" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.33", "wiggle-generate", ] @@ -3831,17 +3850,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.8.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1bf2ac354be169bb201de7867b84f45d91d0ef812f67f11c33f74a7f5a24e56" +checksum = "50647204d600a2a112eefac0645ba6653809a15bd362c7e4e6a049a5bdff0de9" dependencies = [ "anyhow", "cranelift-codegen", - "gimli 0.27.3", + "gimli", "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.107.0", + "wasmparser", "wasmtime-environ", ] @@ -3930,17 +3949,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "winx" -version = "0.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c52a121f0fbf9320d5f2a9a5d82f6cb7557eda5e8b47fc3e7f359ec866ae960" -dependencies = [ - "bitflags 1.3.2", - "io-lifetimes 1.0.11", - "windows-sys", -] - [[package]] name = "winx" version = "0.36.2" @@ -3954,10 +3962,10 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-core" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79#598cd229bb43baceff9616d16930b8a5a3e79d79" dependencies = [ "anyhow", - "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", + "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79)", ] [[package]] @@ -3972,10 +3980,10 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-rust" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79#598cd229bb43baceff9616d16930b8a5a3e79d79" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79)", ] [[package]] @@ -4000,11 +4008,11 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79#598cd229bb43baceff9616d16930b8a5a3e79d79" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", - "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79)", + "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79)", ] [[package]] @@ -4031,7 +4039,7 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79#598cd229bb43baceff9616d16930b8a5a3e79d79" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -4043,22 +4051,22 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime-impl" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79#598cd229bb43baceff9616d16930b8a5a3e79d79" dependencies = [ "proc-macro2", "syn 1.0.109", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79)", "wit-bindgen-gen-wasmtime", ] [[package]] name = "wit-parser" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=598cd229bb43baceff9616d16930b8a5a3e79d79#598cd229bb43baceff9616d16930b8a5a3e79d79" dependencies = [ "anyhow", "id-arena", - "pulldown-cmark", + "pulldown-cmark 0.8.0", "unicode-normalization", "unicode-xid", ] @@ -4070,23 +4078,25 @@ source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460 dependencies = [ "anyhow", "id-arena", - "pulldown-cmark", + "pulldown-cmark 0.8.0", "unicode-normalization", "unicode-xid", ] [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "1dcd022610436a1873e60bfdd9b407763f2404adf7d1cb57912c7ae4059e57a5" dependencies = [ "anyhow", "id-arena", - "indexmap 1.9.3", + "indexmap 2.0.0", "log", - "pulldown-cmark", + "pulldown-cmark 0.9.3", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/Cargo.toml b/Cargo.toml index d78f45d2..c6f5d8b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,9 +91,9 @@ wws-project = { path = "./crates/project" } wws-panel = { path = "./crates/panel" } wws-api-manage = { path = "./crates/api-manage" } wws-api-manage-openapi = { path = "./crates/api-manage-openapi" } -wasmtime = "10.0.2" -wasmtime-wasi = "10.0.2" -wasmtime-wasi-nn = "10.0.2" -wasi-common = "10.0.2" +wasmtime = "13.0.0" +wasmtime-wasi = "13.0.0" +wasmtime-wasi-nn = "13.0.0" +wasi-common = "13.0.0" path-slash = "0.2.1" openssl = { version = "=0.10.55" } diff --git a/crates/runtimes/src/modules/external.rs b/crates/runtimes/src/modules/external.rs index 4ced4544..a41f85ef 100644 --- a/crates/runtimes/src/modules/external.rs +++ b/crates/runtimes/src/modules/external.rs @@ -90,13 +90,16 @@ impl Runtime for ExternalRuntime { /// Mount the source code in the WASI context so it can be /// processed by the engine - fn prepare_wasi_ctx(&self, builder: WasiCtxBuilder) -> Result { - let dir = Dir::open_ambient_dir(&self.store.folder, ambient_authority())?; - + fn prepare_wasi_ctx(&self, builder: &mut WasiCtxBuilder) -> Result<()> { builder - .preopened_dir(dir, "/src")? + .preopened_dir( + Dir::open_ambient_dir(&self.store.folder, ambient_authority())?, + "/src", + )? .args(&self.metadata.args) - .map_err(|_| errors::RuntimeError::WasiContextError) + .map_err(|_| errors::RuntimeError::WasiContextError)?; + + Ok(()) } /// Returns a reference to the Wasm module that should diff --git a/crates/runtimes/src/modules/javascript.rs b/crates/runtimes/src/modules/javascript.rs index 0c16a458..9c45895d 100644 --- a/crates/runtimes/src/modules/javascript.rs +++ b/crates/runtimes/src/modules/javascript.rs @@ -46,9 +46,13 @@ impl Runtime for JavaScriptRuntime { /// Mount the source code in the WASI context so it can be /// processed by the engine - fn prepare_wasi_ctx(&self, builder: WasiCtxBuilder) -> Result { - let dir = Dir::open_ambient_dir(&self.store.folder, ambient_authority())?; - Ok(builder.preopened_dir(dir, "/src")?) + fn prepare_wasi_ctx(&self, builder: &mut WasiCtxBuilder) -> Result<()> { + builder.preopened_dir( + Dir::open_ambient_dir(&self.store.folder, ambient_authority())?, + "/src", + )?; + + Ok(()) } /// Returns a reference to the Wasm module that should diff --git a/crates/runtimes/src/runtime.rs b/crates/runtimes/src/runtime.rs index 47d2bdd0..f621f1a2 100644 --- a/crates/runtimes/src/runtime.rs +++ b/crates/runtimes/src/runtime.rs @@ -21,8 +21,8 @@ pub trait Runtime { /// WASI context builder. This allow runtimes to mount /// specific lib folders, source code and adding /// environment variables. - fn prepare_wasi_ctx(&self, builder: WasiCtxBuilder) -> Result { - Ok(builder) + fn prepare_wasi_ctx(&self, _builder: &mut WasiCtxBuilder) -> Result<()> { + Ok(()) } /// Returns a reference raw bytes of the Wasm module that should diff --git a/crates/worker/Cargo.toml b/crates/worker/Cargo.toml index f1092b77..6bade552 100644 --- a/crates/worker/Cargo.toml +++ b/crates/worker/Cargo.toml @@ -25,6 +25,6 @@ wws-data-kv = { workspace = true } wws-runtimes = { workspace = true } # We didn't integrate components yet. For an initial binding implementation, # we will use the wit-bindgen-wasmtime crate maintained by the Fermyon team. -wit-bindgen-wasmtime = { git = "https://github.com/fermyon/wit-bindgen-backport", rev = "b89d5079ba5b07b319631a1b191d2139f126c976" } +wit-bindgen-wasmtime = { git = "https://github.com/fermyon/wit-bindgen-backport", rev = "598cd229bb43baceff9616d16930b8a5a3e79d79" } base64 = "0.21.0" sha256 = "1.1.1" diff --git a/crates/worker/src/lib.rs b/crates/worker/src/lib.rs index f52f5d65..bd14135a 100644 --- a/crates/worker/src/lib.rs +++ b/crates/worker/src/lib.rs @@ -111,13 +111,14 @@ impl Worker { vars.iter().map(|(k, v)| (k.clone(), v.clone())).collect(); // Create the initial WASI context - let mut wasi_builder = WasiCtxBuilder::new() + let mut wasi_builder = WasiCtxBuilder::new(); + wasi_builder .envs(&tuple_vars) .map_err(|_| errors::WorkerError::ConfigureRuntimeError)?; // Configure the stdio let stdio = Stdio::new(&input); - wasi_builder = stdio.configure_wasi_ctx(wasi_builder); + stdio.configure_wasi_ctx(&mut wasi_builder); // Mount folders from the configuration if let Some(folders) = self.config.folders.as_ref() { @@ -125,7 +126,7 @@ impl Worker { if let Some(base) = &self.path.parent() { let dir = Dir::open_ambient_dir(base.join(&folder.from), ambient_authority()) .map_err(|_| errors::WorkerError::ConfigureRuntimeError)?; - wasi_builder = wasi_builder + wasi_builder .preopened_dir(dir, &folder.to) .map_err(|_| errors::WorkerError::ConfigureRuntimeError)?; } else { @@ -145,7 +146,7 @@ impl Worker { eprintln!("❌ The only WASI-NN supported backend name is \"{WASI_NN_BACKEND_OPENVINO}\". Please, update your config."); None } else { - wasmtime_wasi_nn::add_to_linker(&mut linker, |s: &mut WorkerState| { + wasmtime_wasi_nn::witx::add_to_linker(&mut linker, |s: &mut WorkerState| { Arc::get_mut(s.wasi_nn.as_mut().unwrap()) .expect("wasi-nn is not implemented with multi-threading support") }) @@ -155,18 +156,20 @@ impl Worker { ) })?; - Some(Arc::new(WasiNnCtx::new().map_err(|_| { + let (backends, registry) = wasmtime_wasi_nn::preload(&[]).map_err(|_| { errors::WorkerError::RuntimeError( wws_runtimes::errors::RuntimeError::WasiContextError, ) - })?)) + })?; + + Some(Arc::new(WasiNnCtx::new(backends, registry))) } } else { None }; // Pass to the runtime to add any WASI specific requirement - wasi_builder = self.runtime.prepare_wasi_ctx(wasi_builder)?; + self.runtime.prepare_wasi_ctx(&mut wasi_builder)?; let wasi = wasi_builder.build(); let state = WorkerState { diff --git a/crates/worker/src/stdio.rs b/crates/worker/src/stdio.rs index 6e572640..5bd35c50 100644 --- a/crates/worker/src/stdio.rs +++ b/crates/worker/src/stdio.rs @@ -24,7 +24,10 @@ impl Stdio { } } - pub fn configure_wasi_ctx(&self, builder: WasiCtxBuilder) -> WasiCtxBuilder { + pub fn configure_wasi_ctx<'a>( + &self, + builder: &'a mut WasiCtxBuilder, + ) -> &'a mut WasiCtxBuilder { builder .stdin(Box::new(self.stdin.clone())) .stdout(Box::new(self.stdout.clone()))