Skip to content

Build *-unknown-linux-gnu binaries with old glibc for portability #12005

Open

Description

@xtqqczze
Platform Kernel glibc
*-unknown-linux-gnu 1 3.2 2.17
ubuntu-22.04 5.15 2.35
ubuntu-24.04 6.8 2.39
ubuntu-26.04 7.0 2.43

We could use Ubuntu 22.04 in CI to link against an oldish glibc version.

Activity

  1. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    Strongly disagree for performance. We already have musl binary. Please close this issue soon.

  2. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    But I'm OK to include output of libc.so.6 --version | head -n 1.

  3. xtqqczze commented on Apr 26, 2026

    @xtqqczze
    CollaboratorAuthor

    We should prioritize shipping binaries that actually run on supported platforms, which we cannot guarantee if they’re linked against a newer glibc than the target system provides.

    For example, such binaries may fail on Ubuntu 22.04, which remains under standard support until April 2027.

  4. oech3 commented on Apr 26, 2026

    @oech3
    Contributor
  5. xtqqczze commented on Apr 26, 2026

    @xtqqczze
    CollaboratorAuthor

    Perhaps we should consider discontinuing the GNU-linked binaries entirely. Users who specifically need them can install them through their package manager or build from source.

  6. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    Unfortunately, static musl binary cannot support stdbuf. So we cannot reduce to one target.

  7. xtqqczze commented on Apr 26, 2026

    @xtqqczze
    CollaboratorAuthor

    We also have latest-commit binaries.

  8. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    latest-commit is coming from same CICD.yml workflow. So nothing we should especially care about it (though release build for all unmerged PRs is overkill for me).

  9. xtqqczze commented on Apr 26, 2026

    @xtqqczze
    CollaboratorAuthor

    I also don’t think we want *-unknown-linux-gnu binaries to effectively require glibc 2.43 once ubuntu-latest on GitHub-hosted runners moves to 26.04, so we should address this before that happens.

  10. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    We should fix (lib)stdbuf instead of dropping glibc version.

  11. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    Oh, I was missing that there is nothing we can LD_PRELOAD to musl binary. So actually nothing to fix.

  12. oech3 commented on Apr 26, 2026

    @oech3
    Contributor

    In my opinion, people want to use latest stdbuf should use latest Ubuntu LTS too. Also I don't think may people are interested in stdbuf.

  13. oech3 commented on May 1, 2026

    @oech3
    Contributor

    We currently run GnuTests with release-small profile. If we used outdated Ubuntu at there and publish binaries, it is 0 cost.
    Also GNU has some unshare tests masking /proc.

  14. xtqqczze commented on May 14, 2026

    @xtqqczze
    CollaboratorAuthor

    Strongly disagree for performance. We already have musl binary. Please close this issue soon.

    @sylvestre Compatibility should take priority over performance, since GNU parity is the goal? We should check whether GNU coreutils 9.11 is compatible with older glibc versions.

  15. oech3 commented on May 14, 2026

    @oech3
    Contributor

    I say again, We are already distributing musl binary.

  16. 20 remaining items

  17. xtqqczze commented on May 30, 2026

    @xtqqczze
    CollaboratorAuthor

    Separately, I think we should make sure that binaries built against an older glibc pass tests.

    I think this is important for alignment with the project’s design goals. If GNU Coreutils can be built and used with an older glibc, then uutils should aim to support that as well.

  18. oech3 commented on May 30, 2026

    @oech3
    Contributor

    Reuse https://github.com/uutils/coreutils/blob/main/.devcontainer/Dockerfile if it is needed. I'm not happy with encouraging people to hesttate updating to newer secure Linux.

  19. xtqqczze commented on May 30, 2026

    @xtqqczze
    CollaboratorAuthor

    I'm not happy with encouraging people to hesttate updating to newer secure Linux.

    I don't think that's relevant here. A distribution that is still within its vendor's support lifecycle should be considered a supported and secure target, even if it ships an older glibc.

  20. oech3 commented on May 30, 2026

    @oech3
    Contributor

    Outdated distributions have a bunch of downstream patches. It is impossible to support all of them. Supporting legacy Ubuntu because Ubuntu is the most famous is unfair (but I have no fair solution yet).

  21. xtqqczze commented on May 30, 2026

    @xtqqczze
    CollaboratorAuthor

    I think targeting the previous Ubuntu LTS release is a reasonable compromise for now. Supporting much older systems all the way back to glibc 2.17 (e.g. RHEL 7) would likely require significantly more effort.

    Longer term, the more robust solution would be to use cross to build the Linux binaries against an older Linux distribution running in Docker, which allows compatibility with a much wider range of systems.

  22. oech3 commented on May 30, 2026

    @oech3
    Contributor

    We should just wait actual consumer's complaint and see response for suggestion to use musl binary. No need to add something without actual usecase.

  23. xtqqczze commented on May 30, 2026

    @xtqqczze
    CollaboratorAuthor

    I think making sure that binaries built against an older glibc pass tests is reasonable and consistent with the project design goals. I believe #12292 is a reasonable compromise.

  24. oech3 commented on May 30, 2026

    @oech3
    Contributor
  25. xtqqczze commented on May 30, 2026

    @xtqqczze
    CollaboratorAuthor

    Ah, I see the misunderstanding now. I assumed it was generally understood that, thanks to glibc's backward compatibility guarantees, binaries built against an older version of glibc will run on systems with newer versions. So my understanding is that targeting an older glibc broadens compatibility rather than dropping support for newer systems.

    You can read more about backward compatibility here: https://developers.redhat.com/blog/2019/08/01/how-the-gnu-c-library-handles-backward-compatibility

  26. oech3 commented on May 30, 2026

    @oech3
    Contributor
  27. oech3 commented on May 30, 2026

    @oech3
    Contributor

    And since musl is compatible with everything, it should not hurt to restrict glibc to latest.

  28. xtqqczze commented on May 30, 2026

    @xtqqczze
    CollaboratorAuthor

    ~stty was broken when glibc changed baudrate constants.

    I'm not sure, but it seems like that issue was incorrect error handling in the nix crate, not a glibc backwards compatibility issue.

    My point is that glibc provides strong backwards compatibility guarantees, but cannot do anything for forwards compatibility. So while linking against an older glibc is always safe with respect to newer systems, linking Rust binaries against newer versions of glibc can break on newer systems and cause Undefined Behavior.

  29. oech3 commented on May 31, 2026

    @oech3
    Contributor
  30. oech3 commented on May 31, 2026

    @oech3
    Contributor

    Related: The test case gnu-stty 51; uu-stty panic (or simply stty 51 in the future) has strong dependency for GNU linked against newer glibc because it is available only with newer glibc. So if we pinned glibc, it actually blocks one of a compatibility too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions