Repository navigation
fix(ci): cargo-zigbuild for GLIBC 2.17 broad compatibility - #951
Merged
Merged
Conversation
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.
🔍 Cora AI Code ReviewReview powered by cora-code · BYOK · MIT |
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)
| ls -lh "${ORT_LIB_DIR:-ort-lib}/" || true | ||
|
|
||
| - name: Build release binaries | ||
| - name: Build release binaries (zigbuild — GLIBC 2.17) |
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)
| - name: Verify GLIBC requirement (Linux zigbuild only) | ||
| if: matrix.zigbuild == true | ||
| run: | | ||
| BIN_DIR="${{ steps.bindir.outputs.path }}" |
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
This was referenced Aug 8, 2026
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
* 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]>
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.
What
Linux binaries sekarang di-link terhadap GLIBC 2.17 via
cargo-zigbuild+ Zig linker, membuatnya compatible dengan distribusi Linux yang lebih lama.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). Mayoritas server production masih di range itu.
cargo-zigbuildcompile dengan GCC 14 di ubuntu-24.04 (numkong SIMD support), tapi relink binary against GLIBC 2.17 via Zig cross-linker. Hasil: binary yang jalan di RHEL 9, Debian 11/12, Ubuntu 18.04+ tanpa sacrifice SIMD performance.Changes
zigbuild: true+glibc: "2.17"untuk Linux targetscargo-zigbuild==0.23.0+ Zig untuk Linux buildscargo zigbuild --target x86_64-unknown-linux-gnu.2.17untuk Linuxobjdump -Tcheck, fail jika > 2.17)cargo buildCompatibility
Testing
CI akan verify: