Skip to content

Commit fdd8f80

Browse files
committed
Upgrade to wasmtime 22.0.0
Signed-off-by: Lann Martin <[email protected]>
1 parent 80d30fd commit fdd8f80

File tree

8 files changed

+966
-1008
lines changed

8 files changed

+966
-1008
lines changed

Cargo.lock

Lines changed: 138 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@ hyper = { version = "1.0.0", features = ["full"] }
134134
reqwest = { version = "0.12", features = ["stream", "blocking"] }
135135
tracing = { version = "0.1", features = ["log"] }
136136

137-
wasi-common-preview1 = { version = "21.0.1", package = "wasi-common", features = [
138-
"tokio",
139-
] }
140-
wasmtime = "21.0.1"
141-
wasmtime-wasi = "21.0.1"
142-
wasmtime-wasi-http = "21.0.1"
137+
wasi-common-preview1 = { version = "22.0.0", package = "wasi-common", features = ["tokio"] }
138+
wasmtime = "22.0.0"
139+
wasmtime-wasi = "22.0.0"
140+
wasmtime-wasi-http = "22.0.0"
143141

144142
spin-componentize = { path = "crates/componentize" }
145143

crates/core/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ pub use store::{Store, StoreBuilder, Wasi, WasiVersion};
4747
pub const DEFAULT_EPOCH_TICK_INTERVAL: Duration = Duration::from_millis(10);
4848

4949
const MB: u64 = 1 << 20;
50-
const GB: u64 = 1 << 30;
51-
const WASM_PAGE_SIZE: u64 = 64 * 1024;
50+
const GB: usize = 1 << 30;
5251

5352
/// Global configuration for `EngineBuilder`.
5453
///
@@ -127,7 +126,7 @@ impl Default for Config {
127126
// Nothing is lost from allowing the maximum size of memory for
128127
// all instance as it's still limited through other the normal
129128
// `StoreLimitsAsync` accounting method too.
130-
.memory_pages(4 * GB / WASM_PAGE_SIZE)
129+
.max_memory_size(4 * GB)
131130
// These numbers are completely arbitrary at something above 0.
132131
.linear_memory_keep_resident((2 * MB) as usize)
133132
.table_keep_resident((MB / 2) as usize);

crates/core/src/store.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,10 @@ impl StoreBuilder {
422422
self.with_wasi(move |wasi| match wasi {
423423
WasiCtxBuilder::Preview1(_) => {}
424424
WasiCtxBuilder::Preview2(ctx) => {
425-
ctx.socket_addr_check(move |addr, _| net_pool.check_addr(addr).is_ok());
425+
ctx.socket_addr_check(move |addr, _| {
426+
let net_pool = net_pool.clone();
427+
Box::pin(async move { net_pool.check_addr(&addr).is_ok() })
428+
});
426429
}
427430
});
428431

0 commit comments

Comments
 (0)