fix(build): cross-build pi4-64 / pi5 webview as arm64 via QEMU (#2794)

Pin `platform: linux/arm64` on the pi4-64 and pi5 bake targets in
webview/docker-compose.yml so `docker buildx bake` honors them as
the target architecture. Without this pin the Build Webview workflow
falls back to the runner's native amd64, and `qmake6 && make` inside
build_webview.sh then emits an x86-64 ELF that the on-device viewer
container cannot exec ("Exec format error" when load_browser tries
to start AnthiasWebview).

The workflow already runs setup-qemu-action before bake, so the
emulation path is in place; the fix is just to actually request
the cross-arch build.

x86 gets `linux/amd64` for symmetry — same final layout, no behavior
change on amd64 runners. The Qt5 (pi2/pi3) path is unaffected: it uses
a real cross-toolchain (build_webview_with_qt5.sh) and never relied on
this compose file.

The 2026.04.1 release assets for pi4-64 and pi5 were rebuilt locally
via this corrected pipeline and re-uploaded; this PR is what allows
the next WebView-v* tag (and the downstream viewer image rebuild) to
do the same in CI.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Viktor Petersson
2026-04-30 21:42:25 +01:00
committed by GitHub
parent 40736c9b08
commit b950960938

View File

@@ -1,11 +1,20 @@
# Each builder declares its own `platform:` so that `docker buildx bake`
# honors it as the target platform — without this pin the bake builds
# whatever the runner's native arch is, and `qmake6 && make` inside
# build_webview.sh then produces a binary of the wrong architecture for
# the ARM64 boards. The Build Webview workflow registers QEMU before
# baking, so the non-native targets cross-build via emulation.
services:
builder-x86:
profiles:
- x86
image: webview-builder-x86
platform: linux/amd64
build:
context: .
dockerfile: docker/Dockerfile.x86
platforms:
- linux/amd64
environment:
- BOARD=x86
tty: true
@@ -19,9 +28,12 @@ services:
profiles:
- pi5
image: webview-builder-pi5
platform: linux/arm64
build:
context: .
dockerfile: docker/Dockerfile.pi5
platforms:
- linux/arm64
environment:
- BOARD=pi5
tty: true
@@ -36,9 +48,12 @@ services:
profiles:
- pi4-64
image: webview-builder-pi4-64
platform: linux/arm64
build:
context: .
dockerfile: docker/Dockerfile.pi4
platforms:
- linux/arm64
environment:
- BOARD=pi4-64
tty: true