Skip to content

Build Linux release as static musl binary - #18

Merged
raphael-goetz merged 1 commit into
mainfrom
fix/musl-static-linux-build
Oct 24, 2026
Merged

raphael-goetz merged 1 commit into
mainfrom
fix/musl-static-linux-build

Conversation

@raphael-goetz

Copy link
Copy Markdown
Member

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-gnu on ubuntu-latest (Ubuntu 24.04, glibc 2.39), and a dynamically-linked -gnu binary 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:

  • ureq uses rustls, not OpenSSL/native-tls (the usual musl blocker)
  • flate2 uses the pure-Rust miniz_oxide backend
  • so glibc was the only runtime dynamic dependency

Added a musl-tools install step (needed to link the ring C/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

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>
@raphael-goetz raphael-goetz self-assigned this Oct 24, 2026
@raphael-goetz
raphael-goetz merged commit 963c0b0 into main Oct 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downgrade dependencies to support older linux distributions

1 participant