Add musl target builds for glibc-independent binary distribution#46
Merged
Conversation
- Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl to build matrix - Use cross-rs for musl cross-compilation in Docker containers - Add gmp-mpfr-sys with force-cross feature for musl builds - Conditionally set binary path for cross vs cargo builds - Restrict publish-crate and release jobs to tag pushes only - Add branch trigger for build testing - Bump version to 0.5.8 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move aarch64-unknown-linux-musl to ubuntu-latest (x86_64) runner since cross-rs Docker images are x86_64-only - Add pre-build symlinks in Cross.toml to bridge tool naming mismatch (GMP configure expects "aarch64-unknown-linux-musl-*" but cross-rs provides "aarch64-linux-musl-*") - Both musl targets verified: static-linked, glibc-independent binaries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use aarch64-linux-gnu-strip for aarch64 musl binary on x86_64 runner - Install binutils-aarch64-linux-gnu for cross-arch strip support - Add fail-fast: false so one build failure doesn't cancel others Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mplify version step - Remove test branch trigger from release workflow - Pin cross-rs Docker images to :0.2.5 (was :main) - Pin cross install to --tag v0.2.5 for reproducibility - Move strip to Cargo.toml (strip = true) and remove manual strip steps - Remove unreachable SHA fallback in Get version step (only tag trigger exists) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
azuchi
approved these changes
Apr 14, 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
x86_64-unknown-linux-musl/aarch64-unknown-linux-muslターゲットを追加し、glibc非依存の静的リンクバイナリを配布可能にしたcross(cross-rs v0.2.5) によるDockerベースのmuslクロスコンパイル環境を構成strip = trueを[profile.release]に統合し、全ターゲットで統一的にシンボル除去Background
GitHub Actions の
ubuntu-latestが Ubuntu 24.04 (glibc 2.39) に切り替わり、リリースバイナリが glibc 2.38+ に依存するようになった。AL2023 (glibc 2.34) 等の環境で動作しないため、musl静的リンクバイナリの追加が必要。Changes
.github/workflows/release.ymluse_crossフラグで分岐)crossインストールステップ追加(musl ターゲットのみ)target/{target}/release/vstarget/release/)fail-fast: false追加publish-crate/releaseにif: startsWith(github.ref, 'refs/tags/')ガード追加Cross.toml(新規)Cargo.toml0.5.7→0.5.8gmp-mpfr-sysにforce-crossフィーチャー追加(musl環境でのGMPビルド対応)strip = trueを[profile.release]に追加New release assets
electrs-v0.5.8-{platform}.tar.gz+.sha256aarch64-linux-musl← NEWx86_64-linux-musl← NEWaarch64-linux-gnu(既存)x86_64-linux-gnu(既存)aarch64-apple-darwin(既存)Test plan
v0.5.8-rc1で全5ターゲットのビルド成功を確認(Run)lddでnot a dynamic executableを確認🤖 Generated with Claude Code