Repository navigation
Build Linux release as static musl binary - #18
Merged
Merged
Conversation
The Linux release was built for x86_64-unknown-linux-gnu on ubuntu-latest (Ubuntu 24.04, glibc 2.39), so the dynamically-linked binary refused to run on distros with older glibc (e.g. Debian 12 at glibc 2.36). See #16. Switch the Linux target to x86_64-unknown-linux-musl to produce a fully static binary with no glibc floor. This is painless here because ureq uses rustls (not OpenSSL) and flate2 uses the pure-Rust backend, so glibc was the only runtime dynamic dependency. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Fixes the root cause behind #16. The Linux release binary required glibc 2.39 and wouldn't run on Debian 12 (glibc 2.36).
The issue framed this as needing to "downgrade dependencies massively," but the glibc requirement does not come from the Rust crates. It comes from the build host: the Linux release was built for
x86_64-unknown-linux-gnuonubuntu-latest(Ubuntu 24.04, glibc 2.39), and a dynamically-linked-gnubinary inherits the host's glibc as a hard floor via symbol versioning.Fix
Switch the Linux target to
x86_64-unknown-linux-musl, producing a fully static binary with no glibc dependency at all — runs on Debian 12, old CentOS, Alpine, scratch containers, etc.This is painless for this project specifically because:
urequses rustls, not OpenSSL/native-tls (the usual musl blocker)flate2uses the pure-Rustminiz_oxidebackendAdded a
musl-toolsinstall step (needed to link theringC/asm objects). The release asset name is unchanged (codezero-linux-x86_64).Verification
YAML validated locally. The musl compile itself runs on the Linux CI runner on tag push (can't cross-compile linux-musl from a macOS host without a separate toolchain), so it's exercised on the next tagged release.
Closes #16
🤖 Generated with Claude Code