Skip to content

Commit 9ba2660

Browse files
authored
Use native Linux ARM runners for ARM 64-bit builds (#94)
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.
1 parent 2eabc9e commit 9ba2660

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

.github/workflows/publish-go-tester-task.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
build:
7979
needs: package-name-prefix
8080
name: Build ${{ matrix.os.artifact-name }}
81-
runs-on: ubuntu-latest
81+
runs-on: ${{ matrix.os.runner }}
8282
permissions:
8383
contents: read
8484

@@ -88,33 +88,43 @@ jobs:
8888
- task: Windows_32bit
8989
path: "*Windows_32bit.zip"
9090
artifact-name: Windows_X86-32
91+
runner: ubuntu-latest
9192
- task: Windows_64bit
9293
path: "*Windows_64bit.zip"
9394
artifact-name: Windows_X86-64
95+
runner: ubuntu-latest
9496
- task: Windows_ARM64
9597
path: "*Windows_ARM64.zip"
9698
artifact-name: Windows_ARM64
99+
runner: ubuntu-24.04-arm
97100
- task: Linux_32bit
98101
path: "*Linux_32bit.tar.gz"
99102
artifact-name: Linux_X86-32
103+
runner: ubuntu-latest
100104
- task: Linux_64bit
101105
path: "*Linux_64bit.tar.gz"
102106
artifact-name: Linux_X86-64
107+
runner: ubuntu-latest
103108
- task: Linux_ARMv6
104109
path: "*Linux_ARMv6.tar.gz"
105110
artifact-name: Linux_ARMv6
111+
runner: ubuntu-latest
106112
- task: Linux_ARMv7
107113
path: "*Linux_ARMv7.tar.gz"
108114
artifact-name: Linux_ARMv7
115+
runner: ubuntu-latest
109116
- task: Linux_ARM64
110117
path: "*Linux_ARM64.tar.gz"
111118
artifact-name: Linux_ARM64
119+
runner: ubuntu-24.04-arm
112120
- task: macOS_64bit
113121
path: "*macOS_64bit.tar.gz"
114122
artifact-name: macOS_64
123+
runner: ubuntu-latest
115124
- task: macOS_ARM64
116125
path: "*macOS_ARM64.tar.gz"
117126
artifact-name: macOS_ARM64
127+
runner: ubuntu-24.04-arm
118128

119129
steps:
120130
- name: Checkout repository
@@ -126,9 +136,6 @@ jobs:
126136
repo-token: ${{ secrets.GITHUB_TOKEN }}
127137
version: 3.x
128138

129-
- name: Setup QEMU
130-
uses: docker/setup-qemu-action@v3
131-
132139
- name: Build
133140
run: |
134141
PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}

.github/workflows/release-go-task.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
jobs:
2020
create-release-artifacts:
21-
runs-on: ubuntu-latest
21+
runs-on: ${{ matrix.os.runner }}
2222
permissions:
2323
contents: read
2424

@@ -27,24 +27,34 @@ jobs:
2727
os:
2828
- task: Windows_32bit
2929
artifact-suffix: Windows_32bit
30+
runner: ubuntu-latest
3031
- task: Windows_64bit
3132
artifact-suffix: Windows_64bit
33+
runner: ubuntu-latest
3234
- task: Windows_ARM64
3335
artifact-suffix: Windows_ARM64
36+
runner: ubuntu-24.04-arm
3437
- task: Linux_32bit
3538
artifact-suffix: Linux_32bit
39+
runner: ubuntu-latest
3640
- task: Linux_64bit
3741
artifact-suffix: Linux_64bit
42+
runner: ubuntu-latest
3843
- task: Linux_ARMv6
3944
artifact-suffix: Linux_ARMv6
45+
runner: ubuntu-latest
4046
- task: Linux_ARMv7
4147
artifact-suffix: Linux_ARMv7
48+
runner: ubuntu-latest
4249
- task: Linux_ARM64
4350
artifact-suffix: Linux_ARM64
51+
runner: ubuntu-24.04-arm
4452
- task: macOS_64bit
4553
artifact-suffix: macOS_64bit
54+
runner: ubuntu-latest
4655
- task: macOS_ARM64
4756
artifact-suffix: macOS_ARM64
57+
runner: ubuntu-24.04-arm
4858

4959
steps:
5060
- name: Checkout repository
@@ -68,9 +78,6 @@ jobs:
6878
repo-token: ${{ secrets.GITHUB_TOKEN }}
6979
version: 3.x
7080

71-
- name: Setup QEMU
72-
uses: docker/setup-qemu-action@v3
73-
7481
- name: Build
7582
run: task dist:${{ matrix.os.task }}
7683

0 commit comments

Comments
 (0)