Skip to content

build: use cargo-zigbuild for glibc 2.28 single-build Linux compatibility#1

Open
re2zero wants to merge 1 commit into
mainfrom
issue/glibc2.28-zigbuild
Open

build: use cargo-zigbuild for glibc 2.28 single-build Linux compatibility#1
re2zero wants to merge 1 commit into
mainfrom
issue/glibc2.28-zigbuild

Conversation

@re2zero

@re2zero re2zero commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace the 3-image Linux build matrix (ubuntu 20.04/22.04/24.04) with a single ubuntu:22.04 build
  • Use cargo-zigbuild to target glibc 2.28, making the binary compatible with UOS V20, Debian 10+, all Ubuntu LTS, and any distro with glibc >= 2.28
  • build.rs now auto-detects glibc-versioned targets and uses zigbuild for the herdr submodule

Rationale

UOS V20 has glibc 2.28, but the old ubuntu 20.04 image provides glibc 2.31. The binary built on ubuntu 20.04 fails on UOS V20 with version not found errors. zig's linker can target specific glibc versions, so we can build on a modern host (ubuntu 22.04) while producing a binary compatible with glibc 2.28+.

Since glibc is backward-compatible, one build covers all target distributions, reducing CI matrix from 3 to 1.

Changes

File Change
release.yml Linux matrix: ubuntu:22.04 only, build with cargo-zigbuild, binary path updated to target/x86_64-unknown-linux-gnu/release/
build.rs build_herdr() detects glibc-versioned TARGET and uses zigbuild instead of plain cargo

Test plan

  • Verify workflow runs on CI
  • Test on UOS V20 (glibc 2.28) — check ldd zenix shows no missing glibc symbols
  • Test on Debian 12 / Ubuntu 24.04 — verify backward compatibility

…lity

Replace the 3-image Linux build matrix (ubuntu 20.04/22.04/24.04) with
a single ubuntu:22.04 build using cargo-zigbuild targeting glibc 2.28.
The resulting binary runs on UOS V20, Debian 10+, all Ubuntu LTS, and
any distro with glibc >= 2.28.

build.rs now detects glibc-versioned targets and automatically uses
cargo-zigbuild when building the herdr submodule.
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