Skip to content

Commit ad1816e

Browse files
committed
fixed: x86 build
1 parent 4e19e4d commit ad1816e

File tree

1 file changed

+45
-20
lines changed

1 file changed

+45
-20
lines changed

.github/workflows/build-wheel-graceful.yml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,67 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build_wheels_x86:
11-
name: Build x86_64 wheels
10+
build-x86_64:
1211
runs-on: ubuntu-latest
13-
timeout-minutes: 120
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ['3.10', '3.11', '3.12']
16+
timeout-minutes: 60
1417

1518
steps:
1619
- name: Checkout repository
1720
uses: actions/checkout@v4
1821

22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install system dependencies
28+
run: |
29+
sudo apt-get update -qq
30+
sudo apt-get install -y --no-install-recommends \
31+
build-essential cmake libboost-dev libopenblas-dev liblapack-dev \
32+
libx11-dev libgtk-3-dev libjpeg-dev libpng-dev libtiff-dev \
33+
libatlas-base-dev pkg-config
34+
35+
- name: Install Python build tools
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install build wheel setuptools auditwheel
39+
1940
- name: Clone dlib
2041
run: |
2142
git clone --depth 1 https://github.com/davisking/dlib.git dlib_src
2243
23-
- name: Build x86_64 wheels
24-
uses: pypa/cibuildwheel@v2.21.0
25-
with:
26-
package-dir: dlib_src
27-
env:
28-
CIBW_BUILD: cp310-* cp311-* cp312-*
29-
CIBW_ARCHS_LINUX: x86_64
30-
CIBW_BEFORE_ALL_LINUX: >
31-
yum install -y cmake3 boost-devel openblas-devel lapack-devel
32-
libX11-devel libpng-devel libjpeg-devel
33-
libtiff-devel atlas-devel gcc gcc-c++ make git
34-
CIBW_ENVIRONMENT: "CXXFLAGS='-O2 -g0'"
44+
- name: Build wheel
45+
run: |
46+
cd dlib_src
47+
python setup.py bdist_wheel
3548
36-
- name: Upload x86_64 artifacts
49+
if [ ! -f dist/*.whl ]; then
50+
echo "Wheel build failed - no wheel found in dist/"
51+
ls -la dist/ || echo "dist/ directory not found"
52+
exit 1
53+
fi
54+
55+
- name: Repair wheel (manylinux)
56+
run: |
57+
cd dlib_src
58+
mkdir -p dist_repaired/
59+
auditwheel repair dist/*.whl -w dist_repaired/ || cp dist/*.whl dist_repaired/
60+
61+
- name: Upload build artifact
3762
uses: actions/upload-artifact@v4
3863
with:
39-
name: wheels-x86_64
40-
path: ./wheelhouse/*.whl
64+
name: dlib-py${{ matrix.python-version }}-linux-x86_64
65+
path: dlib_src/dist_repaired/*.whl
4166
retention-days: 30
4267

4368
release:
4469
runs-on: ubuntu-latest
45-
needs: [build_wheels_x86]
70+
needs: [build-x86_64]
4671
if: startsWith(github.ref, 'refs/tags/')
4772
permissions:
4873
contents: write
@@ -68,7 +93,7 @@ jobs:
6893
Prebuilt dlib wheels for Linux x86_64 on Python 3.10, 3.11, and 3.12
6994
7095
**Installation:**
71-
```pip install dlib-*.whl```
96+
```pip install dlib-*.whl```
7297
Choose the wheel that matches your Python version (cp310, cp311, or cp312)
7398
files: wheels/*.whl
7499
draft: false

0 commit comments

Comments
 (0)