From 476fcb3aab24468dc3d174d0cb712edbddaf843c Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 19 Mar 2026 12:59:55 -0400 Subject: [PATCH] Remove Homebrew LLVM during macOS CI setup The CI runner image may ship with a Homebrew LLVM whose libraries (e.g., an x86_64-only libunwind.dylib in /usr/local/lib) conflict with the Apple SDK and break native linking. The build uses Apple clang from /usr/bin/clang exclusively and does not need Homebrew LLVM. Backport of https://github.com/dotnet/runtime/pull/125763 --- eng/install-native-dependencies.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index f8c9db632860de..d6a530f775eca5 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -44,6 +44,13 @@ case "$os" in export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 # Skip brew update for now, see https://github.com/actions/setup-python/issues/577 # brew update --preinstall + + # Remove Homebrew LLVM if present. The CI runner image may ship with a + # Homebrew LLVM whose libraries (e.g., libunwind.dylib) are the wrong + # architecture or conflict with the Apple SDK, breaking native linking. + # The build uses Apple clang from /usr/bin/clang exclusively. + brew uninstall --ignore-dependencies llvm@18 2>/dev/null || true + brew bundle --no-upgrade --file "$(dirname "$0")/Brewfile" ;;