Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 29 additions & 51 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
- uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -72,6 +73,7 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- name: "Install fresh upstream rustup"
# The macos-15-arm64 runner image (20260511.0048+) ships a broken
# Homebrew rustup whose bundled rustup-init rejects standard argv
Expand Down Expand Up @@ -117,6 +119,7 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- name: "Install fresh upstream rustup"
# The macos-15-arm64 runner image (20260511.0048+) ships a broken
# Homebrew rustup whose bundled rustup-init rejects standard argv
Expand Down Expand Up @@ -170,6 +173,7 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
- uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -204,16 +208,16 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Build wheel
uses: PyO3/maturin-action@v1.50.1
with:
target: ${{ matrix.platform.target }}
manylinux: auto

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you moved the other jobs to 2_28 as well. I guess because of consistency. That's ok for me but the cost we're paying is that for those architectures, we're dropping older glibc users (e.g. someone on Ubuntu 18.04).

For the arm runner we need 2_28 because of the bug we have (again, in #277).
We don't techincally need the same for x64 and we could theoretically support older glibc users but I think being consistent is better for maintenability here. So I'd say leave it, I just wanted to point it out

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'd rather be consistent unless there's truly a need to have auto here. If it ends up causing issues for someone on an older version of Linux we can definitely revert this or pin to an older version.

manylinux: 2_28
args: --release --locked --out dist -i python${{ matrix.python-version }}
before-script-linux: |
# If we're running on rhel centos, install needed packages.
Expand All @@ -237,23 +241,20 @@ jobs:
name: wheels-${{ matrix.platform.target }}-py${{ matrix.python-version }}
path: dist

linux-cross:
linux-arm:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
strategy:
matrix:
platform:
- target: aarch64-unknown-linux-gnu
arch: aarch64
# see https://github.com/astral-sh/ruff/issues/3791
# and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16 -e PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep this. persist-credentials runs with true by default and we don't want it here as subsequent steps run actual code and having a GITHUB token available to them is.... not good.

- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -262,35 +263,14 @@ jobs:
with:
target: ${{ matrix.platform.target }}
manylinux: 2_28
docker-options: ${{ matrix.platform.maturin_docker_options }}
args: --release --locked --out dist -i ${{ format('python{0}', matrix.python-version) }}
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
- uses: uraimo/run-on-arch-action@v3
if: ${{ matrix.platform.arch != 'ppc64' && matrix.platform.arch != 'ppc64le'}}
name: Test wheel
with:
arch: ${{ matrix.platform.arch }}
distro: ubuntu24.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y --no-install-recommends ${{ format('python{0}-full', matrix.python-version) }} ${{ format('python{0}-venv', matrix.python-version) }} cargo libffi-dev
# Create and use a virtual environment to avoid the externally-managed-environment error
run: |
ln -s -f /usr/bin/${{ format('python{0}', matrix.python-version) }} /usr/bin/python3
ln -s -f /usr/bin/${{ format('pip{0}', matrix.python-version) }} /usr/bin/pip3
# Workaround for QEMU bug when emulating 32-bit on 64-bit hosts
# See: https://github.com/docker/buildx/issues/395
# Use /tmp for CARGO_HOME (often tmpfs, which avoids the QEMU filesystem bug)
export CARGO_HOME=/tmp/cargo-home
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
pip3 install dist/*.whl --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
args: --release --locked --out dist -i python${{ matrix.python-version }}
- name: Test wheel
if: ${{ startsWith(matrix.platform.target, 'aarch64') }}
run: |
PYTAG="cp$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
pip install dist/*-${PYTAG}-*.whl --force-reinstall
${{ env.EXECUTABLE_NAME }} --help
python -m ${{ env.MODULE_NAME }} --help
- name: Upload wheel
uses: actions/upload-artifact@v6
with:
Expand All @@ -309,6 +289,7 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -337,19 +318,19 @@ jobs:
name: wheels-${{ matrix.platform.target }}-py${{ matrix.python-version }}
path: dist

musllinux-cross:
musllinux-arm:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
strategy:
matrix:
platform:
- target: aarch64-unknown-linux-musl
arch: aarch64
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -359,18 +340,15 @@ jobs:
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
args: --release --locked --out dist -i python${{ matrix.python-version }}
- uses: uraimo/run-on-arch-action@v2
name: Test wheel
with:
arch: ${{ matrix.platform.arch }}
distro: alpine_latest
githubToken: ${{ github.token }}
install: |
apk add uv rust
- name: Test wheel
if: matrix.platform.target == 'aarch64-unknown-linux-musl'
uses: addnab/docker-run-action@v3
with:
image: python:${{ matrix.python-version}}-alpine
options: -v ${{ github.workspace }}:/io -w /io
run: |
uv python install ${{ matrix.python-version }} --default
export PATH="/root/.local/bin:$PATH"
python3 -m venv .venv
apk add rust
python -m venv .venv
.venv/bin/pip3 install dist/*.whl --force-reinstall
.venv/bin/${{ env.EXECUTABLE_NAME }} --help
- name: Upload wheel
Expand Down
Loading