Skip to content

Commit 255ed67

Browse files
authored
Merge pull request #3141 from alexcrichton/update-wamstime
Update to Wasmtime 33.0.0
2 parents b7e1a22 + 9e23c7d commit 255ed67

File tree

26 files changed

+436
-407
lines changed

26 files changed

+436
-407
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,19 @@ toml_edit = "0.22"
168168
tracing = { version = "0.1", features = ["log"] }
169169
url = "2"
170170
walkdir = "2"
171-
wasi-common-preview1 = { version = "32.0.0", package = "wasi-common", features = [
171+
wasi-common-preview1 = { version = "33.0.0", package = "wasi-common", features = [
172172
"tokio",
173173
] }
174-
wasm-encoder = "0.229"
175-
wasm-metadata = "0.229"
174+
wasm-encoder = "0.230"
175+
wasm-metadata = "0.230"
176176
wasm-pkg-client = "0.10"
177177
wasm-pkg-common = "0.10"
178-
wasmparser = "0.229"
179-
wasmtime = "32.0.0"
180-
wasmtime-wasi = "32.0.0"
181-
wasmtime-wasi-http = "32.0.0"
182-
wit-component = "0.229"
183-
wit-parser = "0.229"
178+
wasmparser = "0.230"
179+
wasmtime = "33.0.0"
180+
wasmtime-wasi = "33.0.0"
181+
wasmtime-wasi-http = "33.0.0"
182+
wit-component = "0.230"
183+
wit-parser = "0.230"
184184

185185
spin-componentize = { path = "crates/componentize" }
186186

crates/componentize/src/abi_conformance/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ use wasmtime::{
3636
component::{Component, InstancePre, Linker},
3737
Engine, Store,
3838
};
39-
use wasmtime_wasi::{
40-
pipe::MemoryOutputPipe, IoView, ResourceTable, WasiCtx, WasiCtxBuilder, WasiView,
41-
};
39+
use wasmtime_wasi::p2::{pipe::MemoryOutputPipe, IoView, WasiCtx, WasiCtxBuilder, WasiView};
40+
use wasmtime_wasi::ResourceTable;
4241

4342
pub use test_key_value::KeyValueReport;
4443
pub use test_llm::LlmReport;
@@ -164,7 +163,7 @@ pub async fn test(
164163
test_config: TestConfig,
165164
) -> Result<Report> {
166165
let mut linker = Linker::<Context>::new(engine);
167-
wasmtime_wasi::add_to_linker_async(&mut linker)?;
166+
wasmtime_wasi::p2::add_to_linker_async(&mut linker)?;
168167
http::add_to_linker(&mut linker, |context| &mut context.http)?;
169168
redis::add_to_linker(&mut linker, |context| &mut context.redis)?;
170169
postgres::add_to_linker(&mut linker, |context| &mut context.postgres)?;
@@ -291,8 +290,10 @@ async fn run_command(
291290
match store.data().test_config.invocation_style {
292291
InvocationStyle::InboundHttp => {
293292
let func = instance
294-
.get_export(&mut *store, None, "fermyon:spin/inbound-http")
295-
.and_then(|i| instance.get_export(&mut *store, Some(&i), "handle-request"))
293+
.get_export_index(&mut *store, None, "fermyon:spin/inbound-http")
294+
.and_then(|i| {
295+
instance.get_export_index(&mut *store, Some(&i), "handle-request")
296+
})
296297
.ok_or_else(|| {
297298
anyhow!("no fermyon:spin/inbound-http/handle-request function was found")
298299
})?;

crates/componentize/src/abi_conformance/test_inbound_http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub(crate) async fn test(
1515
let instance = pre.instantiate_async(&mut store).await?;
1616

1717
let func = instance
18-
.get_export(&mut store, None, "fermyon:spin/inbound-http")
19-
.and_then(|i| instance.get_export(&mut store, Some(&i), "handle-request"))
18+
.get_export_index(&mut store, None, "fermyon:spin/inbound-http")
19+
.and_then(|i| instance.get_export_index(&mut store, Some(&i), "handle-request"))
2020
.ok_or_else(|| {
2121
anyhow!("no fermyon:spin/inbound-http/handle-request function was found")
2222
})?;

crates/componentize/src/abi_conformance/test_inbound_redis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub(crate) async fn test(
1515
let instance = pre.instantiate_async(&mut store).await?;
1616

1717
let func = instance
18-
.get_export(&mut store, None, "fermyon:spin/inbound-redis")
19-
.and_then(|i| instance.get_export(&mut store, Some(&i), "handle-message"))
18+
.get_export_index(&mut store, None, "fermyon:spin/inbound-redis")
19+
.and_then(|i| instance.get_export_index(&mut store, Some(&i), "handle-message"))
2020
.ok_or_else(|| {
2121
anyhow!("no fermyon:spin/inbound-redis/handle-message function was found")
2222
})?;

crates/componentize/src/abi_conformance/test_wasi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::{
1919
};
2020
use wasmtime::{component::InstancePre, Engine};
2121
use wasmtime_wasi::{
22-
pipe::{MemoryInputPipe, MemoryOutputPipe},
22+
p2::pipe::{MemoryInputPipe, MemoryOutputPipe},
2323
HostWallClock,
2424
};
2525

crates/componentize/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ mod tests {
254254
use std::{path::PathBuf, process};
255255

256256
use anyhow::Context;
257-
use wasmtime_wasi::pipe::MemoryOutputPipe;
257+
use wasmtime_wasi::p2::pipe::MemoryOutputPipe;
258258

259259
use {
260260
super::abi_conformance::{
@@ -267,10 +267,10 @@ mod tests {
267267
component::{Component, Linker},
268268
Config, Engine, Store,
269269
},
270-
wasmtime_wasi::{
271-
bindings::Command, pipe::MemoryInputPipe, IoView, ResourceTable, WasiView,
270+
wasmtime_wasi::p2::{
271+
bindings::Command, pipe::MemoryInputPipe, IoView, WasiCtx, WasiCtxBuilder, WasiView,
272272
},
273-
wasmtime_wasi::{WasiCtx, WasiCtxBuilder},
273+
wasmtime_wasi::ResourceTable,
274274
};
275275

276276
async fn run_spin(module: &[u8]) -> Result<()> {
@@ -371,7 +371,7 @@ mod tests {
371371
}
372372

373373
let mut linker = Linker::<Wasi>::new(&engine);
374-
wasmtime_wasi::add_to_linker_async(&mut linker)?;
374+
wasmtime_wasi::p2::add_to_linker_async(&mut linker)?;
375375
let mut ctx = WasiCtxBuilder::new();
376376
let stdout = MemoryOutputPipe::new(1024);
377377
ctx.stdin(MemoryInputPipe::new("So rested he by the Tumtum tree"))

crates/core/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ impl Config {
5555
///
5656
/// [docs]: https://docs.wasmtime.dev/cli-cache.html
5757
pub fn enable_cache(&mut self, config_path: &Option<PathBuf>) -> Result<()> {
58-
match config_path {
59-
Some(p) => self.inner.cache_config_load(p)?,
60-
None => self.inner.cache_config_load_default()?,
61-
};
58+
self.inner
59+
.cache(Some(wasmtime::Cache::from_file(config_path.as_deref())?));
6260

6361
Ok(())
6462
}

crates/core/tests/integration_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ async fn run_test(
158158
let instance = instance_pre.instantiate_async(&mut store).await?;
159159
let func = {
160160
let func = instance
161-
.get_export(&mut store, None, "wasi:cli/run@0.2.0")
162-
.and_then(|i| instance.get_export(&mut store, Some(&i), "run"))
161+
.get_export_index(&mut store, None, "wasi:cli/run@0.2.0")
162+
.and_then(|i| instance.get_export_index(&mut store, Some(&i), "run"))
163163
.context("missing the expected 'wasi:cli/run@0.2.0/run' function")?;
164164
instance.get_typed_func::<(), (Result<(), ()>,)>(&mut store, &func)?
165165
};

crates/factor-outbound-http/src/wasi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use spin_factor_outbound_networking::{ComponentTlsConfigs, OutboundAllowedHosts}
99
use spin_factors::{wasmtime::component::ResourceTable, RuntimeFactorsInstanceState};
1010
use tokio::{net::TcpStream, time::timeout};
1111
use tracing::{field::Empty, instrument, Instrument};
12-
use wasmtime_wasi::{IoImpl, IoView};
12+
use wasmtime_wasi::p2::{IoImpl, IoView};
1313
use wasmtime_wasi_http::{
1414
bindings::http::types::ErrorCode,
1515
body::HyperOutgoingBody,

0 commit comments

Comments
 (0)