From f8c05a37a53c001baff36277e13658844d54a1cb Mon Sep 17 00:00:00 2001 From: Ho Kim Date: Thu, 5 Feb 2026 19:05:24 +0000 Subject: [PATCH] fix: skip importing `memfd` and `rustix` crates if `std` feature is disabled Signed-off-by: Ho Kim --- crates/fiber/Cargo.toml | 6 +++--- crates/fiber/src/lib.rs | 2 +- crates/wasmtime/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/fiber/Cargo.toml b/crates/fiber/Cargo.toml index 964d37afe497..a44d2da3d8cb 100644 --- a/crates/fiber/Cargo.toml +++ b/crates/fiber/Cargo.toml @@ -17,8 +17,8 @@ wasmtime-environ = { workspace = true } wasmtime-versioned-export-macros = { workspace = true } [target.'cfg(unix)'.dependencies] -rustix = { workspace = true, features = ["mm"] } -libc = { workspace = true } +rustix = { workspace = true, optional = true, features = ["mm"] } +libc = { workspace = true, optional = true } [target.'cfg(windows)'.dependencies.windows-sys] workspace = true @@ -38,4 +38,4 @@ backtrace = "0.3.68" # Assume presence of the standard library. Allows propagating # panic-unwinds across fiber invocations. -std = [] +std = ["dep:libc", "dep:rustix"] diff --git a/crates/fiber/src/lib.rs b/crates/fiber/src/lib.rs index 3f8b1ef7f089..8b3427f991f9 100644 --- a/crates/fiber/src/lib.rs +++ b/crates/fiber/src/lib.rs @@ -7,7 +7,7 @@ #![no_std] -#[cfg(any(feature = "std", unix, windows))] +#[cfg(feature = "std")] #[macro_use] extern crate std; extern crate alloc; diff --git a/crates/wasmtime/Cargo.toml b/crates/wasmtime/Cargo.toml index 7ff85259586f..3a46ced349cc 100644 --- a/crates/wasmtime/Cargo.toml +++ b/crates/wasmtime/Cargo.toml @@ -265,7 +265,6 @@ runtime = [ "dep:cc", "dep:smallvec", "dep:mach2", - "dep:memfd", "dep:wasmtime-versioned-export-macros", "dep:windows-sys", "pulley-interpreter/interp", @@ -347,6 +346,7 @@ std = [ 'pulley-interpreter/std', 'wasmtime-core/std', 'addr2line?/std', + "dep:memfd", "dep:rustix", "wasmtime-jit-icache-coherence", "wasmtime-jit-debug?/std",