feat(build): add musl binaries for Alpine Linux support#762
Draft
Conversation
Add linux-x64-musl and linux-arm64-musl native binaries using Bun's built-in musl cross-compilation targets. This enables the curl installer and self-upgrade to work on Alpine Linux and other musl-based systems. Build system (script/build.ts): - Extend BuildTarget with optional libc field - Add musl entries to ALL_TARGETS (7 targets, up from 5) - Update getPackageName/getBunTarget/parseTarget for musl suffix Runtime detection (src/lib/binary.ts): - Add isMusl() with two heuristics: ld-musl linker check and ldd output - getPlatformBinaryName() now returns -musl suffix on musl systems - Auto-propagates to upgrade, delta-upgrade, and download URLs Install script: - Add detect_musl function with same heuristics - Apply libc_suffix to both nightly (GHCR) and stable (GitHub) downloads - Include libc tag in error telemetry CI (.github/workflows/ci.yml): - Add linux-x64-musl and linux-arm64-musl to full build matrix - Add Alpine Docker smoke test for linux-x64-musl No changes needed to .craft.yml (regex already matches), Homebrew formula (correctly excludes musl), or downstream consumers of getPlatformBinaryName().
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Contributor
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 82.14%. Project has 1638 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.45% 95.44% -0.01%
==========================================
Files 236 236 —
Lines 35923 35950 +27
Branches 0 0 —
==========================================
+ Hits 34290 34312 +22
- Misses 1633 1638 +5
- Partials 0 0 —Generated by Codecov Action |
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
Closes #754
sentry-linux-x64-muslandsentry-linux-arm64-muslnative binaries using Bun's built-in musl cross-compilation targetsChanges
Build system (
script/build.ts): ExtendBuildTargetwithlibc?: "musl", add 2 musl entries toALL_TARGETS, updategetPackageName/getBunTarget/parseTargetto handle musl suffix.Runtime detection (
src/lib/binary.ts): NewisMusl()function checks for/lib/ld-musl-<arch>.so.1(fast stat) withldd --versionfallback.getPlatformBinaryName()appends-muslon musl systems — auto-propagates to upgrade and download URLs.Install script (
install):detect_muslfunction with same two heuristics.libc_suffixapplied to both nightly (GHCR) and stable (GitHub Releases) download paths.libctag added to error telemetry.CI (
.github/workflows/ci.yml):linux-x64-muslandlinux-arm64-musladded to full build matrix (cross-compiled on ubuntu-latest). Alpine Docker smoke test for x64-musl.No changes needed to
.craft.yml(regex already matches), Homebrew formula (correctly excludes musl), or downstream consumers ofgetPlatformBinaryName().