fix: use path finder everywhere, fix get_relative_path() call

This commit is contained in:
Ryan Barth 2024-06-23 12:02:50 -07:00
parent 96ac005632
commit 1858fc90e1
No known key found for this signature in database
GPG key ID: E00C3713D9ED3943

View file

@ -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,