Skip to content

fix(release): ship the Linux binary as static musl (runs on old glibc / WSL) - #517

Merged
githubrobbi merged 2 commits into
mainfrom
fix/linux-musl-static
Jul 3, 2026
Merged

fix(release): ship the Linux binary as static musl (runs on old glibc / WSL)#517
githubrobbi merged 2 commits into
mainfrom
fix/linux-musl-static

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

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 built x86_64-unknown-linux-gnu on 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.

  • Built via cargo-zigbuild (zig supplies the C cross-toolchain so mimalloc's C compiles, plus the static musl link), set up on the Linux leg only via the pinned ziglang wheel. Build step branches musl→zigbuild, everything else→cargo build.
  • Pinned to the exact zig 0.14.1 + cargo-zigbuild 0.22.3 the build was validated with locally — this workflow leg only runs at release time, so it can't drift-test itself.
  • artifact-name: uffs-linux-x64 unchanged → install.sh and every consumer untouched.

Validation

Locally: full workspace --bins builds for x86_64-unknown-linux-musl, and all five shipped binaries (uffs/uffsd/uffsmcp/uffs-update/uffs-mft) report file = "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.

… / 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.
@githubrobbi
githubrobbi enabled auto-merge July 3, 2026 20:57
@githubrobbi
githubrobbi added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit 630be95 Jul 3, 2026
26 checks passed
@githubrobbi
githubrobbi deleted the fix/linux-musl-static branch July 3, 2026 21:13
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.

1 participant