Skip to content

Commit 6ba53a7

Browse files
authored
Merge pull request #398 from chdb-io/auxten-patch-2
2 parents b3c7ee7 + 857107e commit 6ba53a7

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,8 +22,19 @@ 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:
27+
- name: Free up disk space (Initial)
28+
run: |
29+
# Clean Homebrew cache
30+
brew cleanup -s 2>/dev/null || true
31+
rm -rf "$(brew --cache)" 2>/dev/null || true
32+
sudo rm -rf ~/Library/Developer/Xcode/DerivedData 2>/dev/null || true
33+
sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode 2>/dev/null || true
34+
sudo rm -rf /Users/runner/Library/Android 2>/dev/null || true
35+
sudo rm -rf /tmp/* 2>/dev/null || true
36+
echo "=== Disk usage after cleanup ==="
37+
df -h
2738
- name: Setup pyenv
2839
run: |
2940
curl https://pyenv.run | bash
@@ -80,6 +91,7 @@ jobs:
8091
brew install openssl@3 || echo "OpenSSL install failed, continuing..."
8192
brew install --ignore-dependencies llvm@19
8293
brew install git ninja libtool gettext binutils grep findutils nasm lld@19 libiconv
94+
brew install ccache || echo "ccache installation failed, continuing without it"
8395
brew install go
8496
cd /usr/local/opt/ && sudo rm -f llvm && sudo ln -sf llvm@19 llvm
8597
export PATH=$(brew --prefix llvm@19)/bin:$(brew --prefix lld@19)/bin:$PATH
@@ -102,6 +114,23 @@ jobs:
102114
- name: Update submodules
103115
run: |
104116
git submodule update --init --recursive --jobs 4
117+
- name: Free up disk space (Before compilation)
118+
run: |
119+
echo "=== Disk usage before compilation cleanup ==="
120+
df -h
121+
brew cleanup -s 2>/dev/null || true
122+
rm -rf "$(brew --cache)" 2>/dev/null || true
123+
rm -rf ~/.cache/pip 2>/dev/null || true
124+
rm -rf ~/.pyenv/.cache 2>/dev/null || true
125+
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
126+
echo "=== Disk usage after cleanup ==="
127+
df -h
128+
- name: ccache
129+
uses: hendrikmuhs/[email protected]
130+
with:
131+
key: ${{ runner.os }}-arm64-ccache
132+
max-size: 5G
133+
append-timestamp: true
105134
- name: Run chdb/build.sh
106135
timeout-minutes: 600
107136
run: |
@@ -193,16 +222,23 @@ jobs:
193222
sudo sysctl kern.corefile=$PWD/tmp/core/core.%P
194223
sudo sysctl kern.coredump=1
195224
ulimit -c unlimited
225+
- name: Free up disk space
226+
run: |
227+
# Clean more build artifacts
228+
rm -rf buildlib/contrib 2>/dev/null || true
229+
rm -rf buildlib/base 2>/dev/null || true
230+
rm -rf buildlib/src 2>/dev/null || true
196231
- name: Test wheel on all Python versions
197232
run: |
198233
export PATH="$HOME/.pyenv/bin:$PATH"
199234
eval "$(pyenv init -)"
200235
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
201236
echo "Testing chdb on Python $version"
202237
pyenv shell $version
203-
python -m pip install dist/*.whl --force-reinstall
238+
python -m pip install dist/*.whl --force-reinstall --no-cache-dir
204239
python -c "import chdb; res = chdb.query('select 1112222222,555', 'CSV'); print(f'Python $version: {res}')"
205240
make test
241+
python -m pip uninstall -y chdb
206242
pyenv shell --unset
207243
done
208244
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,21 +22,21 @@ 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: Setup pyenv
2829
run: |
2930
curl https://pyenv.run | bash
3031
export PATH="$HOME/.pyenv/bin:$PATH"
3132
eval "$(pyenv init -)"
3233
33-
pyenv install 3.8:latest
3434
pyenv install 3.9:latest
3535
pyenv install 3.10:latest
3636
pyenv install 3.11:latest
3737
pyenv install 3.12:latest
3838
pyenv install 3.13:latest
39-
pyenv global 3.8 3.9 3.10 3.11 3.12 3.13
39+
pyenv global 3.9 3.10 3.11 3.12 3.13
4040
4141
echo "Installed versions:"
4242
pyenv versions
@@ -48,7 +48,7 @@ jobs:
4848
pyenv versions
4949
echo ""
5050
echo "Verifying all required Python versions are available:"
51-
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
51+
for version in 3.9 3.10 3.11 3.12 3.13; do
5252
if ! pyenv versions --bare | grep -q "^$version"; then
5353
echo "ERROR: Python $version is not installed!"
5454
exit 1
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
export PATH="$HOME/.pyenv/bin:$PATH"
6262
eval "$(pyenv init -)"
63-
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
63+
for version in 3.9 3.10 3.11 3.12 3.13; do
6464
echo "Installing dependencies for Python $version"
6565
pyenv shell $version
6666
python -m pip install --upgrade pip
@@ -122,30 +122,39 @@ jobs:
122122
- name: Update submodules
123123
run: |
124124
git submodule update --init --recursive --jobs 4
125+
- name: ccache
126+
uses: hendrikmuhs/[email protected]
127+
with:
128+
key: ${{ runner.os }}-x86_64-ccache
129+
max-size: 10G
130+
append-timestamp: true
131+
env:
132+
CCACHE_NOHASHDIR: "true"
125133
- name: Run chdb/build.sh
126134
timeout-minutes: 600
127135
run: |
128136
export PATH="$HOME/.pyenv/bin:$PATH"
129137
eval "$(pyenv init -)"
130138
source ~/.cargo/env
131-
pyenv shell 3.8
139+
pyenv shell 3.9
132140
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
133141
export CC=$(brew --prefix llvm@19)/bin/clang
134142
export CXX=$(brew --prefix llvm@19)/bin/clang++
135143
bash gen_manifest.sh
136144
bash ./chdb/build.sh
137-
pyenv shell 3.8
145+
pyenv shell 3.9
138146
bash -x ./chdb/test_smoke.sh
139147
continue-on-error: false
140148
- name: Run chdb/build/build_static_lib.sh
141149
timeout-minutes: 600
142150
run: |
143-
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
151+
export PATH="$HOME/.pyenv/bin:$PATH"
152+
eval "$(pyenv init -)"
153+
source ~/.cargo/env
154+
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
144155
export CC=$(brew --prefix llvm@19)/bin/clang
145156
export CXX=$(brew --prefix llvm@19)/bin/clang++
146-
source ~/.cargo/env
147-
eval "$(pyenv init -)"
148-
pyenv shell 3.8
157+
pyenv shell 3.9
149158
bash ./chdb/build/build_static_lib.sh
150159
pyenv shell --unset
151160
continue-on-error: false
@@ -201,25 +210,31 @@ jobs:
201210
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
202211
export CC=$(brew --prefix llvm@19)/bin/clang
203212
export CXX=$(brew --prefix llvm@19)/bin/clang++
204-
pyenv shell 3.8
213+
pyenv shell 3.9
205214
make wheel
206215
- name: Fix wheel platform tag
207216
run: |
208217
export PATH="$HOME/.pyenv/bin:$PATH"
209218
eval "$(pyenv init -)"
210-
pyenv shell 3.8
219+
pyenv shell 3.9
211220
python -m wheel tags --platform-tag=macosx_10_15_x86_64 --remove dist/*.whl
212221
- name: Setup core dump collection
213222
run: |
214223
mkdir -p tmp/core
215224
sudo sysctl kern.corefile=$PWD/tmp/core/core.%P
216225
sudo sysctl kern.coredump=1
217226
ulimit -c unlimited
227+
- name: Free up disk space
228+
run: |
229+
# Clean more build artifacts
230+
rm -rf buildlib/contrib 2>/dev/null || true
231+
rm -rf buildlib/base 2>/dev/null || true
232+
rm -rf buildlib/src 2>/dev/null || true
218233
- name: Test wheel on all Python versions
219234
run: |
220235
export PATH="$HOME/.pyenv/bin:$PATH"
221236
eval "$(pyenv init -)"
222-
for version in 3.8 3.9 3.10 3.11 3.12 3.13; do
237+
for version in 3.9 3.10 3.11 3.12 3.13; do
223238
echo "Testing chdb on Python $version"
224239
pyenv shell $version
225240
python -m pip install dist/*.whl --force-reinstall
@@ -291,7 +306,7 @@ jobs:
291306
run: |
292307
export PATH="$HOME/.pyenv/bin:$PATH"
293308
eval "$(pyenv init -)"
294-
pyenv shell 3.8
309+
pyenv shell 3.9
295310
python -m twine upload dist/*.whl
296311
env:
297312
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)