Skip to content

build: ship static musl release binaries instead of glibc-linked ones - #2

Merged
fcostaoliveira merged 1 commit into
mainfrom
fix/static-musl-release
Aug 17, 2026
Merged

build: ship static musl release binaries instead of glibc-linked ones#2
fcostaoliveira merged 1 commit into
mainfrom
fix/static-musl-release

Conversation

@fcostaoliveira

Copy link
Copy Markdown
Contributor

Fixes #1.

The published -gnu artifacts are built on ubuntu-24.04 and require GLIBC_2.39, so they cannot start on most current LTS targets:

Distro glibc Before After
Ubuntu 24.04 2.39
Ubuntu 22.04 2.35
Debian 12 2.36
RHEL 9 2.34

Why it went unnoticed

The failure is quiet. The binary installs, command -v finds it, and only the loader rejects it — so --version returns a linker error rather than a version string. A harness that verifies the installed build by reading --version can't distinguish that from "wrong version", reports the tool unavailable, and the benchmark skips while the run stays green.

That's exactly what happened: five benchmark suites skipped on a jammy host, CI green, nothing measured.

The existing verification step runs the binary on the build host — the one machine where it's guaranteed to work. A passing smoke test there says nothing about older hosts, which is how this shipped.

The change

Both targets move to *-unknown-linux-musl. Static linking removes the glibc floor entirely, which for a benchmark binary copied onto whatever host is under test is the property that actually matters — the target distro is the one variable you don't control.

Viable here because TLS is rustls + webpki-roots, not OpenSSL: no C TLS dependency, and no reliance on the host's ca-certificates either.

Also adds an assertion that the artifact carries no GLIBC_* symbol versions, failing the build if it does — so this can't silently regress.

Verified locally

Built resque-bench for x86_64-unknown-linux-musl from this branch's config:

EXIT=0
file: ELF 64-bit LSB pie executable, x86-64, static-pie linked
max GLIBC symbol: NONE
runs: resque-bench 0.1.0

Two notes for review

  1. Asset names change *-gnu*-musl. v0.1.0 is days old so I doubt anything pins the old names, but it is a rename.
  2. musl-tools may be unnecessary. My local build succeeded without musl-gcc. I've kept the install step because ring (pulled in by rustls) compiles C and asm and can need it under other toolchain configurations — but if you'd rather not pay the apt-get, it can likely go.

The published -gnu artifacts are built on ubuntu-24.04 and require GLIBC_2.39,
so they cannot start on Ubuntu 22.04 (2.35), Debian 12 (2.36) or RHEL 9 (2.34) --
most current LTS targets.

The failure is quiet. The binary installs, `command -v` finds it, and only the
loader rejects it, so `--version` returns a linker error rather than a version
string. A harness that verifies the installed build by reading --version cannot
tell that apart from "wrong version" and reports the tool unavailable; the
benchmark then skips and the overall run stays green. Observed exactly that: five
suites skipped on a jammy host, CI green, nothing measured.

Switches both targets to *-unknown-linux-musl. Static linking removes the glibc
floor entirely, which for a benchmark binary that gets copied onto whatever host
is under test is the property that actually matters -- the target distro is the
one variable you do not control. Viable here because TLS is rustls with
webpki-roots rather than OpenSSL, so there is no C TLS dependency and no reliance
on the host's ca-certificates either. musl-tools is installed because rustls
pulls in `ring`, which compiles C and assembly.

Also adds an assertion that the artifact carries no GLIBC_* symbol versions, and
fails the build if it does. The existing verification runs the binary on the
build host, which is the one place it is guaranteed to work -- a passing smoke
test there says nothing about older hosts, which is how this shipped.

Asset names change from *-gnu to *-musl accordingly.

Refs #1
@fcostaoliveira
fcostaoliveira merged commit bfb0b10 into main Aug 17, 2026
1 check passed
@fcostaoliveira
fcostaoliveira deleted the fix/static-musl-release branch August 17, 2026 22:16
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.

Release binary requires GLIBC_2.39 — cannot run on Ubuntu 22.04 / Debian 12 / RHEL 9

1 participant