Skip to content

Commit 2e1a55b

Browse files
authored
[BUGFIX] missing wheel for python 3.14 (#34)
* Bump cibuildwheel version to v2.22 in build workflows and update project version to 0.2.6 * Enhance cross-compilation support for ARM64 in CI workflows and update cibuildwheel version to v3.3 * Refactor Windows build configuration to remove ARM64 support and update testing steps * Enhance Linux build workflow to support multiple architectures and improve release status reporting * Update README.md to enhance platform support details and clarify requirements * Enhance artifact upload steps in CI workflows for Linux, macOS, and Windows to include retention days and error handling * Add CI workflows for building and testing Linux wheels on x86_64 and aarch64 architectures * Update CI workflows to specify Ubuntu 24.04 for ARM64 builds and include it in the OS matrix * Update cache keys in CI workflow to include architecture for vendor dependencies * Disable assembly optimizations for BoringSSL on both ARM64 and x86_64 architectures to avoid compatibility issues * Refactor cache keys in CI workflows to include architecture for vendor dependencies
1 parent 69aaae8 commit 2e1a55b

File tree

12 files changed

+266
-78
lines changed

12 files changed

+266
-78
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Build Linux aarch64 Wheels
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-linux-aarch64:
8+
name: Build Linux aarch64 Wheels
9+
# Use native ARM64 runners for much faster builds (vs QEMU emulation)
10+
runs-on: ubuntu-24.04-arm
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
17+
# Setup Go for BoringSSL build
18+
- name: Setup Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.21'
22+
cache: true
23+
24+
# Build wheels with cibuildwheel (handles manylinux containers)
25+
# Vendor dependencies are built inside the manylinux container and cached across Python versions
26+
# Note: GitHub Actions cache doesn't work here since vendor dir is inside the container
27+
- name: Build wheels
28+
uses: pypa/cibuildwheel@v3.3
29+
env:
30+
# Build for all Python versions on aarch64
31+
CIBW_BUILD: cp38-manylinux_aarch64 cp39-manylinux_aarch64 cp310-manylinux_aarch64 cp311-manylinux_aarch64 cp312-manylinux_aarch64 cp313-manylinux_aarch64 cp314-manylinux_aarch64
32+
# Vendor build happens inside manylinux container via before-build (from pyproject.toml)
33+
# The script will detect cached libraries and skip rebuilding across Python versions
34+
CIBW_ARCHS_LINUX: aarch64
35+
36+
# Setup Python versions for testing
37+
- name: Setup Python versions
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: |
41+
3.8
42+
3.9
43+
3.10
44+
3.11
45+
3.12
46+
3.13
47+
3.14
48+
allow-prereleases: true
49+
50+
# Test the built wheels on native ARM64
51+
- name: Test wheels
52+
run: |
53+
# Test each wheel that was built
54+
for wheel in ./wheelhouse/*.whl; do
55+
echo "========================================"
56+
echo "Testing wheel: $(basename "$wheel")"
57+
echo "========================================"
58+
59+
# Extract Python version from wheel filename (e.g., cp39, cp310)
60+
python_tag=$(basename "$wheel" | grep -oE 'cp[0-9]+' | head -1)
61+
python_version="${python_tag:2:1}.${python_tag:3}"
62+
63+
echo "Setting up Python $python_version..."
64+
65+
# Try to find the matching Python version
66+
python_cmd=""
67+
for cmd in "python${python_version}" "python3.${python_version#*.}" "python3"; do
68+
if command -v "$cmd" &> /dev/null; then
69+
# Verify this is the right version
70+
version_check=$($cmd --version 2>&1 | grep -oE '[0-9]+\.[0-9]+' | head -1)
71+
if [ "$version_check" = "$python_version" ]; then
72+
python_cmd="$cmd"
73+
break
74+
fi
75+
fi
76+
done
77+
78+
# Fall back to python3 if we couldn't find exact match
79+
if [ -z "$python_cmd" ]; then
80+
echo "WARNING: Python $python_version not found, using python3"
81+
python_cmd="python3"
82+
fi
83+
84+
echo "Using Python: $($python_cmd --version)"
85+
86+
# Install the wheel in a fresh environment
87+
"$python_cmd" -m pip install --force-reinstall "$wheel"
88+
89+
# Run the test script
90+
echo ""
91+
echo "Running tests..."
92+
"$python_cmd" scripts/test_local_build.py
93+
94+
# Check exit code
95+
if [ $? -eq 0 ]; then
96+
echo ""
97+
echo "[OK] Wheel test PASSED: $(basename "$wheel")"
98+
else
99+
echo ""
100+
echo "[FAIL] Wheel test FAILED: $(basename "$wheel")"
101+
exit 1
102+
fi
103+
104+
echo ""
105+
done
106+
107+
echo "========================================"
108+
echo "All wheel tests PASSED"
109+
echo "========================================"
110+
111+
# Upload wheels as artifacts
112+
- name: Upload wheels
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: wheels-linux-aarch64
116+
path: ./wheelhouse/*.whl
117+
if-no-files-found: error
118+
retention-days: 5
119+
# Retry on transient failures
120+
continue-on-error: false
Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Build Linux Wheels
1+
name: Build Linux x86_64 Wheels
22

33
on:
44
workflow_call:
55

66
jobs:
7-
build-linux:
8-
name: Build Linux Wheels
7+
build-linux-x86_64:
8+
name: Build Linux x86_64 Wheels
99
runs-on: ubuntu-latest
1010

1111
steps:
@@ -20,34 +20,17 @@ jobs:
2020
go-version: '1.21'
2121
cache: true
2222

23-
# Cache vendor dependencies to speed up builds
24-
- name: Restore vendor cache
25-
id: cache-vendor
26-
uses: actions/cache/restore@v4
27-
with:
28-
path: vendor
29-
key: vendor-linux-manylinux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v11
30-
restore-keys: |
31-
vendor-linux-manylinux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v11
32-
3323
# Build wheels with cibuildwheel (handles manylinux containers)
34-
# The vendor directory is mounted into the container and shared across Python versions
35-
# The setup script will skip rebuilding if libraries already exist
24+
# Vendor dependencies are built inside the manylinux container and cached across Python versions
25+
# Note: GitHub Actions cache doesn't work here since vendor dir is inside the container
3626
- name: Build wheels
37-
uses: pypa/cibuildwheel@v2.22.0
27+
uses: pypa/cibuildwheel@v3.3
3828
env:
39-
# Build for all Python versions
29+
# Build for all Python versions on x86_64
4030
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64
4131
# Vendor build happens inside manylinux container via before-build (from pyproject.toml)
42-
# The script will detect cached libraries and skip rebuilding
43-
44-
# Save vendor cache after build
45-
- name: Save vendor cache
46-
if: steps.cache-vendor.outputs.cache-hit != 'true'
47-
uses: actions/cache/save@v4
48-
with:
49-
path: vendor
50-
key: vendor-linux-manylinux-${{ hashFiles('scripts/linux/setup_vendors.sh') }}-v11
32+
# The script will detect cached libraries and skip rebuilding across Python versions
33+
CIBW_ARCHS_LINUX: x86_64
5134

5235
# Setup Python versions for testing
5336
- name: Setup Python versions
@@ -125,8 +108,12 @@ jobs:
125108
echo "========================================"
126109
127110
# Upload wheels as artifacts
128-
- uses: actions/upload-artifact@v4
111+
- name: Upload wheels
112+
uses: actions/upload-artifact@v4
129113
with:
130-
name: wheels-linux
114+
name: wheels-linux-x86_64
131115
path: ./wheelhouse/*.whl
132116
if-no-files-found: error
117+
retention-days: 5
118+
# Retry on transient failures
119+
continue-on-error: false

.github/workflows/_build_macos.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ jobs:
2626
cache: true
2727

2828
# Cache vendor dependencies to speed up builds
29+
# Note: Cache is architecture-specific (ARM64 vs x86_64)
2930
- name: Restore vendor cache
3031
id: cache-vendor
3132
uses: actions/cache/restore@v4
3233
with:
3334
path: vendor
34-
key: vendor-macos-${{ hashFiles('scripts/darwin/setup_vendors.sh') }}-v10
35+
key: vendor-macos-${{ runner.arch }}-${{ hashFiles('scripts/setup_vendors.sh', 'scripts/darwin/**/*.sh') }}-v10
3536
restore-keys: |
36-
vendor-macos-${{ hashFiles('scripts/darwin/setup_vendors.sh') }}-v10
37+
vendor-macos-${{ runner.arch }}-${{ hashFiles('scripts/setup_vendors.sh', 'scripts/darwin/**/*.sh') }}-v10
3738
3839
# Build vendor dependencies (always build to ensure clean state)
3940
- name: Build vendor dependencies
@@ -46,7 +47,7 @@ jobs:
4647
uses: actions/cache/save@v4
4748
with:
4849
path: vendor
49-
key: vendor-macos-${{ hashFiles('scripts/darwin/setup_vendors.sh') }}-v10
50+
key: vendor-macos-${{ runner.arch }}-${{ hashFiles('scripts/setup_vendors.sh', 'scripts/darwin/**/*.sh') }}-v10
5051

5152
# Verify vendor build
5253
- name: Verify vendor build
@@ -74,7 +75,7 @@ jobs:
7475
7576
# Build wheels for all Python versions
7677
- name: Build wheels
77-
uses: pypa/cibuildwheel@v2.22.0
78+
uses: pypa/cibuildwheel@v3.3
7879
env:
7980
# Skip before-build since we already built vendors
8081
CIBW_BEFORE_BUILD: ""
@@ -152,8 +153,12 @@ jobs:
152153
echo "========================================"
153154
154155
# Upload wheels as artifacts
155-
- uses: actions/upload-artifact@v4
156+
- name: Upload wheels
157+
uses: actions/upload-artifact@v4
156158
with:
157159
name: wheels-macos
158160
path: ./wheelhouse/*.whl
159161
if-no-files-found: error
162+
retention-days: 5
163+
# Retry on transient failures
164+
continue-on-error: false

.github/workflows/_build_windows.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
uses: actions/cache/restore@v4
3333
with:
3434
path: vendor
35-
key: vendor-windows-${{ hashFiles('scripts/windows/setup_vendors.sh') }}-v10
35+
key: vendor-windows-${{ hashFiles('scripts/setup_vendors.sh', 'scripts/windows/**/*.sh') }}-v10
3636
restore-keys: |
37-
vendor-windows-${{ hashFiles('scripts/windows/setup_vendors.sh') }}-v10
37+
vendor-windows-${{ hashFiles('scripts/setup_vendors.sh', 'scripts/windows/**/*.sh') }}-v10
3838
3939
# Build vendor dependencies (always build to ensure clean state)
4040
- name: Build vendor dependencies
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/cache/save@v4
4949
with:
5050
path: vendor
51-
key: vendor-windows-${{ hashFiles('scripts/windows/setup_vendors.sh') }}-v10
51+
key: vendor-windows-${{ hashFiles('scripts/setup_vendors.sh', 'scripts/windows/**/*.sh') }}-v10
5252

5353
# Verify vendor build
5454
- name: Verify vendor build
@@ -84,11 +84,12 @@ jobs:
8484

8585
# Build wheels for all Python versions
8686
- name: Build wheels
87-
uses: pypa/cibuildwheel@v2.22.0
87+
uses: pypa/cibuildwheel@v3.3
8888
env:
8989
# Skip before-build since we already built vendors
9090
CIBW_BEFORE_BUILD: ""
91-
# Build for all Python versions
91+
# Build for all Python versions on AMD64 only
92+
# Note: ARM64 support requires vendor libraries to be built for ARM64, which needs separate build infrastructure
9293
CIBW_BUILD: cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64 cp314-win_amd64
9394

9495
# Setup Python versions for testing
@@ -163,8 +164,12 @@ jobs:
163164
shell: bash
164165

165166
# Upload wheels as artifacts
166-
- uses: actions/upload-artifact@v4
167+
- name: Upload wheels
168+
uses: actions/upload-artifact@v4
167169
with:
168170
name: wheels-windows
169171
path: ./wheelhouse/*.whl
170172
if-no-files-found: error
173+
retention-days: 5
174+
# Retry on transient failures
175+
continue-on-error: false

.github/workflows/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ jobs:
5656
# Operating Systems to test
5757
# Comment out any OS you want to skip during development
5858
OS_MATRIX='[
59-
"windows-latest", "ubuntu-latest", "macos-latest"
59+
"ubuntu-latest", "ubuntu-24.04-arm", "macos-latest", "macos-15-intel", "windows-latest"
6060
]'
61-
# OS options: "windows-latest", "ubuntu-latest", "macos-latest"
61+
# OS options: "windows-latest", "ubuntu-latest", "ubuntu-24.04-arm", "macos-latest", "macos-15-intel"
6262
6363
# Python versions to test
6464
PYTHON_MATRIX='[

.github/workflows/_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ jobs:
173173
uses: actions/cache/restore@v4
174174
with:
175175
path: vendor
176-
key: vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}-v10
176+
key: vendor-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/**/*.sh') }}-v10
177177
restore-keys: |
178-
vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}-v10
178+
vendor-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/**/*.sh') }}-v10
179179
180180
- name: Setup vendor dependencies (always rebuild to ensure clean state)
181181
run: |
@@ -261,7 +261,7 @@ jobs:
261261
uses: actions/cache/save@v4
262262
with:
263263
path: vendor
264-
key: vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}-v10
264+
key: vendor-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/**/*.sh') }}-v10
265265

