Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Migrate wasi-config to `wasmtime::error` (#12292)

Nick Fitzgeraldfa3791931228
diff --git a/Cargo.lock b/Cargo.lock
index cafb4c17d4..5a47cff797 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5098,7 +5098,6 @@ dependencies = [
name = "wasmtime-wasi-config"
version = "42.0.0"
dependencies = [
- "anyhow",
"test-programs-artifacts",
"tokio",
"wasmtime",
diff --git a/crates/wasi-config/Cargo.toml b/crates/wasi-config/Cargo.toml
index 81bd61ef71..b2e0a79875 100644
--- a/crates/wasi-config/Cargo.toml
+++ b/crates/wasi-config/Cargo.toml
@@ -12,7 +12,6 @@ description = "Wasmtime implementation of the wasi-config API"
workspace = true
[dependencies]
-anyhow = { workspace = true }
wasmtime = { workspace = true, features = ["runtime", "component-model"] }
[dev-dependencies]
diff --git a/crates/wasi-config/src/lib.rs b/crates/wasi-config/src/lib.rs
index 186fad8ebc..5f7443cb6c 100644
--- a/crates/wasi-config/src/lib.rs
+++ b/crates/wasi-config/src/lib.rs
@@ -66,8 +66,8 @@
#![deny(missing_docs)]
-use anyhow::Result;
use std::collections::HashMap;
+use wasmtime::Result;
use wasmtime::component::HasData;
mod gen_ {
diff --git a/crates/wasi-config/tests/main.rs b/crates/wasi-config/tests/main.rs
index ec798025ed..38b29e1d87 100644
--- a/crates/wasi-config/tests/main.rs
+++ b/crates/wasi-config/tests/main.rs
@@ -1,8 +1,8 @@
-use anyhow::{Result, anyhow};
use test_programs_artifacts::{CONFIG_GET_COMPONENT, foreach_config};
use wasmtime::{
- Store,
+ Result, Store,
component::{Component, Linker, ResourceTable},
+ format_err,
};
use wasmtime_wasi::p2::{add_to_linker_async, bindings::Command};
use wasmtime_wasi::{WasiCtx, WasiCtxBuilder, WasiCtxView, WasiView};
@@ -41,7 +41,7 @@ async fn run_wasi(path: &str, ctx: Ctx) -> Result<()> {
.wasi_cli_run()
.call_run(&mut store)
.await?
- .map_err(|()| anyhow!("command returned with failing exit status"))
+ .map_err(|()| format_err!("command returned with failing exit status"))
}
macro_rules! assert_test_exists {