From a9089d94501a828fc1ce23c088b03bcd0cec7f37 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Feb 2023 09:30:21 -0600 Subject: [PATCH] Update to Wasmtime 6.0.0 (#226) * Update to Wasmtime 6.0.0 This is a PR ahead of Wasmtime's actual 6.0.0 release to turn the CI cranks. The updates in Wasmtime 6.0.0 were the removal of the `PoolingAllocationStrategy` enumeration in favor of a `max_unused_warm_slots` knob and additionally dropping the `Store` requirement on the creation of an `InstancePre`. * Update to the 6.0.0 Wasmtime release --- Cargo.lock | 157 +++++++++++++++++---------------- cli/tests/trap-test/Cargo.lock | 157 +++++++++++++++++---------------- lib/Cargo.toml | 10 +-- lib/src/execute.rs | 17 ++-- lib/src/linking.rs | 18 +--- lib/src/session.rs | 23 ----- 6 files changed, 173 insertions(+), 209 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83ba20d3..e9511438 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -289,25 +289,25 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3d54eab028f5805ae3b26fd60eca3f3a9cfb76b989d9bab173be3f61356cc3" +checksum = "91b18cf92869a6ae85cde3af4bc4beb6154efa8adef03b18db2ad413d5bce3a2" dependencies = [ - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", ] [[package]] name = "cranelift-codegen" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be1d5f2c3cca1efb691844bc1988b89c77291f13f778499a3f3c0cf49c0ed61" +checksum = "567d9f6e919bac076f39b902a072686eaf9e6d015baa34d10a61b85105b7af59" dependencies = [ "arrayvec", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "cranelift-isle", "gimli", "hashbrown", @@ -319,18 +319,18 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9b1b1089750ce4005893af7ee00bb08a2cf1c9779999c0f7164cbc8ad2e0d2" +checksum = "1e72b2d5ec8917b2971fe83850187373d0a186db4748a7c23a5f48691b8d92bb" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5fbaec51de47297fd7304986fd53c8c0030abbe69728a60d72e1c63559318d" +checksum = "3461c0e0c2ebbeb92533aacb27e219289f60dc84134ef34fbf2d77c9eddf07ef" [[package]] name = "cranelift-entity" @@ -340,18 +340,18 @@ checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" [[package]] name = "cranelift-entity" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab984c94593f876090fae92e984bdcc74d9b1acf740ab5f79036001c65cba13" +checksum = "af684f7f7b01427b1942c7102673322a51b9d6f261e9663dc5e5595786775531" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0cb3102d21a2fe5f3210af608748ddd0cd09825ac12d42dc56ed5ed8725fe0" +checksum = "7d361ed0373cf5f086b49c499aa72227b646a64f899f32e34312f97c0fadff75" dependencies = [ "cranelift-codegen", "log", @@ -361,15 +361,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72101dd1f441d629735143c41e00b3428f9267738176983ef588ff43382af0a0" +checksum = "cef4f8f3984d772c199a48896d2fb766f96301bf71b371e03a2b99f4f3b7b931" [[package]] name = "cranelift-native" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22b0d9fcbe3fc5a1af9e7021b44ce42b930bcefac446ce22e02e8f9a0d67120" +checksum = "f98e4e99a353703475d5acb402b9c13482d41d8a4008b352559bd560afb90363" dependencies = [ "cranelift-codegen", "libc", @@ -378,12 +378,12 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddebe32fb14fbfd9efa5f130ffb8f4665795de019928dcd7247b136c46f9249" +checksum = "a1e3f4f0779a1b0f286a6ef19835d8665f88326e656a6d7d84fa9a39fa38ca32" dependencies = [ "cranelift-codegen", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "cranelift-frontend", "itertools", "log", @@ -2191,9 +2191,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11254257c965082b671fb876e63a69c25af8d68b2b742d785593192b28df87a8" +checksum = "6f7c5b2a394b5f6affc28f3b6c08010cd03458cdb7509b02a6a70771f6873635" dependencies = [ "anyhow", "async-trait", @@ -2215,9 +2215,9 @@ dependencies = [ [[package]] name = "wasi-common" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c08c84016536b2407809253aa6c47eacf86d5b5ecd7741b50d23f18b5bb045" +checksum = "101bb1e5f6cf20b27055006af27f9c6e6a09084469d197ec0cb5884da38968a7" dependencies = [ "anyhow", "bitflags", @@ -2288,18 +2288,18 @@ checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-encoder" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ab2fe77b325731603297debb4573e002d06ae0aa1f4dc108585c81961e0609" +checksum = "1c3e4bc09095436c8e7584d86d33e6c3ee67045af8fb262cbb9cc321de553428" dependencies = [ "leb128", ] [[package]] name = "wasmparser" -version = "0.96.0" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adde01ade41ab9a5d10ec8ed0bb954238cf8625b5cd5a13093d6de2ad9c2be1a" +checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" dependencies = [ "indexmap", "url", @@ -2307,9 +2307,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5b183a159484980138cc05231419c536d395a7b25c1802091310ea2f74276a" +checksum = "9010891d0b8e367c3be94ca35d7bc25c1de3240463bb1d61bcfc8c2233c4e0d0" dependencies = [ "anyhow", "async-trait", @@ -2339,18 +2339,18 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb1cb256d76cf07b20264c808351c8b525ece56de1ef4d93f87a0aaf342db" +checksum = "65805c663eaa8257b910666f6d4b056b5c7329750da754ba5df54f3af7dbf35c" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830570847f905b8f6d2ca635c33cf42ce701dd8e4abd7d1806c631f8f06e9e4b" +checksum = "2049ddfc1b10efc3c5591d0e84b9570ca50478f8818f3bfabb1a467918f53fb4" dependencies = [ "anyhow", "base64", @@ -2368,10 +2368,11 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841561f7792cc46eea82dcf296393c5bab03259e663ff1bfccf71c2ae30e8920" +checksum = "9086679497e0a0b441d47ebb4781def9fed3d224feee913464a9a9e2950bac89" dependencies = [ + "anyhow", "proc-macro2", "quote", "syn", @@ -2382,19 +2383,19 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048583c2e765cac3e8842dd18a50d4feb3049ef3f182880db6626d6eb8a29383" +checksum = "6a3dd61938af6e06b60b9c5b916b48c9d2b77102e80559fcb4e5afb0c5f5bfdf" [[package]] name = "wasmtime-cranelift" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7695d3814dcb508bf4d1c181a86ea6b97a209f6444478e95d86e2ffab8d1a3" +checksum = "3f9065cad6a724fa838ec8497567e0b23acc26417bb2449f8d9d2021925c72f2" dependencies = [ "anyhow", "cranelift-codegen", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "cranelift-frontend", "cranelift-native", "cranelift-wasm", @@ -2409,12 +2410,12 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a2a5f0fb93aa837a727a48dd1076e8a9f882cc2fee20b433c04a18740ff63b" +checksum = "4f964bb0b91fa021b8d1b488c62cc77b346c1dae6e3ebd010050b57c1f2ca657" dependencies = [ "anyhow", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "gimli", "indexmap", "log", @@ -2428,9 +2429,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00a5cbf3ee623d01edea8882eb4352a5370513c6c1942cc5cd56dd806293a8d" +checksum = "9172517a3331b2a486266f7e16b637b27db6cdf5cddf7d055cd145da14cada46" dependencies = [ "cc", "cfg-if", @@ -2441,9 +2442,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c78f9fb2922dbb5a95f009539d4badb44866caeeb53d156bf2cf4d683c3afd" +checksum = "b7a1d06f5d109539e0168fc74fa65e3948ac8dac3bb8cdbd08b62b36a0ae27b8" dependencies = [ "addr2line", "anyhow", @@ -2466,9 +2467,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cacdb52a77b8c8e744e510beeabf0bd698b1c94c59eed33c52b3fbd19639b0" +checksum = "f76ef2e410329aaf8555ac6571d6fe07711be0646dcdf7ff3ab750a42ed2e583" dependencies = [ "object", "once_cell", @@ -2477,9 +2478,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08fcba5ebd96da2a9f0747ab6337fe9788adfb3f63fa2c180520d665562d257e" +checksum = "ec1fd0f0dd79e7cc0f55b102e320d7c77ab76cd272008a8fd98e25b5777e2636" dependencies = [ "cfg-if", "libc", @@ -2488,9 +2489,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0793210acf50d4c69182c916abaee1d423dc5d172cdfde6acfea2f9446725940" +checksum = "271aef9b4ca2e953a866293683f2db33cda46f6933c5e431e68d8373723d4ab6" dependencies = [ "anyhow", "cc", @@ -2513,11 +2514,11 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d015ba8b231248a811e323cf7a525cd3f982d4be0b9e62d27685102e5f12b1" +checksum = "b18144b0e45479a830ac9fcebfc71a16d90dc72d8ebd5679700eb3bfe974d7df" dependencies = [ - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "serde", "thiserror", "wasmparser", @@ -2525,9 +2526,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1271c6ec6585929986d059fc2e2365e7033e32ae3bc761ed4715fd47128308" +checksum = "4b1bc5cfbbfb4636702aa95d164f8f53bafb9c13e531789edc9e1ce5d4066b29" dependencies = [ "anyhow", "wasi-cap-std-sync", @@ -2538,9 +2539,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi-nn" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f762a24843d205f6c1d167c9b3ab7896b142e59b12571f699e8724735dcc05c" +checksum = "4193d23bf92cfde360d981b1bcf49baca7799730e44817bfb4ea012b4772675d" dependencies = [ "anyhow", "openvino", @@ -2551,9 +2552,9 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51b1f66bc176d85b4bfa0c86731f270697f6e0e673878846c7f2971ab895652" +checksum = "92eb1c58cfa115b29e04ff3882ecbd1c8b6db3639b200c72418be5fd43eab3ff" dependencies = [ "anyhow", "heck", @@ -2571,9 +2572,9 @@ dependencies = [ [[package]] name = "wast" -version = "51.0.0" +version = "53.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f621e6e9af96438d3e05f0699da5b1dae59f2df964a2982166aa9b03c5b599" +checksum = "8244fa24196b1d8fd3ca4a96a3a164c40f846498c5deab6caf414c67340ca4af" dependencies = [ "leb128", "memchr", @@ -2583,11 +2584,11 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.53" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd18c1168d7e8743d9b4f713c0203924f5dcc4a3983eb5e584de9614f9fccde" +checksum = "4620f1059add6dad511decb9d5d88b4a0a0d3e2e315ed34f79b0dc0dce18aa4b" dependencies = [ - "wast 51.0.0", + "wast 53.0.0", ] [[package]] @@ -2612,9 +2613,9 @@ dependencies = [ [[package]] name = "wiggle" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d256f306e99e90343029170d81154319a976292c35eba68b05792532fa365e" +checksum = "07ac5d1216c18d8ee0a6bf37509d2061b17c8c5b11c405b0073108a041438f05" dependencies = [ "anyhow", "async-trait", @@ -2628,9 +2629,9 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a0e55a87dcb350634c9f9b3ec08bfc87d7b05a0303a5fe8bb3134452ba3b62f" +checksum = "ebca53f8c1f32e202dfd63f0b18bf01a5a9680e526b626758aa7678af04b2c18" dependencies = [ "anyhow", "heck", @@ -2643,9 +2644,9 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b70901617926a441dbb03f3d208bd02b3fffbda13cadd9b17e7cf9389d9c067e" +checksum = "f3bec97d55f7a62d8d45d76fff91af294196b4aa9d1f45cd6784a964c84c067f" dependencies = [ "proc-macro2", "quote", @@ -2754,15 +2755,17 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.3.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703eb1d2f89ff2c52d50f7ff002735e423cea75f0a5dc5c8a4626c4c47cd9ca6" +checksum = "6e0fe225a32528b42a7037add1b5ed1dff83288f21a067007b34565ce87fc2c7" dependencies = [ "anyhow", "id-arena", "indexmap", + "log", "pulldown-cmark", "unicode-xid", + "url", ] [[package]] diff --git a/cli/tests/trap-test/Cargo.lock b/cli/tests/trap-test/Cargo.lock index be246c15..69786e4e 100644 --- a/cli/tests/trap-test/Cargo.lock +++ b/cli/tests/trap-test/Cargo.lock @@ -292,25 +292,25 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3d54eab028f5805ae3b26fd60eca3f3a9cfb76b989d9bab173be3f61356cc3" +checksum = "91b18cf92869a6ae85cde3af4bc4beb6154efa8adef03b18db2ad413d5bce3a2" dependencies = [ - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", ] [[package]] name = "cranelift-codegen" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be1d5f2c3cca1efb691844bc1988b89c77291f13f778499a3f3c0cf49c0ed61" +checksum = "567d9f6e919bac076f39b902a072686eaf9e6d015baa34d10a61b85105b7af59" dependencies = [ "arrayvec", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "cranelift-isle", "gimli", "hashbrown", @@ -322,18 +322,18 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9b1b1089750ce4005893af7ee00bb08a2cf1c9779999c0f7164cbc8ad2e0d2" +checksum = "1e72b2d5ec8917b2971fe83850187373d0a186db4748a7c23a5f48691b8d92bb" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5fbaec51de47297fd7304986fd53c8c0030abbe69728a60d72e1c63559318d" +checksum = "3461c0e0c2ebbeb92533aacb27e219289f60dc84134ef34fbf2d77c9eddf07ef" [[package]] name = "cranelift-entity" @@ -343,18 +343,18 @@ checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" [[package]] name = "cranelift-entity" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab984c94593f876090fae92e984bdcc74d9b1acf740ab5f79036001c65cba13" +checksum = "af684f7f7b01427b1942c7102673322a51b9d6f261e9663dc5e5595786775531" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0cb3102d21a2fe5f3210af608748ddd0cd09825ac12d42dc56ed5ed8725fe0" +checksum = "7d361ed0373cf5f086b49c499aa72227b646a64f899f32e34312f97c0fadff75" dependencies = [ "cranelift-codegen", "log", @@ -364,15 +364,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72101dd1f441d629735143c41e00b3428f9267738176983ef588ff43382af0a0" +checksum = "cef4f8f3984d772c199a48896d2fb766f96301bf71b371e03a2b99f4f3b7b931" [[package]] name = "cranelift-native" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22b0d9fcbe3fc5a1af9e7021b44ce42b930bcefac446ce22e02e8f9a0d67120" +checksum = "f98e4e99a353703475d5acb402b9c13482d41d8a4008b352559bd560afb90363" dependencies = [ "cranelift-codegen", "libc", @@ -381,12 +381,12 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.92.0" +version = "0.93.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddebe32fb14fbfd9efa5f130ffb8f4665795de019928dcd7247b136c46f9249" +checksum = "a1e3f4f0779a1b0f286a6ef19835d8665f88326e656a6d7d84fa9a39fa38ca32" dependencies = [ "cranelift-codegen", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "cranelift-frontend", "itertools", "log", @@ -2210,9 +2210,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11254257c965082b671fb876e63a69c25af8d68b2b742d785593192b28df87a8" +checksum = "6f7c5b2a394b5f6affc28f3b6c08010cd03458cdb7509b02a6a70771f6873635" dependencies = [ "anyhow", "async-trait", @@ -2234,9 +2234,9 @@ dependencies = [ [[package]] name = "wasi-common" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c08c84016536b2407809253aa6c47eacf86d5b5ecd7741b50d23f18b5bb045" +checksum = "101bb1e5f6cf20b27055006af27f9c6e6a09084469d197ec0cb5884da38968a7" dependencies = [ "anyhow", "bitflags", @@ -2307,18 +2307,18 @@ checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-encoder" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ab2fe77b325731603297debb4573e002d06ae0aa1f4dc108585c81961e0609" +checksum = "1c3e4bc09095436c8e7584d86d33e6c3ee67045af8fb262cbb9cc321de553428" dependencies = [ "leb128", ] [[package]] name = "wasmparser" -version = "0.96.0" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adde01ade41ab9a5d10ec8ed0bb954238cf8625b5cd5a13093d6de2ad9c2be1a" +checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" dependencies = [ "indexmap", "url", @@ -2326,9 +2326,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5b183a159484980138cc05231419c536d395a7b25c1802091310ea2f74276a" +checksum = "9010891d0b8e367c3be94ca35d7bc25c1de3240463bb1d61bcfc8c2233c4e0d0" dependencies = [ "anyhow", "async-trait", @@ -2358,18 +2358,18 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb1cb256d76cf07b20264c808351c8b525ece56de1ef4d93f87a0aaf342db" +checksum = "65805c663eaa8257b910666f6d4b056b5c7329750da754ba5df54f3af7dbf35c" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830570847f905b8f6d2ca635c33cf42ce701dd8e4abd7d1806c631f8f06e9e4b" +checksum = "2049ddfc1b10efc3c5591d0e84b9570ca50478f8818f3bfabb1a467918f53fb4" dependencies = [ "anyhow", "base64", @@ -2387,10 +2387,11 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841561f7792cc46eea82dcf296393c5bab03259e663ff1bfccf71c2ae30e8920" +checksum = "9086679497e0a0b441d47ebb4781def9fed3d224feee913464a9a9e2950bac89" dependencies = [ + "anyhow", "proc-macro2", "quote", "syn", @@ -2401,19 +2402,19 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048583c2e765cac3e8842dd18a50d4feb3049ef3f182880db6626d6eb8a29383" +checksum = "6a3dd61938af6e06b60b9c5b916b48c9d2b77102e80559fcb4e5afb0c5f5bfdf" [[package]] name = "wasmtime-cranelift" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7695d3814dcb508bf4d1c181a86ea6b97a209f6444478e95d86e2ffab8d1a3" +checksum = "3f9065cad6a724fa838ec8497567e0b23acc26417bb2449f8d9d2021925c72f2" dependencies = [ "anyhow", "cranelift-codegen", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "cranelift-frontend", "cranelift-native", "cranelift-wasm", @@ -2428,12 +2429,12 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a2a5f0fb93aa837a727a48dd1076e8a9f882cc2fee20b433c04a18740ff63b" +checksum = "4f964bb0b91fa021b8d1b488c62cc77b346c1dae6e3ebd010050b57c1f2ca657" dependencies = [ "anyhow", - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "gimli", "indexmap", "log", @@ -2447,9 +2448,9 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00a5cbf3ee623d01edea8882eb4352a5370513c6c1942cc5cd56dd806293a8d" +checksum = "9172517a3331b2a486266f7e16b637b27db6cdf5cddf7d055cd145da14cada46" dependencies = [ "cc", "cfg-if", @@ -2460,9 +2461,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c78f9fb2922dbb5a95f009539d4badb44866caeeb53d156bf2cf4d683c3afd" +checksum = "b7a1d06f5d109539e0168fc74fa65e3948ac8dac3bb8cdbd08b62b36a0ae27b8" dependencies = [ "addr2line", "anyhow", @@ -2485,9 +2486,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cacdb52a77b8c8e744e510beeabf0bd698b1c94c59eed33c52b3fbd19639b0" +checksum = "f76ef2e410329aaf8555ac6571d6fe07711be0646dcdf7ff3ab750a42ed2e583" dependencies = [ "object", "once_cell", @@ -2496,9 +2497,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08fcba5ebd96da2a9f0747ab6337fe9788adfb3f63fa2c180520d665562d257e" +checksum = "ec1fd0f0dd79e7cc0f55b102e320d7c77ab76cd272008a8fd98e25b5777e2636" dependencies = [ "cfg-if", "libc", @@ -2507,9 +2508,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0793210acf50d4c69182c916abaee1d423dc5d172cdfde6acfea2f9446725940" +checksum = "271aef9b4ca2e953a866293683f2db33cda46f6933c5e431e68d8373723d4ab6" dependencies = [ "anyhow", "cc", @@ -2532,11 +2533,11 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d015ba8b231248a811e323cf7a525cd3f982d4be0b9e62d27685102e5f12b1" +checksum = "b18144b0e45479a830ac9fcebfc71a16d90dc72d8ebd5679700eb3bfe974d7df" dependencies = [ - "cranelift-entity 0.92.0", + "cranelift-entity 0.93.0", "serde", "thiserror", "wasmparser", @@ -2544,9 +2545,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1271c6ec6585929986d059fc2e2365e7033e32ae3bc761ed4715fd47128308" +checksum = "4b1bc5cfbbfb4636702aa95d164f8f53bafb9c13e531789edc9e1ce5d4066b29" dependencies = [ "anyhow", "wasi-cap-std-sync", @@ -2557,9 +2558,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi-nn" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f762a24843d205f6c1d167c9b3ab7896b142e59b12571f699e8724735dcc05c" +checksum = "4193d23bf92cfde360d981b1bcf49baca7799730e44817bfb4ea012b4772675d" dependencies = [ "anyhow", "openvino", @@ -2570,9 +2571,9 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51b1f66bc176d85b4bfa0c86731f270697f6e0e673878846c7f2971ab895652" +checksum = "92eb1c58cfa115b29e04ff3882ecbd1c8b6db3639b200c72418be5fd43eab3ff" dependencies = [ "anyhow", "heck", @@ -2590,9 +2591,9 @@ dependencies = [ [[package]] name = "wast" -version = "51.0.0" +version = "53.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f621e6e9af96438d3e05f0699da5b1dae59f2df964a2982166aa9b03c5b599" +checksum = "8244fa24196b1d8fd3ca4a96a3a164c40f846498c5deab6caf414c67340ca4af" dependencies = [ "leb128", "memchr", @@ -2602,11 +2603,11 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.53" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd18c1168d7e8743d9b4f713c0203924f5dcc4a3983eb5e584de9614f9fccde" +checksum = "4620f1059add6dad511decb9d5d88b4a0a0d3e2e315ed34f79b0dc0dce18aa4b" dependencies = [ - "wast 51.0.0", + "wast 53.0.0", ] [[package]] @@ -2631,9 +2632,9 @@ dependencies = [ [[package]] name = "wiggle" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d256f306e99e90343029170d81154319a976292c35eba68b05792532fa365e" +checksum = "07ac5d1216c18d8ee0a6bf37509d2061b17c8c5b11c405b0073108a041438f05" dependencies = [ "anyhow", "async-trait", @@ -2647,9 +2648,9 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a0e55a87dcb350634c9f9b3ec08bfc87d7b05a0303a5fe8bb3134452ba3b62f" +checksum = "ebca53f8c1f32e202dfd63f0b18bf01a5a9680e526b626758aa7678af04b2c18" dependencies = [ "anyhow", "heck", @@ -2662,9 +2663,9 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b70901617926a441dbb03f3d208bd02b3fffbda13cadd9b17e7cf9389d9c067e" +checksum = "f3bec97d55f7a62d8d45d76fff91af294196b4aa9d1f45cd6784a964c84c067f" dependencies = [ "proc-macro2", "quote", @@ -2773,15 +2774,17 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.3.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703eb1d2f89ff2c52d50f7ff002735e423cea75f0a5dc5c8a4626c4c47cd9ca6" +checksum = "6e0fe225a32528b42a7037add1b5ed1dff83288f21a067007b34565ce87fc2c7" dependencies = [ "anyhow", "id-arena", "indexmap", + "log", "pulldown-cmark", "unicode-xid", + "url", ] [[package]] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index da2df405..79c9bd1d 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -50,12 +50,12 @@ toml = "^0.5.9" tracing = "^0.1.37" tracing-futures = "^0.2.5" url = "^2.3.1" -wasi-common = "^5.0.0" -wasmtime = "^5.0.0" -wasmtime-wasi = "^5.0.0" -wasmtime-wasi-nn = "^5.0.0" +wasi-common = "^6.0.0" +wasmtime = "^6.0.0" +wasmtime-wasi = "^6.0.0" +wasmtime-wasi-nn = "^6.0.0" webpki = "^0.21.0" -wiggle = "^5.0.0" +wiggle = "^6.0.0" [dev-dependencies] tempfile = "^3.2.0" diff --git a/lib/src/execute.rs b/lib/src/execute.rs index 92309ead..52a1098b 100644 --- a/lib/src/execute.rs +++ b/lib/src/execute.rs @@ -8,7 +8,7 @@ use { config::{Backends, Dictionaries, ExperimentalModule, Geolocation}, downstream::prepare_request, error::ExecutionError, - linking::{create_store, dummy_store, link_host_functions, WasmCtx}, + linking::{create_store, link_host_functions, WasmCtx}, object_store::ObjectStores, secret_store::SecretStores, session::Session, @@ -75,9 +75,7 @@ impl ExecuteCtx { let mut linker = Linker::new(&engine); link_host_functions(&mut linker, &wasi_modules)?; let module = Module::from_file(&engine, module_path)?; - - let mut dummy_store = dummy_store(&engine); - let instance_pre = linker.instantiate_pre(&mut dummy_store, &module)?; + let instance_pre = linker.instantiate_pre(&module)?; Ok(Self { engine, @@ -409,8 +407,7 @@ impl ExecuteCtx { fn configure_wasmtime(profiling_strategy: ProfilingStrategy) -> wasmtime::Config { use wasmtime::{ - Config, InstanceAllocationStrategy, PoolingAllocationConfig, PoolingAllocationStrategy, - WasmBacktraceDetails, + Config, InstanceAllocationStrategy, PoolingAllocationConfig, WasmBacktraceDetails, }; let mut config = Config::new(); @@ -440,10 +437,10 @@ fn configure_wasmtime(profiling_strategy: ProfilingStrategy) -> wasmtime::Config // function can end up in the table pooling_allocation_config.instance_table_elements(98765); - // Number of instances: the pool will allocate virtual memory for this - // many instances, which limits the number of requests which can be - // handled concurrently. - pooling_allocation_config.strategy(PoolingAllocationStrategy::NextAvailable); + // Maximum number of slots in the pooling allocator to keep "warm", or those + // to keep around to possibly satisfy an affine allocation request or an + // instantiation of a module previously instantiated within the pool. + pooling_allocation_config.max_unused_warm_slots(100); config.allocation_strategy(InstanceAllocationStrategy::Pooling( pooling_allocation_config, diff --git a/lib/src/linking.rs b/lib/src/linking.rs index a0609a60..26524332 100644 --- a/lib/src/linking.rs +++ b/lib/src/linking.rs @@ -8,7 +8,7 @@ use { anyhow::Context, std::collections::HashSet, wasi_common::{pipe::WritePipe, WasiCtx}, - wasmtime::{Engine, Linker, Store}, + wasmtime::{Linker, Store}, wasmtime_wasi::WasiCtxBuilder, wasmtime_wasi_nn::WasiNnCtx, }; @@ -59,22 +59,6 @@ pub(crate) fn create_store( Ok(store) } -/// Create a `Store` which will only be used to check whether pre-initialization is -/// possible, and never used to execute code -pub(crate) fn dummy_store(engine: &Engine) -> Store { - let wasi = WasiCtxBuilder::new().build(); - let wasi_nn = WasiNnCtx::new().unwrap(); - let session = Session::mock(); - Store::new( - engine, - WasmCtx { - wasi, - wasi_nn, - session, - }, - ) -} - /// Constructs a fresh `WasiCtx` for _each_ incoming request. fn make_wasi_ctx(ctx: &ExecuteCtx, session: &Session) -> Result { let mut wasi_ctx = WasiCtxBuilder::new(); diff --git a/lib/src/session.rs b/lib/src/session.rs index 41f1d69a..70e1ccee 100644 --- a/lib/src/session.rs +++ b/lib/src/session.rs @@ -171,29 +171,6 @@ impl Session { } } - /// We need to create a Session in order to typecheck a module into an - /// InstancePre, but we will never actually execute code that accesses the - /// Session. Therefore, all of the data inside this Session is bogus. - /// - /// Do not use the Session created by this constructor for any other - /// purpose. - pub(crate) fn mock() -> Session { - let (sender, _receiver) = tokio::sync::oneshot::channel(); - Session::new( - 0, - Request::new(Body::empty()), - sender, - "0.0.0.0".parse().unwrap(), - Arc::new(HashMap::new()), - Arc::new(Geolocation::new()), - TlsConfig::new().unwrap(), - Arc::new(HashMap::new()), - Arc::new(None), - Arc::new(ObjectStores::new()), - Arc::new(SecretStores::new()), - ) - } - // ----- Downstream Request API ----- /// Retrieve the downstream client IP address associated with this session.