266266
- name: Save Python build cache
267267
if: always()

.github/workflows/ci.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ jobs:
1212
# Load Configuration
1313
# ============================================================
1414
load-config:
15+
name: Load Configuration
1516
uses: ./.github/workflows/_config.yml
1617

1718
# ============================================================
1819
# Test Job
1920
# ============================================================
2021
test:
22+
name: Test
2123
needs: load-config
2224
if: needs.load-config.outputs.enable-tests == 'true'
2325
uses: ./.github/workflows/_test.yml
@@ -34,10 +36,15 @@ jobs:
3436
# ============================================================
3537
# Build Test Jobs
3638
# ============================================================
37-
build-test-linux:
38-
name: Build Test (Linux)
39+
build-test-linux-x86_64:
40+
name: Build Test (Linux x86_64)
3941
needs: load-config
40-
uses: ./.github/workflows/_build_linux.yml
42+
uses: ./.github/workflows/_build_linux_x86_64.yml
43+
44+
build-test-linux-aarch64:
45+
name: Build Test (Linux aarch64)
46+
needs: load-config
47+
uses: ./.github/workflows/_build_linux_aarch64.yml
4148

4249
build-test-macos:
4350
name: Build Test (macOS)
@@ -54,7 +61,7 @@ jobs:
5461
# ============================================================
5562
summary:
5663
name: CI Summary
57-
needs: [load-config, test, build-test-linux, build-test-macos, build-test-windows]
64+
needs: [load-config, test, build-test-linux-x86_64, build-test-linux-aarch64, build-test-macos, build-test-windows]
5865
if: always()
5966
runs-on: ubuntu-latest
6067

