fix(release): ship static musl Linux binaries - #86
Merged
Merged
Conversation
The Linux release binaries were built on `ubuntu-24.04` against
`x86_64-unknown-linux-gnu`, so they link against GLIBC_2.39 and refuse to
start anywhere older:
/usr/local/bin/forgeguard: /lib/x86_64-linux-gnu/libc.so.6:
version `GLIBC_2.39' not found (required by /usr/local/bin/forgeguard)
That covers Ubuntu 22.04, Debian 12, and most CI base images. It was found
while running the DeepSWE A/B harness: every treatment trial died during
image build, because `install.sh` succeeded and `forgeguard --version`
then failed.
Both Linux targets now build `*-unknown-linux-musl` and link statically, so
one binary runs on every distro, glibc or not. Asset names are unchanged, so
`install.sh`, `npm/scripts/install.js`, and the Homebrew formula template
need no change.
`reqwest`, `ureq`, `hyper`, `libloading`, and `dlopen` are absent from every
manifest, so neither static NSS resolution nor `dlopen` applies here.
wahyuakbarwibowo
approved these changes
Sep 18, 2026
wahyuakbarwibowo
left a comment
Contributor
There was a problem hiding this comment.
install for linux yeah
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.
Problem
Linux release binaries are built on
ubuntu-24.04againstx86_64-unknown-linux-gnu(.github/workflows/release.yml:24,75), so theylink against GLIBC_2.39 and refuse to start on anything older:
That breaks Ubuntu 22.04 (glibc 2.35), Debian 12 (2.36), and most CI base
images. Release
v0.17.0ships only gnu builds — there is no musl asset tofall back to.
Found while running the DeepSWE A/B harness against
v0.17.0: everytreatment trial failed during Docker image build, at the last step, because
install.shdownloaded fine andforgeguard --versionthen aborted.Change
Both Linux matrix entries now target
*-unknown-linux-musland installmusl-toolsfor the bundled C dependencies (rusqlitewithbundled,zstd). The binary links statically, so one artifact runs on every distro,glibc or musl.
Asset names are unchanged, so
install.sh,npm/scripts/install.js, and theHomebrew formula template need no edit.
Verification
Built the workspace for musl in
rust:alpinewithmusl-devinstalled, thenran the result on the distro the current release fails on.
Build, with
rusqlitebundled andzstdlinking cleanly:The artifact is static:
Running it on Ubuntu 22.04:
Checked on
aarch64-unknown-linux-musl, since that builds natively on themachine at hand.
x86_64-unknown-linux-musluses the same toolchain path andthe same two C dependencies, but has not been built here — the x86_64 build
job on a tag is its first real exercise.
Why musl does not regress glibc users
A static musl binary carries its own libc and never looks for
libc.so.6, soglibc distros keep working — the Ubuntu 22.04 run above is that case. The two
usual static-linking pitfalls do not apply here: a grep over
Cargo.tomlandevery
crates/*/Cargo.tomlforreqwest|ureq|hyper|libloading|dlopen|getaddrinforeturns nothing, so there is no DNS/NSS path and no dynamic library loading.
Remaining trade-off: musl's allocator is slower than glibc's under heavy
multithreaded allocation. No
rayonor custom allocator appears in anymanifest, so the exposure is small. If indexing later measures slow, adding
mimallocas the global allocator addresses it without changing targets.Note for reviewers
release.ymlonly runs on a tag orworkflow_dispatch, so the checks on thisPR exercise
ci.ymland do not build either musl target. The evidence above isfrom a local container build; the x86_64 target is first proven when a tag is
cut.