Skip to content

Commit 7879d59

Browse files
committed
fix: skip importing memfd and rustix crates if std feature is disabled
Signed-off-by: Ho Kim <ho.kim@ulagbulag.io>
1 parent 3dc6b5e commit 7879d59

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/fiber/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ wasmtime-environ = { workspace = true }
1717
wasmtime-versioned-export-macros = { workspace = true }
1818

1919
[target.'cfg(unix)'.dependencies]
20-
rustix = { workspace = true, features = ["mm"] }
21-
libc = { workspace = true }
20+
rustix = { workspace = true, optional = true, features = ["mm"] }
21+
libc = { workspace = true, optional = true }
2222

2323
[target.'cfg(windows)'.dependencies.windows-sys]
2424
workspace = true
@@ -38,4 +38,4 @@ backtrace = "0.3.68"
3838

3939
# Assume presence of the standard library. Allows propagating
4040
# panic-unwinds across fiber invocations.
41-
std = []
41+
std = ["dep:libc", "dep:rustix"]

crates/fiber/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
#![no_std]
99

10-
#[cfg(any(feature = "std", unix, windows))]
10+
#[cfg(feature = "std")]
1111
#[macro_use]
1212
extern crate std;
1313
extern crate alloc;

crates/wasmtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ runtime = [
265265
"dep:cc",
266266
"dep:smallvec",
267267
"dep:mach2",
268-
"dep:memfd",
269268
"dep:wasmtime-versioned-export-macros",
270269
"dep:windows-sys",
271270
"pulley-interpreter/interp",
@@ -347,6 +346,7 @@ std = [
347346
'pulley-interpreter/std',
348347
'wasmtime-core/std',
349348
'addr2line?/std',
349+
"dep:memfd",
350350
"dep:rustix",
351351
"wasmtime-jit-icache-coherence",
352352
"wasmtime-jit-debug?/std",

0 commit comments

Comments
 (0)