Skip to content

Commit 9a8d09f

Browse files
authored
Build older manylinux wheels (#5)
* Build linux wheels with manylinux image * Fix workspace path in container c.f. actions/runner#2058 * Install clang on manylinux * Make manylinux a separate workflow
1 parent 70bbdcd commit 9a8d09f

File tree

2 files changed

+60
-9
lines changed

2 files changed

+60
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build manylinux wheels
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
mkl-service:
11+
uses: ./.github/workflows/wheels.yml
12+
with:
13+
name: mkl-service
14+
repo: IntelPython/mkl-service
15+
force-build: true
16+
manylinux: true
17+
18+
numpy:
19+
uses: ./.github/workflows/wheels.yml
20+
with:
21+
name: numpy
22+
repo: numpy/numpy
23+
force-build: true
24+
manylinux: true
25+
needs: mkl-service
26+
27+
scipy:
28+
uses: ./.github/workflows/wheels.yml
29+
with:
30+
name: scipy
31+
repo: scipy/scipy
32+
force-build: true
33+
manylinux: true
34+
needs: [mkl-service, numpy]

.github/workflows/wheels.yml

+26-9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
required: false
1616
type: boolean
1717
description: "Force build even if wheels exist"
18+
manylinux:
19+
required: false
20+
type: boolean
21+
description: "Build Linux wheels in manylinux container"
1822
version:
1923
required: false
2024
type: string
@@ -52,9 +56,10 @@ jobs:
5256
5357
- name: Fetch build matrix
5458
run: |
55-
${{ inputs.force-build }} && extra_args="--force-build"
56-
MATRIX="$(uv run tools/fetch_matrix ${{ inputs.name }} ${extra_args} \
57-
--store build.json --runs-on ubuntu-22.04 --runs-on windows-2019)"
59+
fetch_args="--store build.json --runs-on ubuntu-22.04"
60+
${{ inputs.manylinux }} || fetch_args="${fetch_args} --runs-on windows-2019"
61+
${{ inputs.force-build }} && fetch_args="${fetch_args} --force-build"
62+
MATRIX="$(uv run tools/fetch_matrix ${{ inputs.name }} ${fetch_args})"
5863
echo "MATRIX=${MATRIX}" >>$GITHUB_ENV
5964
echo "${MATRIX}" | yq -P -o yaml
6065
@@ -71,6 +76,9 @@ jobs:
7176

7277
runs-on: ${{ matrix.runs-on }}
7378

79+
container:
80+
${{ fromJSON(inputs.manylinux) && 'quay.io/pypa/manylinux_2_28_x86_64' || null }}
81+
7482
continue-on-error: true
7583

7684
defaults:
@@ -102,10 +110,10 @@ jobs:
102110
# Move src to avoid pyproject conflicts. SRC_DIR is set relative to GITHUB_WORKSPACE to
103111
# preserve the "D:\" prefix on Windows. (Pure Linux paths aren't supported as arguments
104112
# to 'working-directory'.)
105-
mv src ../../ && echo "SRC_DIR=${{ github.workspace }}/../../src" >>$GITHUB_ENV
113+
mv src ../../ && echo "SRC_DIR=${GITHUB_WORKSPACE}/../../src" >>$GITHUB_ENV
106114
107115
# Keep MKL directory short as it ends up in the final build.
108-
echo "MKL_DIR=$(realpath "${{ github.workspace }}"/../../mkl)" >>$GITHUB_ENV
116+
echo "MKL_DIR=$(realpath "${GITHUB_WORKSPACE}"/../../mkl)" >>$GITHUB_ENV
109117
110118
- name: Install uv
111119
uses: astral-sh/setup-uv@v5
@@ -129,7 +137,7 @@ jobs:
129137
130138
# Fetch MKL license.
131139
cat "$(python tools/get_file_in_pkg LICENSE.txt --pkg mkl-devel)" \
132-
>>"${{ github.workspace }}/patches/LICENSE_MKL.txt"
140+
>>"${GITHUB_WORKSPACE}/patches/LICENSE_MKL.txt"
133141
134142
# Add .so -> .so.2 symlinks to fix linking for mkl-service.
135143
if [[ "${{ runner.os }}" == "Linux" ]]; then
@@ -155,18 +163,18 @@ jobs:
155163
echo "----" >>LICENSE.txt
156164
echo "" >>LICENSE.txt
157165
cat LICENSES_bundled.txt >>LICENSE.txt
158-
cat "${{ github.workspace }}/patches/LICENSE_MKL.txt" >>LICENSE.txt
166+
cat "${GITHUB_WORKSPACE}/patches/LICENSE_MKL.txt" >>LICENSE.txt
159167
if: inputs.name != 'mkl-service'
160168

161169
- name: Apply patches
162170
run: |
163171
# Apply patches.
164172
cd "${{ env.SRC_DIR }}"
165-
git apply "${{ github.workspace }}"/patches/${{ inputs.name }}/*.patch
173+
git apply "${GITHUB_WORKSPACE}"/patches/${{ inputs.name }}/*.patch
166174
167175
# Fix MKL pkg-config on Windows.
168176
if [[ "${{ runner.os }}" == "Windows" ]]; then
169-
cp "${{ github.workspace }}"/patches/mkl/*.pc "${PKG_CONFIG_PATH}/"
177+
cp "${GITHUB_WORKSPACE}"/patches/mkl/*.pc "${PKG_CONFIG_PATH}/"
170178
fi
171179
172180
- name: Install Windows build dependencies
@@ -186,6 +194,15 @@ jobs:
186194
esac
187195
if: runner.os == 'windows'
188196

197+
- name: Install manylinux build dependencies
198+
run: |
199+
case "${{ inputs.name }}" in
200+
mkl-service)
201+
dnf -y install clang
202+
;&
203+
esac
204+
if: inputs.manylinux
205+
189206
- name: Build wheel
190207
working-directory: ${{ env.SRC_DIR }}
191208
run: |

0 commit comments

Comments
 (0)