Repository navigation
137 lines (125 loc) · 5.75 KB
/
Copy pathbe-ut-mac.yml
File metadata and controls
137 lines (125 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: BE UT (macOS)
on:
schedule:
- cron: '0 4 * * *' # daily cache warm-up; PR-level runs moved out to relieve the macOS runner queue
concurrency:
group: ${{ github.ref }} (BE UT macOS)
cancel-in-progress: true
jobs:
run-ut:
name: BE UT (macOS)
runs-on: macos-15
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- name: Ccache ${{ github.ref }}
uses: ./.github/actions/ccache-action
with:
key: BE-UT-macOS
max-size: "5G"
restore-keys: BE-UT-macOS-
- name: Build BE ${{ github.ref }}
run: |
cellars=(
'm4'
'automake'
'autoconf'
'libtool'
'pkg-config'
'texinfo'
'coreutils'
'gnu-getopt'
'python@3'
'cmake'
'ninja'
'ccache'
'bison'
'byacc'
'gettext'
'wget'
'pcre'
'openjdk@11'
'maven'
'node'
# llvm@22 builds the BE (env.sh selects it). llvm@20 builds the
# third-party libraries: build.sh rebuilds them from source when the
# prebuilt archive below is missing one it checks for, and
# thirdparty/build-thirdparty.sh refuses to run on macOS without llvm@20.
'llvm@22'
'llvm@20'
'libomp'
)
brew install "${cellars[@]}" || true
# Match the supported version used by the full thirdparty jobs instead
# of relying on Homebrew's latest CMake.
brew unlink cmake || true
wget https://github.com/Kitware/CMake/releases/download/v3.25.3/cmake-3.25.3-macos-universal.tar.gz
tar -xzf cmake-3.25.3-macos-universal.tar.gz
sudo cp -r cmake-3.25.3-macos-universal/CMake.app/Contents/* /usr/local/
export CUSTOM_CMAKE=/usr/local/bin/cmake
"${CUSTOM_CMAKE}" --version
# macos-15 runners are Apple Silicon (arm64), so download the arm64
# prebuilt thirdparty. Using the x86_64 archive makes the linker ignore
# every thirdparty static library ("found architecture 'x86_64',
# required architecture 'arm64'") and the final BE link fails with
# thousands of undefined symbols.
pushd thirdparty
branch="${{ github.base_ref }}"
if [[ -z "${branch}" ]] || [[ "${branch}" == 'master' ]]; then
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-arm64.tar.xz \
-o doris-thirdparty-prebuilt-darwin-arm64.tar.xz
else
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/doris-thirdparty-prebuilt-darwin-arm64.tar.xz" \
-o doris-thirdparty-prebuilt-darwin-arm64.tar.xz
fi
tar -xvf doris-thirdparty-prebuilt-darwin-arm64.tar.xz
popd
# macos-15 runners are Apple Silicon (arm64), so the JDK env var is
# JAVA_HOME_17_arm64. Fall back to the x64 variable for Intel runners.
JAVA_HOME="${JAVA_HOME_17_arm64:-${JAVA_HOME_17_X64}}"
export JAVA_HOME="${JAVA_HOME%\/}"
# AppleClang ships no OpenMP runtime, so CMake's find_package(OpenMP)
# (e.g. in contrib/openblas) fails with "Could NOT find OpenMP_C" and
# "'omp.h' file not found". Point the compiler/linker at Homebrew's
# libomp. be/CMakeLists.txt resets CMAKE_C_FLAGS/CMAKE_CXX_FLAGS, so
# EXTRA_CXX_FLAGS is also needed to pass the include path to the BE build.
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:-}"
# Only verify that the BE compiles on macOS; do NOT compile be/test.
# The unit tests are built and run locally, not in this job. build.sh
# configures the BE with -DMAKE_TEST=OFF, so nothing under be/test is
# compiled. Skip the Java extensions and cdc client (not relevant to a
# macOS C++ build check), and pass -j explicitly because build.sh
# otherwise defaults to only ~nproc/4 jobs.
#
# Nothing here is ever debugged and no binary is kept, so full DWARF is
# pure cost: line tables alone cut this build by ~12% and shrink the
# objects from 4.25GB to 0.99GB, which also keeps the 5G ccache from
# thrashing between runs.
DISABLE_BE_JAVA_EXTENSIONS=ON DISABLE_BE_CDC_CLIENT=ON \
DORIS_DEV_DEBUG_INFO=line-tables \
./build.sh --be -j "$(nproc)"