From 3a2b27dcdb628138ebc9c037b1d893b2922c1be9 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Mon, 20 May 2024 19:40:06 +1000 Subject: [PATCH] default to host `libhost` for prebuilt platform binary if target specific not found --- crates/compiler/build/src/link.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/compiler/build/src/link.rs b/crates/compiler/build/src/link.rs index 536b3c49799..c1647661d49 100644 --- a/crates/compiler/build/src/link.rs +++ b/crates/compiler/build/src/link.rs @@ -50,8 +50,15 @@ pub fn legacy_host_file(target: Target, platform_main_roc: &Path) -> PathBuf { .replace(roc_linker::PRECOMPILED_HOST_EXT, lib_ext); let lib_path = platform_main_roc.with_file_name(file_name); + + let default_host_path: PathBuf = platform_main_roc + .with_file_name("libhost") + .with_extension(lib_ext); + if lib_path.exists() { lib_path + } else if default_host_path.exists() { + default_host_path } else { let obj_ext = target.object_file_ext(); lib_path.with_extension(obj_ext)