diff --git a/cli/src/build.rs b/cli/src/build.rs index 6ad0b58a5a..0ccf118178 100644 --- a/cli/src/build.rs +++ b/cli/src/build.rs @@ -255,13 +255,6 @@ pub fn build_file<'a>( } else if matches!(link_type, LinkType::None) { // Just copy the object file to the output folder. binary_path.set_extension(app_extension); - - if cfg!(target_os = "macos") { - // See https://apple.stackexchange.com/a/428388 - // for why we need to remove the file before copying it. - std::fs::remove_file(&binary_path).unwrap(); - } - std::fs::copy(app_o_file, &binary_path).unwrap(); BuildOutcome::NoProblems } else { @@ -353,13 +346,6 @@ fn spawn_rebuild_thread( if surgically_link { // Copy preprocessed host to executable location. let prehost = host_input_path.with_file_name("preprocessedhost"); - - if cfg!(target_os = "macos") { - // See https://apple.stackexchange.com/a/428388 - // for why we need to remove the file before copying it. - std::fs::remove_file(&binary_path).unwrap(); - } - std::fs::copy(prehost, binary_path.as_path()).unwrap(); } let rebuild_host_end = rebuild_host_start.elapsed().unwrap(); diff --git a/compiler/build/src/link.rs b/compiler/build/src/link.rs index c5ae5af003..a7e32d0328 100644 --- a/compiler/build/src/link.rs +++ b/compiler/build/src/link.rs @@ -499,13 +499,6 @@ pub fn rebuild_host( if shared_lib_path.is_some() { // For surgical linking, just copy the dynamically linked rust app. - - if cfg!(target_os = "macos") { - // See https://apple.stackexchange.com/a/428388 - // for why we need to remove the file before copying it. - std::fs::remove_file(&host_dest_native).unwrap(); - } - std::fs::copy(cargo_out_dir.join("host"), host_dest_native).unwrap(); } else { // Cargo hosts depend on a c wrapper for the api. Compile host.c as well.