Skip to content

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

wasmtime-fiber: use `wasmtime_environ::error` instead of `anyhow` (#12206)

Nick Fitzgerald7da79ce36c44
diff --git a/Cargo.lock b/Cargo.lock
index 404df84276..e713d988e8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4858,12 +4858,12 @@ dependencies = [
name = "wasmtime-internal-fiber"
version = "41.0.0"
dependencies = [
- "anyhow",
"backtrace",
"cc",
"cfg-if",
"libc",
"rustix 1.0.8",
+ "wasmtime-environ",
"wasmtime-internal-versioned-export-macros",
"windows-sys 0.61.2",
]
diff --git a/crates/fiber/Cargo.toml b/crates/fiber/Cargo.toml
index 8c2692e0e8..964d37afe4 100644
--- a/crates/fiber/Cargo.toml
+++ b/crates/fiber/Cargo.toml
@@ -12,8 +12,8 @@ rust-version.workspace = true
workspace = true
[dependencies]
-anyhow = { workspace = true }
cfg-if = { workspace = true }
+wasmtime-environ = { workspace = true }
wasmtime-versioned-export-macros = { workspace = true }
[target.'cfg(unix)'.dependencies]
diff --git a/crates/fiber/src/lib.rs b/crates/fiber/src/lib.rs
index c1b4b3e60d..3f8b1ef7f0 100644
--- a/crates/fiber/src/lib.rs
+++ b/crates/fiber/src/lib.rs
@@ -13,10 +13,10 @@ extern crate std;
extern crate alloc;
use alloc::boxed::Box;
-use anyhow::Error;
use core::cell::Cell;
use core::marker::PhantomData;
use core::ops::Range;
+use wasmtime_environ::error::Error;
cfg_if::cfg_if! {
if #[cfg(not(feature = "std"))] {
diff --git a/crates/fiber/src/nostd.rs b/crates/fiber/src/nostd.rs
index c17dc0f3fd..3e824a2d73 100644
--- a/crates/fiber/src/nostd.rs
+++ b/crates/fiber/src/nostd.rs
@@ -33,8 +33,8 @@ use core::cell::Cell;
use core::ops::Range;
// The no_std implementation is infallible in practice, but we use
-// `anyhow::Error` here absent any better alternative.
-pub type Error = anyhow::Error;
+// `wasmtime_environ::error::Error` here absent any better alternative.
+pub type Error = wasmtime_environ::error::Error;
pub struct FiberStack {
base: BasePtr,
@@ -133,7 +133,7 @@ impl Fiber {
// On unsupported platforms `wasmtime_fiber_init` is a panicking shim so
// return an error saying the host architecture isn't supported instead.
if !SUPPORTED_ARCH {
- anyhow::bail!("fibers unsupported on this host architecture");
+ wasmtime_environ::error::bail!("fibers unsupported on this host architecture");
}
unsafe {
let data = Box::into_raw(Box::new(func)).cast();
diff --git a/scripts/publish.rs b/scripts/publish.rs
index 4f8321df52..9ce53d92f0 100644
--- a/scripts/publish.rs
+++ b/scripts/publish.rs
@@ -57,11 +57,11 @@ const CRATES_TO_PUBLISH: &[&str] = &[
"wasmtime-internal-versioned-export-macros",
"wasmtime-internal-slab",
"wasmtime-internal-component-util",
+ "wasmtime-environ",
"wasmtime-internal-wit-bindgen",
"wasmtime-internal-component-macro",
"wasmtime-internal-jit-debug",
"wasmtime-internal-fiber",
- "wasmtime-environ",
"wasmtime-internal-wmemcheck",
"wasmtime-internal-cranelift",
"wasmtime-internal-cache",