fix: build linux gnu binaries against glibc 2.17#62
Merged
Conversation
Same change as dprint/dprint#1203. The published gnu binaries inherited the runner's glibc floor (ubuntu-22.04 = 2.35), breaking older distros (dprint/dprint#796). Building with cargo-zigbuild targeting glibc 2.17 (Rust's own minimum for these targets, CentOS 7+) makes the binaries run anywhere regardless of the runner's glibc. - the test suite builds and runs through cargo-zigbuild too, so tests exercise binaries linked the same way as the published ones - a readelf check verifies the max required GLIBC_ symbol never exceeds the target version (debug on PRs, release right before zipping) - aarch64 gnu no longer needs gcc-aarch64-linux-gnu -- zigbuild provides the cross linker
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.
Same change as dprint/dprint#1203 (fixes the same class of issue as dprint/dprint#796 for this plugin).
The published linux gnu binaries inherited the runner's glibc floor (ubuntu-22.04 = glibc 2.35), so they fail on older distros. This builds them with cargo-zigbuild targeting glibc 2.17 — Rust's own minimum for these targets (CentOS 7+) — so the runner's glibc no longer matters.
cargo-zigbuild teston the x86_64 gnu target, so tests exercise binaries linked exactly like the published ones (glibc 2.17 binaries run fine on the newer-glibc runner)readelfguard verifies the max requiredGLIBC_symbol never exceeds the target version: on the debug build for PRs, and on the release build after the tests so it checks the exact binary that gets zipped (readelf instead of objdump because the aarch64 binary is checked on the x86_64 runner)gcc-aarch64-linux-gnuor the linker env var — zigbuild provides the cross linker (aarch64-musl keeps its own gcc install; its linker comes from.cargo/config.toml)Unlike the dprint repo, no
LZMA_API_STATICis needed here — this crate has no native system-library dependencies (checked Cargo.lock: no lzma-sys/zstd-sys/ring).