Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions .github/workflows/be-ut-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concurrency:
jobs:
run-ut:
name: BE UT (macOS)
runs-on: macos-13
runs-on: macos-15-intel
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -44,6 +44,7 @@ jobs:
with:
filters: |
be_changes:
- '.github/workflows/be-ut-mac.yml'
- 'be/**'
- 'gensrc/proto/**'
- 'gensrc/thrift/**'
Expand Down Expand Up @@ -80,21 +81,48 @@ jobs:
'openjdk@11'
'maven'
'node'
'llvm@16'
'llvm@18'
'libomp'
)
brew install "${cellars[@]}" || true
# The Intel runner exposes Homebrew's latest fmt from /usr/local/include,
# which can shadow the branch-pinned fmt shipped in the Doris thirdparty bundle.
brew unlink fmt || true

pushd thirdparty
branch="${{ github.base_ref }}"
case "$(uname -m)" in
arm64) asset="doris-thirdparty-prebuilt-darwin-arm64.tar.xz" ;;
x86_64) asset="doris-thirdparty-prebuilt-darwin-x86_64.tar.xz" ;;
*) echo "Unsupported macOS architecture: $(uname -m)" >&2; exit 1 ;;
esac
common_url="https://github.com/apache/doris-thirdparty/releases/download/automation/${asset}"
if [[ -z "${branch}" ]] || [[ "${branch}" == 'master' ]]; then
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz \
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
curl -fL "${common_url}" -o "${asset}"
else
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz" \
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
branch_url="https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/${asset}"
if ! curl -fL "${branch_url}" -o "${asset}"; then
echo "::warning::No branch-specific macOS thirdparty asset for ${branch}; using automation"
curl -fL "${common_url}" -o "${asset}"
fi
fi
tar -xvf doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
tar -xvf "${asset}"
popd

export JAVA_HOME="${JAVA_HOME_17_X64%\/}"
export JAVA_HOME
JAVA_HOME="$(/usr/libexec/java_home -v 17)"

LLVM_PREFIX="$(brew --prefix llvm@18)"
export PATH="${LLVM_PREFIX}/bin:${PATH}"
export DORIS_CLANG_HOME="${LLVM_PREFIX}"
export CC="${LLVM_PREFIX}/bin/clang"
export CXX="${LLVM_PREFIX}/bin/clang++"

LIBOMP_PREFIX="$(brew --prefix libomp)"
export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}"
export CFLAGS="-I${LIBOMP_PREFIX}/include ${CFLAGS:-}"
export CXXFLAGS="-I${LIBOMP_PREFIX}/include ${CXXFLAGS:-}"
export LDFLAGS="-L${LIBOMP_PREFIX}/lib ${LDFLAGS:-}"
export EXTRA_CXX_FLAGS="-I${LIBOMP_PREFIX}/include ${EXTRA_CXX_FLAGS:-}"

./run-be-ut.sh --run -j "$(nproc)" --clean
9 changes: 6 additions & 3 deletions be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,11 @@ if (ENABLE_PCH)
find_package(OpenMP QUIET)
if (OpenMP_CXX_FOUND OR OpenMP_FOUND)
if (DEFINED OpenMP_CXX_FLAGS AND NOT OpenMP_CXX_FLAGS STREQUAL "")
separate_arguments(OPENMP_CXX_FLAG_LIST NATIVE_COMMAND "${OpenMP_CXX_FLAGS}")
# Apply the OpenMP flags to all C++ compilations so PCH and all TUs match.
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${OpenMP_CXX_FLAGS}>)
foreach(OPENMP_CXX_FLAG IN LISTS OPENMP_CXX_FLAG_LIST)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${OPENMP_CXX_FLAG}>)
endforeach()
endif()
# Ensure final link includes the OpenMP runtime when needed.
if (TARGET OpenMP::OpenMP_CXX)
Expand All @@ -864,7 +867,7 @@ if (ENABLE_PCH)
target_link_libraries(pch PUBLIC OpenMP::OpenMP_CXX)
# Also add flags explicitly to be robust if usage requirements don’t apply during PCH.
if (DEFINED OpenMP_CXX_FLAGS AND NOT OpenMP_CXX_FLAGS STREQUAL "")
target_compile_options(pch PUBLIC ${OpenMP_CXX_FLAGS})
target_compile_options(pch PUBLIC ${OPENMP_CXX_FLAG_LIST})
endif()
# Copy usage requirements from the imported OpenMP target onto PCH.
if (TARGET OpenMP::OpenMP_CXX)
Expand All @@ -883,7 +886,7 @@ if (ENABLE_PCH)
endif()
endif()
if (COMPILER_CLANG)
target_compile_options(pch PRIVATE -Xclang -fno-pch-timestamp)
target_compile_options(pch PRIVATE "SHELL:-Xclang -fno-pch-timestamp")
endif()
endif()

Expand Down
Loading