Skip to content

Commit 0744262

Browse files
authored
Fix no_std builds on supported targets (#11568)
This commit fixes a conditional in Wasmtime's build script from accidentally considering Unix and Windows targets as being a supported OS with all the bells and whistles. This is only true if the `std` feature is also active. When `std` is disabled the `custom` implementation of OS primitives is used instead meaning that it shouldn't be automatically assumed signals/virtual memory are available. Resolves a build issue found [on Zulip]. [on Zulip]: https://bytecodealliance.zulipchat.com/#narrow/channel/217126-wasmtime/topic/.E2.9C.94.20pulley32.20on.20x86_64-unknown-linux-gnu
1 parent 9d12c5c commit 0744262

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/wasmtime/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ fn main() {
99
let unix = cfg("unix");
1010
let windows = cfg("windows");
1111
let miri = cfg("miri");
12-
let supported_os = unix || windows;
12+
13+
// A boolean indicating whether there's a `sys` module for this platform.
14+
// This is true for `unix` or `windows`, but both of those require the `std`
15+
// feature to also be active so check that too.
16+
let supported_os = (unix || windows) && cfg!(feature = "std");
1317

1418
// Determine if the current host architecture is supported by Cranelift
1519
// meaning that we might be executing native code.

0 commit comments

Comments
 (0)