@@ -82,13 +89,23 @@ jobs:
8289
echo ""
8390
echo "Build Tests:"
8491
85-
# Linux
86-
if [ "${{ needs.build-test-linux.result }}" == "success" ]; then
87-
echo " ✅ Linux: PASSED"
88-
elif [ "${{ needs.build-test-linux.result }}" == "skipped" ]; then
89-
echo " ⊘ Linux: SKIPPED"
92+
# Linux x86_64
93+
if [ "${{ needs.build-test-linux-x86_64.result }}" == "success" ]; then
94+
echo " ✅ Linux x86_64: PASSED"
95+
elif [ "${{ needs.build-test-linux-x86_64.result }}" == "skipped" ]; then
96+
echo " ⊘ Linux x86_64: SKIPPED"
97+
else
98+
echo " ❌ Linux x86_64: FAILED"
99+
EXIT_CODE=1
100+
fi
101+
102+
# Linux aarch64
103+
if [ "${{ needs.build-test-linux-aarch64.result }}" == "success" ]; then
104+
echo " ✅ Linux aarch64: PASSED"
105+
elif [ "${{ needs.build-test-linux-aarch64.result }}" == "skipped" ]; then
106+
echo " ⊘ Linux aarch64: SKIPPED"
90107
else
91-
echo " ❌ Linux: FAILED"
108+
echo " ❌ Linux aarch64: FAILED"
92109
EXIT_CODE=1
93110
fi
94111

0 commit comments

Comments
 (0)