Add linux_arm64 builds for Ebitengine and Bevy

Batocera and the ES-family distributions run on ARM as much as on
x86_64 — Raspberry Pi, Odroid, the retro handhelds — and a linux_x64
binary installs there but will not start. There was no Linux ARM asset
kind at all: KINDS had linux_x86 and linux_x64 and mac_arm64, but
nothing for 64-bit ARM Linux.

Registering the kind is deliberately separate from producing it: a
platform service only includes BuildLinuxArm64 once its pipeline builds
the artifact, otherwise /api/builds would report it missing for every
release. Hence Ebitengine and Bevy only. Godot needs a Linux arm64
export preset in each game repo first; LÖVE fuses an upstream AppImage
that ships x86_64 only; TIC-80's export command has no ARM target.

Ebitengine needs cgo on Linux, so binary_build gained a cross-compiler
argument — and unsets CC for native targets, otherwise a build after
the ARM one silently picks up the cross gcc.

Verified by cross-compiling both demos in the rebuilt images: each
produced a genuine AArch64 ELF (e_machine 183), not a silent fallback.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-16 20:57:23 +02:00
co-authored by Claude Opus 5
parent f805555cc6
commit 64b5c16dc3
7 changed files with 50 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
module WarpEngine module WarpEngine
class ReleaseAsset < ApplicationRecord class ReleaseAsset < ApplicationRecord
KINDS = %w[cartridge source html docs KINDS = %w[cartridge source html docs
win_x86 win_x64 linux_x86 linux_x64 win_x86 win_x64 linux_x86 linux_x64 linux_arm64
mac_x64 mac_arm64 mac_universal].freeze mac_x64 mac_arm64 mac_universal].freeze
belongs_to :release belongs_to :release
@@ -0,0 +1,28 @@
module WarpEngine
module Platforms
module Builds
# Linux on 64-bit ARM: Raspberry Pi 4/5, Odroid, and the retro handhelds.
# Batocera and the ES-family distributions run on these as much as on
# x86_64, and an x64 binary installs there but will not start — which is
# why this is a separate kind rather than something linux_x64 can cover.
#
# Include this in a platform service only once its pipeline actually
# produces the artifact: registering the kind makes /api/builds report it
# as missing for every release until then.
module BuildLinuxArm64
extend ActiveSupport::Concern
included do
register_expected_kind "linux_arm64"
end
private
def linux_arm64_asset_path(versioned)
path = full_path("#{versioned}-linux-arm64.zip")
{ "linux_arm64" => path } if File.file?(path)
end
end
end
end
end
@@ -65,6 +65,15 @@ steps:
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc \ CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc \
cargo build --release --target x86_64-pc-windows-gnu cargo build --release --target x86_64-pc-windows-gnu
pack_binary "win-x64" "target/x86_64-pc-windows-gnu/release/<%= name %>.exe" "<%= name %>.exe" pack_binary "win-x64" "target/x86_64-pc-windows-gnu/release/<%= name %>.exe" "<%= name %>.exe"
# linux-arm64: Raspberry Pi, Odroid, retro handhelds. pkg-config has to
# be told it may cross, and pointed at the arm64 .pc files, otherwise
# alsa-sys/libudev-sys pick up the host x86_64 libraries.
echo "==> Building linux-arm64 binary"
PKG_CONFIG_ALLOW_CROSS=1 \
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
cargo build --release --target aarch64-unknown-linux-gnu
pack_binary "linux-arm64" "target/aarch64-unknown-linux-gnu/release/<%= name %>" "<%= name %>"
- name: upload - name: upload
image: alpine image: alpine
@@ -81,7 +90,7 @@ steps:
META_DST="<%= name %>-$VERSION.metadata.json" META_DST="<%= name %>-$VERSION.metadata.json"
cp $META_SRC $META_DST cp $META_SRC $META_DST
BINS="" BINS=""
for slug in win-x64 linux-x64; do for slug in win-x64 linux-x64 linux-arm64; do
[ -f "<%= name %>-$VERSION-$slug.zip" ] && BINS="$BINS <%= name %>-$VERSION-$slug.zip" [ -f "<%= name %>-$VERSION-$slug.zip" ] && BINS="$BINS <%= name %>-$VERSION-$slug.zip"
done done
for f in $FILE $META_DST $BINS; do for f in $FILE $META_DST $BINS; do
@@ -6,6 +6,7 @@ module WarpEngine
include Builds::BuildWeb include Builds::BuildWeb
include Builds::BuildWinX64 include Builds::BuildWinX64
include Builds::BuildLinuxX64 include Builds::BuildLinuxX64
include Builds::BuildLinuxArm64
label "Bevy" label "Bevy"
end end
@@ -44,11 +44,14 @@ steps:
# helper: builds one target + zips it with a single root folder # helper: builds one target + zips it with a single root folder
# (unix zip keeps the executable bit) # (unix zip keeps the executable bit)
binary_build() { binary_build() {
B_GOOS="$1"; B_GOARCH="$2"; B_CGO="$3"; B_EXT="$4"; B_TARGET="$5" B_GOOS="$1"; B_GOARCH="$2"; B_CGO="$3"; B_EXT="$4"; B_TARGET="$5"; B_CC="$6"
PKG_DIR="<%= name %>-$VERSION-$B_TARGET" PKG_DIR="<%= name %>-$VERSION-$B_TARGET"
echo "==> Building $PKG_DIR" echo "==> Building $PKG_DIR"
rm -rf "$PKG_DIR" "$PKG_DIR.zip" rm -rf "$PKG_DIR" "$PKG_DIR.zip"
mkdir -p "$PKG_DIR" mkdir -p "$PKG_DIR"
# cgo cross-compile needs an explicit cross gcc; a native build must
# not see CC at all, otherwise go picks the wrong compiler
if [ -n "$B_CC" ]; then export CC="$B_CC"; else unset CC; fi
CGO_ENABLED=$B_CGO GOOS=$B_GOOS GOARCH=$B_GOARCH go build -o "$PKG_DIR/<%= name %>$B_EXT" . CGO_ENABLED=$B_CGO GOOS=$B_GOOS GOARCH=$B_GOARCH go build -o "$PKG_DIR/<%= name %>$B_EXT" .
if [ -f LICENSE ]; then cp LICENSE "$PKG_DIR/"; fi if [ -f LICENSE ]; then cp LICENSE "$PKG_DIR/"; fi
if [ -f README.md ]; then cp README.md "$PKG_DIR/"; fi if [ -f README.md ]; then cp README.md "$PKG_DIR/"; fi
@@ -56,10 +59,13 @@ steps:
rm -rf "$PKG_DIR" rm -rf "$PKG_DIR"
echo "==> $PKG_DIR.zip kesz" echo "==> $PKG_DIR.zip kesz"
} }
# CI (linux builder) builds these three: # CI (linux builder) builds these four:
binary_build "windows" "386" "0" ".exe" "win-x86" binary_build "windows" "386" "0" ".exe" "win-x86"
binary_build "windows" "amd64" "0" ".exe" "win-x64" binary_build "windows" "amd64" "0" ".exe" "win-x64"
binary_build "linux" "amd64" "1" "" "linux-x64" binary_build "linux" "amd64" "1" "" "linux-x64"
# linux-arm64: Raspberry Pi, Odroid, retro handhelds — cgo cross-build
# against the arm64 X11/GL/ALSA headers in the builder image
binary_build "linux" "arm64" "1" "" "linux-arm64" "aarch64-linux-gnu-gcc"
- name: artifact - name: artifact
image: alpine image: alpine
@@ -7,6 +7,7 @@ module WarpEngine
include Builds::BuildWinX86 include Builds::BuildWinX86
include Builds::BuildWinX64 include Builds::BuildWinX64
include Builds::BuildLinuxX64 include Builds::BuildLinuxX64
include Builds::BuildLinuxArm64
include Builds::BuildMacX64 include Builds::BuildMacX64
include Builds::BuildMacArm64 include Builds::BuildMacArm64
+1 -1
View File
@@ -1,3 +1,3 @@
module WarpEngine module WarpEngine
VERSION = "0.2.0" VERSION = "0.3.0"
end end