Skip to content

*: cross-compile the docker image instead of emulating arm64 - #4802

Open
OisinKyne wants to merge 1 commit into
mainfrom
ci/native-arm
Open

OisinKyne wants to merge 1 commit into
mainfrom
ci/native-arm

Conversation

@OisinKyne

Copy link
Copy Markdown
Contributor

The arm64 leg of the docker build compiled charon (including herumi bls via cgo) under QEMU, which dominates build-push-deploy time (median 22 min, p90 71 min over the last 100 runs).

The builder stage now runs on $BUILDPLATFORM and cross-compiles for $TARGETARCH, installing gcc-aarch64-linux-gnu/libc6-dev-arm64-cross (or the amd64 equivalents on an arm64 host) and setting CC, as build-release-binaries.yml already does for the arm64 release binary. Build flags are unchanged (dynamic glibc binary, GO_BUILD_FLAG passed through). The charon version sanity check moves to the runtime stage so it runs on the target arch, and it now fails the build if the binary doesn't run. QEMU stays for the runtime stage's small RUN steps; runners are unchanged.

promrated has no cgo deps, so it cross-compiles with CGO_ENABLED=0 and its runtime stage is alpine:3.24 instead of the full golang image.

Verified locally: CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build . produces an AArch64 binary needing GLIBC_2.34 with herumi linked. First CI run's runtime-stage charon version (under QEMU) is the end-to-end check.

Unrelated, noticed: promrated pushes have failed since August because Docker Hub tag immutability rejects obolnetwork/promrated:latest.

category: refactor
ticket: none

Build the Go binary on the build platform and cross-compile for the
target (cgo with gcc-aarch64-linux-gnu for arm64, as the release
binaries do), so multi-platform image builds no longer compile under
QEMU. Run the version sanity check in the runtime stage, where it now
fails the build if the binary can't run. promrated has no cgo deps, so
it cross-compiles with CGO_ENABLED=0 into an alpine runtime stage.

category: refactor
ticket: none
@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.60%. Comparing base (bd4e892) to head (ad29815).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4802      +/-   ##
==========================================
- Coverage   67.61%   67.60%   -0.01%     
==========================================
  Files         254      254              
  Lines       33609    33609              
==========================================
- Hits        22725    22723       -2     
- Misses      10883    10885       +2     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant