Skip to content

Commit 4894866

Browse files
authored
Merge branch 'main' into support_arrow_scan
2 parents a70efc1 + 6ba53a7 commit 4894866

File tree

5 files changed

+77
-23
lines changed

5 files changed

+77
-23
lines changed

.github/workflows/build_macos_arm64_wheels.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
jobs:
2323
build_universal_wheel:
2424
name: Build Universal Wheel (macOS ARM64)
25-
runs-on: macos-13-xlarge
25+
runs-on: macos-14-xlarge
2626
steps:
2727
- name: Check machine architecture
2828
run: |
@@ -37,6 +37,17 @@ jobs:
3737
else
3838
echo "This is an x86_64 (Intel) machine"
3939
fi
40+
- name: Free up disk space (Initial)
41+
run: |
42+
# Clean Homebrew cache
43+
brew cleanup -s 2>/dev/null || true
44+
rm -rf "$(brew --cache)" 2>/dev/null || true
45+
sudo rm -rf ~/Library/Developer/Xcode/DerivedData 2>/dev/null || true
46+
sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode 2>/dev/null || true
47+
sudo rm -rf /Users/runner/Library/Android 2>/dev/null || true
48+
sudo rm -rf /tmp/* 2>/dev/null || true
49+
echo "=== Disk usage after cleanup ==="
50+
df -h
4051
- name: Setup pyenv
4152
run: |
4253
curl https://pyenv.run | bash
@@ -93,6 +104,7 @@ jobs:
93104
brew install openssl@3 || echo "OpenSSL install failed, continuing..."
94105
brew install --ignore-dependencies llvm@19
95106
brew install git ninja libtool gettext binutils grep findutils nasm lld@19 libiconv
107+
brew install ccache || echo "ccache installation failed, continuing without it"
96108
brew install go
97109
cd /usr/local/opt/ && sudo rm -f llvm && sudo ln -sf llvm@19 llvm
98110
export PATH=$(brew --prefix llvm@19)/bin:$(brew --prefix lld@19)/bin:$PATH
@@ -115,6 +127,23 @@ jobs:
115127
- name: Update submodules
116128
run: |
117129
git submodule update --init --recursive --jobs 4
130+
- name: Free up disk space (Before compilation)
131+
run: |
132+
echo "=== Disk usage before compilation cleanup ==="
133+
df -h
134+
brew cleanup -s 2>/dev/null || true
135+
rm -rf "$(brew --cache)" 2>/dev/null || true
136+
rm -rf ~/.cache/pip 2>/dev/null || true
137+
rm -rf ~/.pyenv/.cache 2>/dev/null || true
138+
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
139+
echo "=== Disk usage after cleanup ==="
140+
df -h
141+
- name: ccache
142+
uses: hendrikmuhs/[email protected]
143+
with:
144+
key: ${{ runner.os }}-arm64-ccache
145+
max-size: 5G
146+
append-timestamp: true
118147
- name: Run chdb/build.sh
119148
timeout-minutes: 600
120149
run: |
@@ -207,16 +236,23 @@ jobs:
207236
sudo sysctl kern.corefile=$PWD/tmp/core/core.%P
208237
sudo sysctl kern.coredump=1
209238
ulimit -c unlimited
239+
- name: Free up disk space
240+
run: |
241+
# Clean more build artifacts
242+
rm -rf buildlib/contrib 2>/dev/null || true
243+
rm -rf buildlib/base 2>/dev/null || true
244+
rm -rf buildlib/src 2>/dev/null || true
210245
- name: Test wheel on all Python versions
211246
run: |
212247
export PATH="$HOME/.pyenv/bin:$PATH"
213248
eval "$(pyenv init -)"
214249
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
215250
echo "Testing chdb on Python $version"
216251
pyenv shell $version
217-
python -m pip install dist/*.whl --force-reinstall
252+
python -m pip install dist/*.whl --force-reinstall --no-cache-dir
218253
python -c "import chdb; res = chdb.query('select 1112222222,555', 'CSV'); print(f'Python $version: {res}')"
219254
make test
255+
python -m pip uninstall -y chdb
220256
pyenv shell --unset
221257
done
222258
continue-on-error: false

.github/workflows/build_macos_x86_wheels.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ on:
2222
jobs:
2323
build_universal_wheel:
2424
name: Build Universal Wheel (macOS x86_64)
25-
runs-on: macos-14-large
25+
runs-on: macos-15-intel
26+
timeout-minutes: 600
2627
steps:
2728
- name: Check machine architecture
2829
run: |
@@ -43,13 +44,12 @@ jobs:
4344
export PATH="$HOME/.pyenv/bin:$PATH"
4445
eval "$(pyenv init -)"
4546
46-
pyenv install 3.8:latest
4747
pyenv install 3.9:latest
4848
pyenv install 3.10:latest
4949
pyenv install 3.11:latest
5050
pyenv install 3.12:latest
5151
pyenv install 3.13:latest
52-
pyenv global 3.8 3.9 3.10 3.11 3.12 3.13
52+
pyenv global 3.9 3.10 3.11 3.12 3.13
5353
5454
echo "Installed versions:"
5555
pyenv versions
@@ -61,7 +61,7 @@ jobs:
6161
pyenv versions
6262
echo ""
6363
echo "Verifying all required Python versions are available:"
64-
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
64+
for version in 3.9 3.10 3.11 3.12 3.13; do
6565
if ! pyenv versions --bare | grep -q "^$version"; then
6666
echo "ERROR: Python $version is not installed!"
6767
exit 1
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
export PATH="$HOME/.pyenv/bin:$PATH"
7575
eval "$(pyenv init -)"
76-
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
76+
for version in 3.9 3.10 3.11 3.12 3.13; do
7777
echo "Installing dependencies for Python $version"
7878
pyenv shell $version
7979
python -m pip install --upgrade pip
@@ -135,30 +135,39 @@ jobs:
135135
- name: Update submodules
136136
run: |
137137
git submodule update --init --recursive --jobs 4
138+
- name: ccache
139+
uses: hendrikmuhs/[email protected]
140+
with:
141+
key: ${{ runner.os }}-x86_64-ccache
142+
max-size: 10G
143+
append-timestamp: true
144+
env:
145+
CCACHE_NOHASHDIR: "true"
138146
- name: Run chdb/build.sh
139147
timeout-minutes: 600
140148
run: |
141149
export PATH="$HOME/.pyenv/bin:$PATH"
142150
eval "$(pyenv init -)"
143151
source ~/.cargo/env
144-
pyenv shell 3.8
152+
pyenv shell 3.9
145153
export PATH=$(brew --prefix llvm@19)/bin:$(brew --prefix lld@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin
146154
export CC=$(brew --prefix llvm@19)/bin/clang
147155
export CXX=$(brew --prefix llvm@19)/bin/clang++
148156
bash gen_manifest.sh
149157
bash ./chdb/build.sh
150-
pyenv shell 3.8
158+
pyenv shell 3.9
151159
bash -x ./chdb/test_smoke.sh
152160
continue-on-error: false
153161
- name: Run chdb/build/build_static_lib.sh
154162
timeout-minutes: 600
155163
run: |
156-
export PATH=$HOME/.pyenv/bin:$(brew --prefix llvm@19)/bin:$(brew --prefix lld@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin
164+
export PATH="$HOME/.pyenv/bin:$PATH"
165+
eval "$(pyenv init -)"
166+
source ~/.cargo/env
167+
export PATH=$(brew --prefix llvm@19)/bin:$(brew --prefix lld@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin
157168
export CC=$(brew --prefix llvm@19)/bin/clang
158169
export CXX=$(brew --prefix llvm@19)/bin/clang++
159-
source ~/.cargo/env
160-
eval "$(pyenv init -)"
161-
pyenv shell 3.8
170+
pyenv shell 3.9
162171
bash ./chdb/build/build_static_lib.sh
163172
pyenv shell --unset
164173
continue-on-error: false
@@ -215,25 +224,31 @@ jobs:
215224
export PATH=$(brew --prefix llvm@19)/bin:$(brew --prefix lld@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin
216225
export CC=$(brew --prefix llvm@19)/bin/clang
217226
export CXX=$(brew --prefix llvm@19)/bin/clang++
218-
pyenv shell 3.8
227+
pyenv shell 3.9
219228
make wheel
220229
- name: Fix wheel platform tag
221230
run: |
222231
export PATH="$HOME/.pyenv/bin:$PATH"
223232
eval "$(pyenv init -)"
224-
pyenv shell 3.8
233+
pyenv shell 3.9
225234
python -m wheel tags --platform-tag=macosx_10_15_x86_64 --remove dist/*.whl
226235
- name: Setup core dump collection
227236
run: |
228237
mkdir -p tmp/core
229238
sudo sysctl kern.corefile=$PWD/tmp/core/core.%P
230239
sudo sysctl kern.coredump=1
231240
ulimit -c unlimited
241+
- name: Free up disk space
242+
run: |
243+
# Clean more build artifacts
244+
rm -rf buildlib/contrib 2>/dev/null || true
245+
rm -rf buildlib/base 2>/dev/null || true
246+
rm -rf buildlib/src 2>/dev/null || true
232247
- name: Test wheel on all Python versions
233248
run: |
234249
export PATH="$HOME/.pyenv/bin:$PATH"
235250
eval "$(pyenv init -)"
236-
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
251+
for version in 3.9 3.10 3.11 3.12 3.13; do
237252
echo "Testing chdb on Python $version"
238253
pyenv shell $version
239254
python -m pip install dist/*.whl --force-reinstall
@@ -305,7 +320,7 @@ jobs:
305320
run: |
306321
export PATH="$HOME/.pyenv/bin:$PATH"
307322
eval "$(pyenv init -)"
308-
pyenv shell 3.8
323+
pyenv shell 3.9
309324
python -m twine upload dist/*.whl
310325
env:
311326
TWINE_USERNAME: __token__

chdb/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ if [ "$(uname)" == "Darwin" ]; then
3030
# if Darwin ARM64 (M1, M2), disable AVX
3131
if [ "$(uname -m)" == "arm64" ]; then
3232
CPU_FEATURES="-DENABLE_AVX=0 -DENABLE_AVX2=0"
33-
COMPILER_CACHE="-DCOMPILER_CACHE=disabled"
3433
LLVM="-DENABLE_EMBEDDED_COMPILER=0 -DENABLE_DWARF_PARSER=0"
3534
else
3635
LLVM="-DENABLE_EMBEDDED_COMPILER=0 -DENABLE_DWARF_PARSER=0"
@@ -110,7 +109,6 @@ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${build_type} -DENABLE_THINLTO=0 -DENABLE_TESTS=0
110109
${CPU_FEATURES} \
111110
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
112111
-DENABLE_LIBFIU=1 \
113-
${COMPILER_CACHE} \
114112
-DCHDB_VERSION=${CHDB_VERSION} \
115113
"
116114

@@ -239,6 +237,10 @@ ls -lh ${LIBCHDB}
239237

240238
# build chdb python module
241239
py_version="3.8"
240+
# check current os type and architecture for py_version
241+
if [ "$(uname)" == "Darwin" ] && [ "$(uname -m)" == "x86_64" ]; then
242+
py_version="3.9"
243+
fi
242244
current_py_version=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
243245
if [ "$current_py_version" != "$py_version" ]; then
244246
echo "Error: Current Python version is $current_py_version, but required version is $py_version"

chdb/build/build_static_lib.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ if [ "$(uname)" == "Darwin" ]; then
2525
MYSQL="-DENABLE_MYSQL=0"
2626
ICU="-DENABLE_ICU=0"
2727
CPU_FEATURES="-DENABLE_AVX=0 -DENABLE_AVX2=0"
28-
if [ "$(uname -m)" == "arm64" ]; then
29-
COMPILER_CACHE="-DCOMPILER_CACHE=disabled"
30-
fi
3128
elif [ "$(uname)" == "Linux" ]; then
3229
GLIBC_COMPATIBILITY="-DGLIBC_COMPATIBILITY=1"
3330
UNWIND="-DUSE_UNWIND=1"
@@ -69,7 +66,6 @@ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${build_type} -DENABLE_THINLTO=0 -DENABLE_TESTS=0
6966
${CPU_FEATURES} \
7067
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
7168
-DENABLE_LIBFIU=1 \
72-
${COMPILER_CACHE} \
7369
-DCHDB_VERSION=${CHDB_VERSION} \
7470
"
7571

chdb/build_pybind11.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ build_pybind11_nonlimitedapi() {
6464

6565
build_all_pybind11_nonlimitedapi() {
6666
local python_versions=("3.8" "3.9" "3.10" "3.11" "3.12" "3.13")
67+
68+
# Skip Python 3.8 for macOS x86_64
69+
if [ "$(uname)" == "Darwin" ] && [ "$(uname -m)" == "x86_64" ]; then
70+
python_versions=("3.9" "3.10" "3.11" "3.12" "3.13")
71+
fi
6772

6873
echo "Building pybind11 nonlimitedapi libraries for all Python versions..."
6974

0 commit comments

Comments
 (0)