From 1858fc90e15dd1363b67ec7907aadc543f09a0bb Mon Sep 17 00:00:00 2001 From: Ryan Barth Date: Sun, 23 Jun 2024 12:02:50 -0700 Subject: [PATCH] fix: use path finder everywhere, fix get_relative_path() call --- crates/compiler/build/src/link.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/compiler/build/src/link.rs b/crates/compiler/build/src/link.rs index 8eb9c411ae..41cd465b12 100644 --- a/crates/compiler/build/src/link.rs +++ b/crates/compiler/build/src/link.rs @@ -127,7 +127,7 @@ fn find_wasi_libc_path() -> PathBuf { } // This path is available in the release tarball - match get_relative_path(Path::new("wasi-libc.a")) { + match get_relative_path(Path::new("lib/wasi-libc.a")) { Some(path) if path.exists() => return path, _ => (), } @@ -1352,12 +1352,14 @@ pub fn preprocess_host_wasm32(host_input_path: &Path, preprocessed_host_path: &P let builtins_host_tempfile = roc_bitcode::host_wasm_tempfile() .expect("failed to write host builtins object to tempfile"); + let wasi_libc_path = find_wasi_libc_path(); + let mut zig_cmd = zig(); let args = &[ "wasm-ld", builtins_host_tempfile.path().to_str().unwrap(), host_input, - WASI_LIBC_PATH, + wasi_libc_path.to_str().unwrap(), WASI_COMPILER_RT_PATH, // builtins need __multi3, __udivti3, __fixdfti "-o", output_file,