From 58d13dc467d95ba4fe4ed96992d16ee1649af34d Mon Sep 17 00:00:00 2001 From: Kalen Krempely Date: Fri, 5 Sep 2025 14:18:47 -0700 Subject: [PATCH] =?UTF-8?q?fix=20build=20on=20newer=20arm=20based=20mac?= =?UTF-8?q?=E2=80=99s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On MacOS 15 with arm aarch64 there is no need to use homebrew as the default llvm works. Newer mac users can still have brew installed including these particular formulas. And in fact building on newer mac’s with homebrew’s llvm leads to conflicts as the linker uses macOS libc++ runtime which are are not ABI compatible leading to errors like `Undefined symbols for architecture arm64: "std::__1::__hash_memory`. Tighten the cfg attribute to only be run for older intel mac machines. --- lightgbm-sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightgbm-sys/build.rs b/lightgbm-sys/build.rs index 4cd93a4..711c381 100644 --- a/lightgbm-sys/build.rs +++ b/lightgbm-sys/build.rs @@ -45,7 +45,7 @@ fn main() { #[cfg(feature = "cuda")] let mut dst = dst.define("USE_CUDA", "1").define("USE_CUDA_EXP", "1"); - #[cfg(target_os = "macos")] + #[cfg(all(target_os = "macos", target_arch = "x86_64"))] { let path = PathBuf::from("/opt/homebrew/"); // check for m1 vs intel config if let Ok(_dir) = std::fs::read_dir(&path) {