From d599b193fb43b4f9fe26eda338cf48a9c5fa7f1e Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:36:01 +0100 Subject: [PATCH] Directly use anyhow rather than wasmtime-environ in wasmtime-jit-icache-coherence This avoids unnecessarily pulling in a lot of wasmtime dependencies for cranelift-jit. wasmtime_environ::error is currently a re-export of anyhow. --- Cargo.lock | 2 +- crates/jit-icache-coherence/Cargo.toml | 2 +- crates/jit-icache-coherence/src/lib.rs | 2 +- crates/jit-icache-coherence/src/libc.rs | 2 +- crates/jit-icache-coherence/src/miri.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5adfd6c34940..b02cc5482935 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4893,9 +4893,9 @@ dependencies = [ name = "wasmtime-internal-jit-icache-coherence" version = "41.0.0" dependencies = [ + "anyhow", "cfg-if", "libc", - "wasmtime-environ", "windows-sys 0.61.2", ] diff --git a/crates/jit-icache-coherence/Cargo.toml b/crates/jit-icache-coherence/Cargo.toml index 14a715edc8c0..97f9ce973c02 100644 --- a/crates/jit-icache-coherence/Cargo.toml +++ b/crates/jit-icache-coherence/Cargo.toml @@ -13,8 +13,8 @@ rust-version.workspace = true workspace = true [dependencies] +anyhow = { workspace = true } cfg-if = { workspace = true } -wasmtime-environ = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies.windows-sys] workspace = true diff --git a/crates/jit-icache-coherence/src/lib.rs b/crates/jit-icache-coherence/src/lib.rs index 2922c4d0d610..a78a99ab847d 100644 --- a/crates/jit-icache-coherence/src/lib.rs +++ b/crates/jit-icache-coherence/src/lib.rs @@ -41,7 +41,7 @@ //! # len: usize, //! # } //! # -//! # fn main() -> wasmtime_environ::error::Result<()> { +//! # fn main() -> anyhow::Result<()> { //! # //! # let run_code = || {}; //! # let code = vec![0u8; 64]; diff --git a/crates/jit-icache-coherence/src/libc.rs b/crates/jit-icache-coherence/src/libc.rs index 656f66bd6787..dd22b872a431 100644 --- a/crates/jit-icache-coherence/src/libc.rs +++ b/crates/jit-icache-coherence/src/libc.rs @@ -4,7 +4,7 @@ use std::ffi::c_void; pub use std::io::Result; #[cfg(not(any(target_os = "linux", target_os = "android")))] -pub use wasmtime_environ::error::Result; +pub use anyhow::Result; #[cfg(all( target_arch = "aarch64", diff --git a/crates/jit-icache-coherence/src/miri.rs b/crates/jit-icache-coherence/src/miri.rs index f42a9293bee3..2056650aff04 100644 --- a/crates/jit-icache-coherence/src/miri.rs +++ b/crates/jit-icache-coherence/src/miri.rs @@ -1,5 +1,5 @@ +pub use anyhow::Result; use std::ffi::c_void; -pub use wasmtime_environ::error::Result; pub(crate) fn pipeline_flush_mt() -> Result<()> { Ok(())