Skip to content

Commit

Permalink
Build wheels for aarch64-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Nov 29, 2024
1 parent 18cd4ac commit f42b9ec
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
os: ubuntu-22.04
rust-target: x86_64-unknown-linux-gnu
cibw-arch: x86_64
- name: arm64 Linux
os: ubuntu-22.04
rust-target: aarch64-unknown-linux-gnu
cibw-arch: aarch64
- name: x86_64 macOS
os: macos-13
rust-target: x86_64-apple-darwin
Expand All @@ -35,7 +39,6 @@ jobs:
cibw-arch: arm64
- name: x86_64 Windows
os: windows-2019
# TODO: add a 32-bit windows builder?
rust-target: x86_64-pc-windows-msvc
cibw-arch: AMD64
steps:
Expand All @@ -57,18 +60,23 @@ jobs:
- name: install dependencies
run: python -m pip install cibuildwheel twine

- name: Set up QEMU for docker
if: matrix.os == 'ubuntu-22.04'
uses: docker/setup-qemu-action@v3

- name: build manylinux with rust docker image
if: matrix.os == 'ubuntu-22.04'
run: docker build -t rustc-manylinux2014_x86_64 python/scripts/rustc-manylinux2014_x86_64
run: docker build -t rustc-manylinux2014_${{ matrix.cibw-arch }} python/scripts/rustc-manylinux2014_${{ matrix.cibw-arch }}

- name: build featomic wheel
run: python -m cibuildwheel python/featomic
env:
CIBW_BUILD: cp310-*
CIBW_BUILD: cp312-*
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.cibw-arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux2014_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: rustc-manylinux2014_aarch64
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libmetatensor.so -w {dest_dir} {wheel}"
CIBW_ENVIRONMENT: >
Expand Down Expand Up @@ -139,7 +147,7 @@ jobs:
pattern: featomic-wheel-*
merge-multiple: true

- name: Download other wheels and sdists
- name: Download sdists
uses: actions/download-artifact@v4
with:
path: wheels
Expand Down
11 changes: 11 additions & 0 deletions python/scripts/rustc-manylinux2014_aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Use manylinux docker image as a base
FROM quay.io/pypa/manylinux2014_aarch64

RUN yum install git -y
RUN git config --global --add safe.directory /code

# Download rustup-init and install
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain 1.75

ENV PATH="/root/.cargo/bin:${PATH}"
ENV RUST_BUILD_TARGET="aarch64-unknown-linux-gnu"
2 changes: 1 addition & 1 deletion python/scripts/rustc-manylinux2014_x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM quay.io/pypa/manylinux2014_x86_64
RUN yum install git -y
RUN git config --global --add safe.directory /code

# Download rustup-init asn install
# Download rustup-init and install
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain 1.75

ENV PATH="/root/.cargo/bin:${PATH}"
Expand Down

0 comments on commit f42b9ec

Please sign in to comment.