Skip to content

fix(ci): cargo-zigbuild for GLIBC 2.17 broad compatibility - #952

Merged
ajianaz merged 1 commit into
mainfrom
develop
Aug 8, 2026
Merged

ajianaz merged 1 commit into
mainfrom
develop

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator

What

Linux binaries sekarang di-link terhadap GLIBC 2.17 via cargo-zigbuild + Zig linker.

Why

Binary v0.13.0 sebelumnya butuh GLIBC 2.39 (ubuntu-24.04 runner) — tidak jalan di Debian 12 (2.36), Ubuntu 22.04 LTS (2.35), RHEL 9 (2.34). Sekarang compatible dengan semua Linux dari 2014+.

Changes

  • Matrix: tambah zigbuild: true + glibc: "2.17" untuk Linux targets
  • Install cargo-zigbuild==0.23.0 + ziglang==0.14.1 untuk Linux builds
  • cargo zigbuild --target x86_64-unknown-linux-gnu.2.17 untuk Linux
  • Resolve binary directory step (handle suffixed/standard output path)
  • GLIBC verification step dengan empty guard + sort -V comparison
  • macOS/Windows tetap standard cargo build

CodeCora Findings — All Resolved

# Finding Fix
1 Unpinned pip install Pin ziglang==0.14.1
2 String comparison unreliable sort -V comparison
3 Output path may differ Dynamic resolve step
4 Empty GLIBC bypass Empty guard + fail

Testing

CI workflow akan verify:

  1. Build sukses di ubuntu-24.04 + cargo-zigbuild
  2. GLIBC check step confirm binary ≤ 2.17 (objdump -T)
  3. ARM64 build juga menggunakan zigbuild
  4. macOS/Windows tidak terdampak (standard cargo build)
  5. Binary path resolution handle both suffixed and standard output dirs

Compatibility Matrix

Distro GLIBC Status
Ubuntu 18.04+ 2.27 ✅
Debian 11+ 2.31 ✅
Debian 12 2.36 ✅
Ubuntu 22.04 LTS 2.35 ✅
RHEL 9 / Rocky 9 2.34 ✅
Ubuntu 24.04 2.39 ✅

* fix(ci): use cargo-zigbuild for GLIBC 2.17 broad compat

Linux binaries now link against GLIBC 2.17 via cargo-zigbuild + Zig
linker, making them compatible with RHEL 9, Debian 11/12, Ubuntu
18.04+, and other older Linux distributions.

Changes:
- Add zigbuild: true/glibc: '2.17' to Linux matrix entries
- Install Zig + cargo-zigbuild for Linux builds
- Use cargo zigbuild --target ...2.17 for Linux
- Add GLIBC verification step (objdump check)
- Keep standard cargo build for macOS/Windows

numkong 7.7.0 SIMD kernels still compile (GCC 14 on ubuntu-24.04),
but final binary links against old GLIBC via Zig's cross-linker.

* fix(ci): pin ziglang version + use sort -V for GLIBC comparison

Address CodeCora findings:
- Explicitly install ziglang==0.14.1 alongside cargo-zigbuild
- Replace bash string comparison with sort -V for correct version
  ordering (handles 2.100 > 2.99 edge case)

* fix(ci): resolve zigbuild output path dynamically

Address CodeCora finding: cargo-zigbuild may output to suffixed path
(target/x86_64-unknown-linux-gnu.2.17/release/) depending on version.

- Add 'Resolve binary directory' step that checks both paths
- All subsequent steps (strip, verify, package) use resolved path
- Handles macOS correctly (no glibc suffix, falls through to standard)

* fix(ci): guard against empty GLIBC symbols in verification

Address CodeCora finding #4: if objdump returns empty (corrupt binary,
static link, or silent failure), MAX_GLIBC would be empty and the
sort -V comparison would pass incorrectly.

- Add explicit empty check that fails the build
- Log '<none>' when MAX_GLIBC is empty for debuggability

---------

Co-authored-by: ajianaz <[email protected]>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review could not complete. Cora produced an empty result. Check the workflow logs for errors.


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 6ca9980 into main Aug 8, 2026
14 of 15 checks passed
ajianaz added a commit that referenced this pull request Aug 13, 2026
fix(ci): cargo-zigbuild for GLIBC 2.17 broad compatibility
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