Repository navigation
Conversation
Build RTK from source via multi-stage build (rust:alpine) to produce a native musl binary — the pre-built arm64 release is gnu-linked and incompatible with Alpine's musl libc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace QEMU-emulated arm64 Rust compilation (~23+ min) with native amd64 cross-compilation (~3-4 min) using aarch64-linux-gnu-gcc linker. Switch builder from rust:alpine to rust:slim-bookworm for cross-compilation toolchain availability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The --platform=linux/amd64 on FROM is used deliberately to cross-compile RTK natively instead of under QEMU emulation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Install libc6-dev-arm64-cross and set --sysroot so the aarch64 cross-compiler finds the correct C headers (fixes bits/libc-header-start.h not found). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The glibc cross-compiler (aarch64-linux-gnu-gcc) produces references to glibc-specific symbols (open64, stat64, etc.) that don't exist in musl. Switch to a proper musl cross-compiler from musl.cc that produces musl-compatible binaries for Alpine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace musl.cc download (connection timeout in GitHub Actions) with zig, which natively targets musl and downloads from a reliable CDN (ziglang.org). A wrapper script invokes `zig cc -target aarch64-linux-musl` as the CC. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace broken zig/musl.cc/gcc cross-compilation attempts with a proven
two-stage approach:
- amd64: native musl build on rust:alpine
- arm64: cross-compile using messense/rust-musl-cross:aarch64-musl
(pre-built musl toolchain, runs natively on amd64, no QEMU)
- Dynamic FROM rtk-${TARGETARCH} selects the correct builder per platform
Both builds verified locally producing correct binaries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Closing — superseded by #45 which rebuilt ralphex-fe from Alpine to Debian. The pre-built RTK binary works on Debian without the musl source build workaround this PR introduced. |
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.
Build RTK from source via multi-stage build (rust:alpine) to produce a native musl binary — the pre-built arm64 release is gnu-linked and incompatible with Alpine's musl libc.