From 58dc7a96352f22b960d1cce441330cdebf9e89d9 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Wed, 4 May 2022 22:33:07 +0100 Subject: [PATCH] Make wasi_libc_sys a required dependency of roc_build to fix repl_test --- compiler/build/Cargo.toml | 4 ++-- wasi-libc-sys/src/lib.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/build/Cargo.toml b/compiler/build/Cargo.toml index cf2f32d230..ce102b0e38 100644 --- a/compiler/build/Cargo.toml +++ b/compiler/build/Cargo.toml @@ -31,7 +31,7 @@ libloading = "0.7.1" tempfile = "3.2.0" inkwell = { path = "../../vendor/inkwell", optional = true } target-lexicon = "0.12.3" -wasi_libc_sys = { path = "../../wasi-libc-sys", optional = true } +wasi_libc_sys = { path = "../../wasi-libc-sys" } [target.'cfg(target_os = "macos")'.dependencies] serde_json = "1.0.69" @@ -41,7 +41,7 @@ target-arm = [] target-aarch64 = ["roc_gen_dev/target-aarch64"] target-x86 = [] target-x86_64 = ["roc_gen_dev/target-x86_64"] -target-wasm32 = ["roc_gen_wasm", "wasi_libc_sys"] +target-wasm32 = ["roc_gen_wasm"] # This is a separate feature because when we generate docs on Netlify, # it doesn't have LLVM installed. (Also, it doesn't need to do code gen.) diff --git a/wasi-libc-sys/src/lib.rs b/wasi-libc-sys/src/lib.rs index 566b052ce1..5241f4f764 100644 --- a/wasi-libc-sys/src/lib.rs +++ b/wasi-libc-sys/src/lib.rs @@ -11,9 +11,8 @@ extern "C" { pub fn memset(dst: *mut c_void, ch: i32, n: usize) -> *mut c_void; } +// Tell users of this crate where to find the Wasm .a file // If a non-Wasm target is using this crate, we assume it is a build script that wants to emit Wasm -// Tell it where to find the Wasm .a file -#[cfg(not(target_family = "wasm"))] +// For Wasm target, it won't ever be used, but we expose it just to keep things simple mod generated; -#[cfg(not(target_family = "wasm"))] pub use generated::WASI_LIBC_PATH;