fix(docker): install arm64 target libc headers for the cross build#964
Merged
Conversation
The slim golang image ships gcc-aarch64-linux-gnu's runtime libs but not the arm64 libc dev headers, so the CGO cross-compile failed with `bits/libc-header-start.h: No such file`. Add libc6-dev-arm64-cross, which provides the aarch64 sysroot headers. Verified by reproducing the amd64->arm64 cross-compile under emulation (fails without, CROSS_OK with). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
minhd-vu
enabled auto-merge (squash)
July 21, 2026 14:45
praetoriansentry
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The Docker publish workflow added in #963 fails on the arm64 cross-compile step (failed run):
Cause
The build stage installs
gcc-aarch64-linux-gnu, which pulls the arm64 runtime libs (libc6-arm64-cross,libgcc-14-dev-arm64-cross) but not the arm64 libc dev headers. The CGO cross-compile then can't findbits/libc-header-start.h/bits/wordsize.h. The release workflow (make cross) doesn't hit this because it runs on the fullubuntu-latestVM where those headers already exist; the slimgolangimage ships neither.The amd64 image builds fine (native compile on the amd64 runner), so only the arm64 path was affected.
Fix
Install
libc6-dev-arm64-cross, which provides the aarch64 sysroot headers.Validation
Reproduced the exact
amd64 → arm64cross-compile under emulation:libc6-dev-arm64-cross: identicalbits/libc-header-start.h: No such filefailure.CROSS_OK.arm64 image also rebuilt and runs (
polycli version) locally.🤖 Generated with Claude Code