From b3a7593e0c058eba831661e929f8515b74135f46 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Nov 2025 13:38:44 -0800 Subject: [PATCH] Use native Linux ARM runners for ARM 64-bit builds The build workflows generate ARM 64-bit builds of the application for Linux, macOS, and Windows hosts. When those builds are performed in the x86 "ubuntu-latest" runner machine, they fail due to incompatibility between the Docker container in which the builds are performed and the runner architecture: ``` Status: Downloaded newer image for docker.elastic.co/beats-dev/golang-crossbuild:1.25.2-windows-arm64-debian12 WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested exec /crossbuild: exec format error task: Failed to run task "dist:Windows_ARM64": exit status 255 ``` The established solution for this problem is to instead use the Linux ARM "ubuntu-24.04-arm" runner machine for those builds. The builds can be performed on this runner due to it having the required host architecture for compatibility with the build containers. Previously, an alternative solution was used in this project: using QEMU to emulate the required host architecture. That solution was inferior in multiple ways: - Introduces an additional action dependency ("docker/setup-qemu-action"). - Less efficient due to the overhead of installing QEMU, and the inferior performance of the build under emulation. For this reason, the workflow is ported to using the appropriate runner machine for the ARM 64-bit build jobs instead of depending on QEMU. --- .github/workflows/publish-go-tester-task.yml | 15 +++++++++++---- .github/workflows/release-go-task.yml | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 1696f79..f26d820 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -78,7 +78,7 @@ jobs: build: needs: package-name-prefix name: Build ${{ matrix.os.artifact-name }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.os.runner }} permissions: contents: read @@ -88,33 +88,43 @@ jobs: - task: Windows_32bit path: "*Windows_32bit.zip" artifact-name: Windows_X86-32 + runner: ubuntu-latest - task: Windows_64bit path: "*Windows_64bit.zip" artifact-name: Windows_X86-64 + runner: ubuntu-latest - task: Windows_ARM64 path: "*Windows_ARM64.zip" artifact-name: Windows_ARM64 + runner: ubuntu-24.04-arm - task: Linux_32bit path: "*Linux_32bit.tar.gz" artifact-name: Linux_X86-32 + runner: ubuntu-latest - task: Linux_64bit path: "*Linux_64bit.tar.gz" artifact-name: Linux_X86-64 + runner: ubuntu-latest - task: Linux_ARMv6 path: "*Linux_ARMv6.tar.gz" artifact-name: Linux_ARMv6 + runner: ubuntu-latest - task: Linux_ARMv7 path: "*Linux_ARMv7.tar.gz" artifact-name: Linux_ARMv7 + runner: ubuntu-latest - task: Linux_ARM64 path: "*Linux_ARM64.tar.gz" artifact-name: Linux_ARM64 + runner: ubuntu-24.04-arm - task: macOS_64bit path: "*macOS_64bit.tar.gz" artifact-name: macOS_64 + runner: ubuntu-latest - task: macOS_ARM64 path: "*macOS_ARM64.tar.gz" artifact-name: macOS_ARM64 + runner: ubuntu-24.04-arm steps: - name: Checkout repository @@ -126,9 +136,6 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - name: Build run: | PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }} diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index 55e309c..72fe875 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -18,7 +18,7 @@ on: jobs: create-release-artifacts: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os.runner }} permissions: contents: read @@ -27,24 +27,34 @@ jobs: os: - task: Windows_32bit artifact-suffix: Windows_32bit + runner: ubuntu-latest - task: Windows_64bit artifact-suffix: Windows_64bit + runner: ubuntu-latest - task: Windows_ARM64 artifact-suffix: Windows_ARM64 + runner: ubuntu-24.04-arm - task: Linux_32bit artifact-suffix: Linux_32bit + runner: ubuntu-latest - task: Linux_64bit artifact-suffix: Linux_64bit + runner: ubuntu-latest - task: Linux_ARMv6 artifact-suffix: Linux_ARMv6 + runner: ubuntu-latest - task: Linux_ARMv7 artifact-suffix: Linux_ARMv7 + runner: ubuntu-latest - task: Linux_ARM64 artifact-suffix: Linux_ARM64 + runner: ubuntu-24.04-arm - task: macOS_64bit artifact-suffix: macOS_64bit + runner: ubuntu-latest - task: macOS_ARM64 artifact-suffix: macOS_ARM64 + runner: ubuntu-24.04-arm steps: - name: Checkout repository @@ -68,9 +78,6 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - name: Build run: task dist:${{ matrix.os.task }}