Build Linux releases against glibc 2.27 baseline for compatibility - #5332
Open
Gabriel Dufresne (GabrielDuf) wants to merge 1 commit into
Open
Build Linux releases against glibc 2.27 baseline for compatibility#5332Gabriel Dufresne (GabrielDuf) wants to merge 1 commit into
Gabriel Dufresne (GabrielDuf) wants to merge 1 commit into
Conversation
NativeAOT binaries inherit the glibc symbol versions of the machine that links them. Both Linux legs built on ubuntu-latest (glibc 2.39), so RyuJIT's direct fmod/fmodf references (dotnet/runtime@503970c) bound to GLIBC_2.38 and the app died at startup with "libm.so.6: version `GLIBC_2.38' not found" on Ubuntu 22.04, Debian 12, RHEL 8/9, Amazon Linux 2023 and Fedora <= 38. Those two symbols were the only references above 2.34 on either architecture. Publish the Linux legs inside .NET's official cross-build image, whose /crossrootfs is built from Ubuntu 18.04, so every reference resolves against glibc 2.27. This also replaces the hand-rolled ubuntu-ports arm64 toolchain setup, since the image carries the arm64 rootfs. The SDK tag is read from global.json so the container does not drift off the pinned 10.0.103 the way mcr.microsoft.com/dotnet/sdk:10.0 (now 10.0.400) would, and the Android and GHC toolchains are reclaimed to leave room for the ~6 GB image. check-linux-glibc.ps1 fails the build when any shipped binary requires more than LINUX_GLIBC_BASELINE, so a future runner-image bump cannot silently raise the floor again. package-linux.ps1 feeds the same detection into a Depends: libc6 (>= x.y) field, so apt refuses to install a package the system cannot run instead of installing one that dies on launch; rpm already derived this from its automatic ELF requires. Fixes #5250 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Gabriel Dufresne (GabrielDuf)
requested
a balanced review from Copilot
and removed request for
a team
August 28, 2026 18:56
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
August 28, 2026 18:56
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Builds Linux releases against a glibc 2.27 baseline and verifies/package-records compatibility.
Changes:
- Uses reproducible x64/arm64 cross-build containers.
- Adds glibc requirement verification and Debian dependency metadata.
- Documents supported Linux distributions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/build-release.yml |
Cross-builds and verifies Linux artifacts. |
scripts/check-linux-glibc.ps1 |
Detects and validates required glibc versions. |
scripts/package-linux.ps1 |
Adds the detected libc6 dependency. |
README.md |
Documents the glibc baseline. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
This pull request introduces significant improvements to the Linux build and packaging process, primarily to ensure compatibility with older distributions by enforcing a minimum glibc version requirement. It adds a verification step for glibc dependencies, updates the packaging scripts to record the required glibc version, and transitions Linux builds to use cross-compilation containers for more reliable and reproducible results. Documentation has also been updated to inform users of the new glibc baseline.
Build process improvements:
LINUX_GLIBC_BASELINE(set to 2.27) to.github/workflows/build-release.ymlto define the minimum supported glibc version for Linux builds.glibc compatibility verification:
scripts/check-linux-glibc.ps1that inspects built binaries to determine the highest required glibc version, and integrated it into the build workflow to verify that the glibc requirement does not exceed the baseline.scripts/package-linux.ps1to detect the minimum required glibc version from the built binaries and record it in the.debpackage's dependencies, ensuring package managers enforce the requirement.Documentation update:
README.mdto clearly state that binaries require glibc 2.27 or newer, listing compatible distributions and describing the error shown on older systems.