Skip to content

Enable native builds on Linux aarch64 #607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
49 changes: 31 additions & 18 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: linux

on:
push:
branches: [main]
branches: [ main ]
pull_request:

concurrency:
Expand Down Expand Up @@ -56,15 +56,28 @@ jobs:
fail-fast: false
matrix:
image:
- build
- build.cross
- build.cross-riscv64
- gcc
- xcb
- xcb.cross
- xcb.cross-riscv64
name: ${{ matrix.image }}
runs-on: depot-ubuntu-22.04
- name: build
platform: linux64
- name: build.cross
platform: linux64
- name: build.cross-riscv64
platform: linux64
- name: build.debian9
platform: linux_aarch64
- name: gcc
platform: linux64
- name: gcc.debian9
platform: linux_aarch64
- name: xcb
platform: linux64
- name: xcb.cross
platform: linux64
- name: xcb.cross-riscv64
platform: linux64
- name: xcb.debian9
platform: linux_aarch64
name: ${{ matrix.image.name }}
runs-on: ${{ matrix.image.platform == 'linux_aarch64' && 'depot-ubuntu-22.04-arm' || 'depot-ubuntu-22.04' }}
permissions:
packages: write
steps:
Expand Down Expand Up @@ -98,30 +111,30 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/${{ matrix.image }}.Dockerfile
file: build/${{ matrix.image.name }}.Dockerfile
labels: org.opencontainers.image.source=https://github.com/${{ env.REPO_NAME }}
# Cache from/to the current branch of the current repo as the primary cache key.
# Cache from the default branch of the current repo so branches can have cache hits.
# Cache from the default branch of the canonical repo so forks can have cache hits.
# Ignore errors on cache writes so CI of forks works without a valid GHCR config.
cache-from: |
type=registry,ref=ghcr.io/${{ env.REPO_NAME }}:${{ matrix.image }}-${{ env.GIT_REF_NAME }}
type=registry,ref=ghcr.io/${{ env.REPO_NAME }}:${{ matrix.image }}-main
type=registry,ref=ghcr.io/astral-sh/python-build-standalone:${{ matrix.image }}-main
type=registry,ref=ghcr.io/${{ env.REPO_NAME }}:${{ matrix.image.name }}-${{ matrix.image.platform }}-${{ env.GIT_REF_NAME }}
type=registry,ref=ghcr.io/${{ env.REPO_NAME }}:${{ matrix.image.name }}-${{ matrix.image.platform }}-main
type=registry,ref=ghcr.io/astral-sh/python-build-standalone:${{ matrix.image.name }}-${{ matrix.image.platform }}-main
cache-to: |
type=registry,ref=ghcr.io/${{ env.REPO_NAME }}:${{ matrix.image }}-${{ env.GIT_REF_NAME }},ignore-error=true
type=registry,ref=ghcr.io/${{ env.REPO_NAME }}:${{ matrix.image.name }}-${{ matrix.image.platform }}-${{ env.GIT_REF_NAME }},ignore-error=true
outputs: |
type=docker,dest=build/image-${{ matrix.image }}.tar
type=docker,dest=build/image-${{ matrix.image.name }}.${{ matrix.image.platform }}.tar

- name: Compress Image
run: |
echo ${{ steps.build-image.outputs.imageid }} > build/image-${{ matrix.image }}
echo ${{ steps.build-image.outputs.imageid }} > build/image-${{ matrix.image.name }}.${{ matrix.image.platform }}
zstd -v -T0 -6 --rm build/image-*.tar

- name: Upload Docker Image
uses: actions/upload-artifact@v4
with:
name: image-${{ matrix.image }}
name: image-${{ matrix.image.name }}-${{ matrix.image.platform }}
path: build/image-*

generate-matrix:
Expand Down
9 changes: 4 additions & 5 deletions ci-runners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ depot-ubuntu-22.04:
platform: linux
free: false

# TODO: Enable this runner to perform native builds for aarch64
# depot-ubuntu-22.04-arm:
# arch: aarch64
# platform: linux
# free: false
depot-ubuntu-22.04-arm:
arch: aarch64
platform: linux
free: false

depot-macos-latest:
arch: x86_64
Expand Down
Loading
Loading