Add partial support for cross-compiling on Linux ARM runners

Until https://github.com/cross-rs/cross/issues/1628 is resolved, running cross on Linux ARM also
requires the user to provide a custom Docker image, so this is only sort of usable.
This commit is contained in:
Dave Rolsky
2025-02-17 00:15:27 -06:00
parent 601d02e82d
commit 83dc934d7f
4 changed files with 55 additions and 1 deletions

View File

@@ -107,6 +107,15 @@ runs:
targets: ${{ inputs.target }}
toolchain: ${{ inputs.toolchain }}
- name: Install qemu-user emulator binaries if cross-compiling on arm64 host
shell: bash
run: |
set -e
set -x
docker run --privileged --rm tonistiigi/binfmt --install all
if: steps.determine-cross-compile.outputs.needs-cross == 'true' && runner.os == 'Linux' && contains(runner.arch, 'ARM')
- name: Determine cross version
id: determine-cross-version
shell: bash
@@ -128,7 +137,7 @@ runs:
uses: actions/cache@v4
with:
path: ${{ steps.set-cross-dir.outputs.cross-dir }}/cross
key: ${{ runner.os }}-${{ steps.determine-cross-version.outputs.cross-version }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.determine-cross-version.outputs.cross-version }}
if: steps.determine-cross-compile.outputs.needs-cross == 'true' && inputs.cache-cross-binary == 'true'
- name: Install cross if cross-compiling (*nix)