fix(release): ship the Linux binary as static musl (runs on old glibc / WSL) - #517
Merged
Conversation
… / WSL) Live report: the released Linux binary fails on Ubuntu 20.04 / WSL with "libc.so.6: version `GLIBC_2.33' not found" (also 2.32/2.34). Root cause: the release built x86_64-unknown-linux-gnu on ubuntu-22.04 (glibc 2.35), and glibc symbol versioning is forward-only — the binary demanded a glibc floor Ubuntu 20.04 (2.31, an LTS supported into 2025) and every older distro cannot meet. Switch the Linux release target to x86_64-unknown-linux-musl: a FULLY STATIC binary with zero glibc dependency, so it runs on every Linux (20.04, WSL, Alpine, old servers) forever — the standard portable-CLI approach (ripgrep/fd). No perf cost: the daemon uses mimalloc as its global allocator, so libc's allocator is irrelevant, and the CLI is a thin IPC client. Built via cargo-zigbuild (zig supplies the C cross-toolchain — mimalloc's C compiles cleanly — and the static musl link), set up on the Linux leg only via the pinned `ziglang` PyPI wheel; the build step branches musl→zigbuild, everything else→cargo build. `artifact-name: uffs-linux-x64` is unchanged, so install.sh and every consumer are untouched. Verified locally: the full workspace --bins builds for the musl target and all five shipped binaries (uffs/uffsd/uffsmcp/uffs-update/uffs-mft) report `file` = "statically linked". release.yml is valid YAML.
…ombo) The musl leg only runs at release time, so it cannot drift-test itself in a normal PR — pin the exact zig (0.14.1) + cargo-zigbuild (0.22.3) the static musl build was verified with locally, not guessed versions.
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.
The released Linux binary fails on Ubuntu 20.04 / WSL:
libc.so.6: version 'GLIBC_2.33' not found(also 2.32 / 2.34). We builtx86_64-unknown-linux-gnuon ubuntu-22.04 (glibc 2.35), and glibc symbol versioning is forward-only — so the binary demanded a glibc floor that 20.04 (2.31, an LTS into 2025) and every older distro can't meet.Fix: ship static musl
Switch the Linux release target to
x86_64-unknown-linux-musl— a fully static binary, zero glibc dependency, runs on every Linux (20.04, WSL, Alpine, old servers) forever. The standard portable-Rust-CLI approach (ripgrep / fd). No perf cost: the daemon uses mimalloc as its global allocator (libc's allocator is irrelevant) and the CLI is a thin IPC client.ziglangwheel. Build step branches musl→zigbuild, everything else→cargo build.artifact-name: uffs-linux-x64unchanged → install.sh and every consumer untouched.Validation
Locally: full workspace
--binsbuilds forx86_64-unknown-linux-musl, and all five shipped binaries (uffs/uffsd/uffsmcp/uffs-update/uffs-mft) reportfile= "statically linked". release.yml is valid YAML.⚠ The workflow change itself is only exercised by a real release run (fail-safe: a broken build fails the release, no bad artifact ships). The next
ship-fresh→ 0.6.21 is the true test — and the WSL re-test then confirms it end-to-end.