From ba158603feb677b4cddcb8f7f935c0fff1f90afa Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Fri, 27 Sep 2024 09:04:37 +0200 Subject: [PATCH] Make clang a normal tool on mac If we find a **known to be compatible** tool, we use it, otherwise we do not play tricks just to stay on the latest version provided by brew. --- arrow.sh | 20 ++++++++------------ clang.sh | 3 +++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/arrow.sh b/arrow.sh index d1b1661750..4951acbb41 100644 --- a/arrow.sh +++ b/arrow.sh @@ -5,7 +5,7 @@ source: https://github.com/alisw/arrow.git requires: - boost - lz4 - - Clang:(?!.*osx) + - Clang - protobuf - utf8proc - OpenSSL:(?!osx) @@ -19,6 +19,7 @@ build_requires: - double-conversion - re2 - alibuild-recipe-tools + - ninja env: ARROW_HOME: "$ARROW_ROOT" --- @@ -58,17 +59,12 @@ esac mkdir -p ./src_tmp rsync -a --exclude='**/.git' --delete --delete-excluded "$SOURCEDIR/" ./src_tmp/ - case $ARCHITECTURE in osx*) - # use default llvm from homebrew if available - if [ -d "$(brew --prefix llvm)" ]; then - CLANG_EXECUTABLE="$(brew --prefix llvm)/bin/clang" - else - # fall back to llvm@17 - if [ -d "$(brew --prefix llvm)@17" ]; then - CLANG_EXECUTABLE="$(brew --prefix llvm)@17/bin/clang" - fi + # use compatible llvm@18 from brew, if available. This + # must match the prefer_system_check in clang.sh + if [ -d "$(brew --prefix llvm)@18" ]; then + CLANG_EXECUTABLE="$(brew --prefix llvm)@18/bin/clang" fi ;; *) @@ -81,6 +77,7 @@ esac cmake ./src_tmp/cpp \ ${CMAKE_SHARED_LINKER_FLAGS:+-DCMAKE_SHARED_LINKER_FLAGS="$CMAKE_SHARED_LINKER_FLAGS"} \ -DARROW_DEPENDENCY_SOURCE=SYSTEM \ + -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ ${CXXSTD:+-DCMAKE_CXX_STANDARD=$CXXSTD} \ -DBUILD_SHARED_LIBS=TRUE \ @@ -125,8 +122,7 @@ cmake ./src_tmp/cpp -DCLANG_EXECUTABLE="$CLANG_EXECUTABLE" \ ${GCC_TOOLCHAIN_REVISION:+-DGCC_TOOLCHAIN_ROOT=`find "$GCC_TOOLCHAIN_ROOT/lib" -name crtbegin.o -exec dirname {} \;`} -make ${JOBS:+-j $JOBS} -make install +cmake --build . -- ${JOBS:+-j $JOBS} install find "$INSTALLROOT/share" -name '*-gdb.py' -exec mv {} "$INSTALLROOT/lib" \; # Modulefile diff --git a/clang.sh b/clang.sh index 6d9759431b..c5bb69ca58 100644 --- a/clang.sh +++ b/clang.sh @@ -12,6 +12,9 @@ build_requires: - ninja env: LLVM_ROOT: "$CLANG_ROOT" # needed by LLVMAlt +prefer_system: (osx.*) +prefer_system_check: + test -d $(brew --prefix llvm@18) --- #!/bin/bash -e