From c12ee6055cca25d13eb789697f762ff65a2b8e66 Mon Sep 17 00:00:00 2001 From: KaraZajac Date: Sat, 23 May 2026 21:17:03 -0400 Subject: [PATCH] release.yml: arm64-static via dockcross/linux-arm64-musl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Third attempt at arm64-static. Previous two: 1. Alpine container on ubuntu-24.04-arm: 'JavaScript Actions in Alpine containers only supported on x64 Linux runners' — actions/checkout JS bundle can't run. 2. musl-tools on ubuntu-24.04-arm: musl-gcc + Ubuntu's /usr/include collide. -isystem /usr/include pulls glibc stdio.h whose __gnuc_va_list + __time64_t types conflict with musl's stdio.h. -isystem /usr/include/linux alone leaves us missing asm/ headers. dockcross/linux-arm64-musl avoids both: - Image base is Debian (glibc) → actions/checkout works. - Ships aarch64-linux-musl-gcc with a CONSISTENT musl + linux- uapi sysroot. No header collision. The dockcross pattern is: pull the image, ask it to spit out its wrapper script ('docker run --rm dockcross/linux-arm64-musl' prints a bash wrapper to stdout), then './dockcross bash -c ...' runs the command inside the toolchain container with the cwd volume-mounted. Produces a statically-linked aarch64 ELF binary, same packaging flow as the x86_64-static job. --- .github/workflows/release.yml | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e63d0fd..d0fba06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,36 +94,36 @@ jobs: skeletonkey-x86_64-static skeletonkey-x86_64-static.sha256 - # Portable static-musl arm64 build. Runs natively on GitHub's - # ubuntu-24.04-arm runner (free for public repos). Can't use the - # Alpine container trick here because "JavaScript Actions in Alpine - # containers are only supported on x64 Linux runners" — actions/ - # checkout would fail. Instead we use musl-tools (Ubuntu's - # apt-installed musl-gcc wrapper) on the glibc-based runner; the - # produced binary is still statically linked against musl, just - # built outside an Alpine container. + # Portable static-musl arm64 build. Cross-compile from the x86_64 + # runner using dockcross/linux-arm64-musl — a Debian-based cross + # toolchain image that ships aarch64-linux-musl-gcc with a clean + # musl sysroot + Linux uapi headers. Avoids the two prior failure + # modes: + # (1) Alpine on arm64: actions/checkout JS bundle requires glibc- + # compatible Node, which GitHub doesn't inject on arm64. + # (2) musl-tools on ubuntu-24.04-arm: musl-gcc + Ubuntu's + # /usr/include collide (glibc stdio.h vs musl stdio.h → + # __gnuc_va_list / __time64_t conflicts). + # dockcross runs glibc Debian (so checkout works), invokes a + # bundled aarch64-linux-musl-gcc whose sysroot has its own + # consistent musl + linux-uapi tree. build-static-arm64: - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-latest name: build (arm64-static / musl) steps: - uses: actions/checkout@v4 - - name: install musl + build deps + - name: run dockcross arm64-musl build run: | - sudo apt-get update -qq - sudo apt-get install -y --no-install-recommends \ - musl-tools musl-dev linux-libc-dev build-essential - - name: build static (musl-gcc) - run: | - # musl-gcc wraps gcc with musl's libc + headers. We still - # need Linux kernel uapi headers (linux/capability.h, - # linux/netfilter/*.h, etc.) which musl doesn't ship — - # pull them from the glibc-side linux-libc-dev package - # via -isystem so they don't clash with libc decls. - # -static is the whole point; MSG_COPY define mirrors the - # x86_64 build (musl lacks the SysV msg flag). - make CC=musl-gcc \ - CFLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-pointer-arith -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DMSG_COPY=040000 -isystem /usr/include -isystem /usr/include/aarch64-linux-gnu" \ - LDFLAGS=-static + # Fetch the dockcross wrapper script (handles UID/GID, + # volume mounts, env passing). Image already has + # aarch64-linux-musl-gcc on PATH. + docker run --rm dockcross/linux-arm64-musl > ./dockcross + chmod +x ./dockcross + ./dockcross bash -c ' + make CC=aarch64-linux-musl-gcc \ + CFLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-pointer-arith -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DMSG_COPY=040000" \ + LDFLAGS=-static + ' file skeletonkey ls -la skeletonkey - name: rename + checksum