From 00aab152d51be9c7ffd520ab9ec17de0324c8110 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 06:02:40 +0800 Subject: [PATCH 01/14] chore(ci): migrate branch-4.1 macOS runner from retired image --- .github/workflows/be-ut-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 4f3db038dbab83..f2ddc358bac163 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -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 From 5cd92b9078055490b540d508e61be1aa5952f232 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 06:11:15 +0800 Subject: [PATCH 02/14] test(ci): run macOS BE UT for workflow changes --- .github/workflows/be-ut-mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index f2ddc358bac163..27593ec9e0a261 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -44,6 +44,7 @@ jobs: with: filters: | be_changes: + - '.github/workflows/be-ut-mac.yml' - 'be/**' - 'gensrc/proto/**' - 'gensrc/thrift/**' From ff7fb9e21c47a88d6cafbbd31ee3c77abb1a9362 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 06:24:21 +0800 Subject: [PATCH 03/14] fix(ci): fall back to common macOS thirdparty asset --- .github/workflows/be-ut-mac.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 27593ec9e0a261..c51b2641853f8b 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -87,14 +87,18 @@ jobs: pushd thirdparty branch="${{ github.base_ref }}" + asset="doris-thirdparty-prebuilt-darwin-x86_64.tar.xz" + 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%\/}" From d7dd194483bbef3a20ca3658d8fefda467e2b07c Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 06:33:23 +0800 Subject: [PATCH 04/14] fix(ci): configure Homebrew OpenMP on macOS 15 --- .github/workflows/be-ut-mac.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index c51b2641853f8b..50b7f3359629cc 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -82,6 +82,7 @@ jobs: 'maven' 'node' 'llvm@16' + 'libomp' ) brew install "${cellars[@]}" || true @@ -102,4 +103,12 @@ jobs: popd export JAVA_HOME="${JAVA_HOME_17_X64%\/}" + + 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 From e481a22901bc33a4c6d66b27cce4fa078b10b950 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 06:54:35 +0800 Subject: [PATCH 05/14] fix(build): split multi-part OpenMP compiler flags --- be/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index 3d6fb25f7f1101..149e7283534a85 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -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($<$:${OpenMP_CXX_FLAGS}>) + foreach(OPENMP_CXX_FLAG IN LISTS OPENMP_CXX_FLAG_LIST) + add_compile_options($<$:${OPENMP_CXX_FLAG}>) + endforeach() endif() # Ensure final link includes the OpenMP runtime when needed. if (TARGET OpenMP::OpenMP_CXX) @@ -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) From 26d119548a7024a84d5fac4f3f3bb6632eaa75fe Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 07:14:10 +0800 Subject: [PATCH 06/14] fix(build): preserve grouped Clang PCH option --- be/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index 149e7283534a85..48d0ab71fc66cd 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -886,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() From 12fd20d319bd4999f46c7a89eb430515b46ec8bb Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 07:37:18 +0800 Subject: [PATCH 07/14] fix(ci): prefer bundled fmt on Intel macOS --- .github/workflows/be-ut-mac.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 50b7f3359629cc..7984f6ac657e21 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -85,6 +85,9 @@ jobs: '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 }}" From 72e105f1916269197440e32e627300f3416abcf2 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 08:10:47 +0800 Subject: [PATCH 08/14] [chore](ci) Pin branch macOS UT to LLVM 16 --- .github/workflows/be-ut-mac.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 7984f6ac657e21..4ea7ad7e1ec2d9 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -107,6 +107,10 @@ jobs: export JAVA_HOME="${JAVA_HOME_17_X64%\/}" + # llvm@16 is intentionally installed for this branch, but it is keg-only. + # Pin Doris to it instead of the macOS 15 image's AppleClang 17 toolchain. + export DORIS_CLANG_HOME="$(brew --prefix llvm@16)" + LIBOMP_PREFIX="$(brew --prefix libomp)" export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}" export CFLAGS="-I${LIBOMP_PREFIX}/include ${CFLAGS:-}" From 6d70ab2889fe83c56700e1da12a30ff067b3cb82 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 08:48:52 +0800 Subject: [PATCH 09/14] [chore](ci) Pin branch macOS UT to Xcode 16.0 --- .github/workflows/be-ut-mac.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 4ea7ad7e1ec2d9..7e5d527e5266e8 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -107,9 +107,10 @@ jobs: export JAVA_HOME="${JAVA_HOME_17_X64%\/}" - # llvm@16 is intentionally installed for this branch, but it is keg-only. - # Pin Doris to it instead of the macOS 15 image's AppleClang 17 toolchain. - export DORIS_CLANG_HOME="$(brew --prefix llvm@16)" + # Keep the branch on the oldest Xcode supported by macos-15-intel. + # The default Xcode 16.4 exposes AppleClang 17/libc++ behavior that + # branch-4.1 does not compile with. + sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer LIBOMP_PREFIX="$(brew --prefix libomp)" export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}" From a8829c596723e4dcebd54e6e3d53a7b2e7df0b4f Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 09:19:31 +0800 Subject: [PATCH 10/14] [chore](ci) Use macOS 14 bridge for branch UT --- .github/workflows/be-ut-mac.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 7e5d527e5266e8..d78ca1da69e0d8 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -29,7 +29,7 @@ concurrency: jobs: run-ut: name: BE UT (macOS) - runs-on: macos-15-intel + runs-on: macos-14 steps: - name: Checkout uses: actions/checkout@v3 @@ -107,10 +107,9 @@ jobs: export JAVA_HOME="${JAVA_HOME_17_X64%\/}" - # Keep the branch on the oldest Xcode supported by macos-15-intel. - # The default Xcode 16.4 exposes AppleClang 17/libc++ behavior that - # branch-4.1 does not compile with. - sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer + # Match the retired macos-13 image's Xcode generation while branch-4.1 + # is made compatible with the newer macOS 15 libc++ toolchain. + sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer LIBOMP_PREFIX="$(brew --prefix libomp)" export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}" From 5983fc4fc2040029ba4b14458a9d82ee3fa31dba Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 09:25:52 +0800 Subject: [PATCH 11/14] fix(ci): select macOS runtime assets by architecture --- .github/workflows/be-ut-mac.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index d78ca1da69e0d8..c20becc83cd93b 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -91,7 +91,11 @@ jobs: pushd thirdparty branch="${{ github.base_ref }}" - asset="doris-thirdparty-prebuilt-darwin-x86_64.tar.xz" + 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 -fL "${common_url}" -o "${asset}" @@ -105,7 +109,8 @@ jobs: tar -xvf "${asset}" popd - export JAVA_HOME="${JAVA_HOME_17_X64%\/}" + export JAVA_HOME + JAVA_HOME="$(/usr/libexec/java_home -v 17)" # Match the retired macos-13 image's Xcode generation while branch-4.1 # is made compatible with the newer macOS 15 libc++ toolchain. From 49eaf49324da077919d9c5871f02892de3c86f83 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 09:43:45 +0800 Subject: [PATCH 12/14] fix(ci): satisfy branch macOS Clang minimum --- .github/workflows/be-ut-mac.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index c20becc83cd93b..194088c88de693 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -112,9 +112,8 @@ jobs: export JAVA_HOME JAVA_HOME="$(/usr/libexec/java_home -v 17)" - # Match the retired macos-13 image's Xcode generation while branch-4.1 - # is made compatible with the newer macOS 15 libc++ toolchain. - sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer + # branch-4.1 requires Clang 16 or newer. + sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer LIBOMP_PREFIX="$(brew --prefix libomp)" export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}" From 2a484f749ec5be5305fc9e65806e592cffb0aeed Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 09:51:09 +0800 Subject: [PATCH 13/14] fix(ci): use current Intel Clang toolchain --- .github/workflows/be-ut-mac.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index 194088c88de693..a71703e1ef4f5f 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -29,7 +29,7 @@ concurrency: jobs: run-ut: name: BE UT (macOS) - runs-on: macos-14 + runs-on: macos-15-intel steps: - name: Checkout uses: actions/checkout@v3 @@ -81,7 +81,7 @@ jobs: 'openjdk@11' 'maven' 'node' - 'llvm@16' + 'llvm@18' 'libomp' ) brew install "${cellars[@]}" || true @@ -112,8 +112,10 @@ jobs: export JAVA_HOME JAVA_HOME="$(/usr/libexec/java_home -v 17)" - # branch-4.1 requires Clang 16 or newer. - sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer + LLVM_PREFIX="$(brew --prefix llvm@18)" + export PATH="${LLVM_PREFIX}/bin:${PATH}" + export CC="${LLVM_PREFIX}/bin/clang" + export CXX="${LLVM_PREFIX}/bin/clang++" LIBOMP_PREFIX="$(brew --prefix libomp)" export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}" From 5a5efdbb991cfd6c1e8e9a1de529248258bbab39 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Thu, 30 Jul 2026 10:21:41 +0800 Subject: [PATCH 14/14] fix(ci): bind Doris build to LLVM 18 --- .github/workflows/be-ut-mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/be-ut-mac.yml b/.github/workflows/be-ut-mac.yml index a71703e1ef4f5f..e7edafe3eb8a6c 100644 --- a/.github/workflows/be-ut-mac.yml +++ b/.github/workflows/be-ut-mac.yml @@ -114,6 +114,7 @@ jobs: 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++"