Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Linux release binaries may not run on systems with older glibc #347

Open
luqmana opened this issue Sep 7, 2023 · 4 comments
Open
Labels
known issue To include in customer documentation and training

Comments

@luqmana
Copy link
Contributor

luqmana commented Sep 7, 2023

Our x86_64-unknown-linux-gnu release currently get built in CI on a ubuntu-20.04 image. That's often newer than whatever glibc is used by some distros like CentOS or Rocky.

This is not a new issue for building releases in CI (and there's one solution mentioned in that blog post). I also noticed we use cargo-dist which might be able to just handle this soon?

@luqmana luqmana added the known issue To include in customer documentation and training label Sep 7, 2023
@luqmana luqmana added this to the MVP milestone Sep 7, 2023
@sunshowers
Copy link

sunshowers commented Sep 8, 2023

This can be solved by building against a docker container with Ubuntu 18.04 (I've run into the same issue with nextest). Happy to help tomorrow if required.

@sunshowers
Copy link

(Another option is to build with the musl target.)

@sunshowers
Copy link

sunshowers commented Sep 9, 2023

So having looked at the solutions here:

I think the best solution would be for cargo-dist to support musl and/or zigbuild. (If we use openssl then the musl solution becomes hairy, but if we manage to make it work we'll have a completely static binary which is great). However, both of these things will depend on cargo-dist support.

As a workaround for now, if we decide on a set of minimum distro versions supported, we can build on them. Going by https://repology.org/project/glibc/versions (love the link!):

  • Debian 10 is on glibc 2.28
  • CentOS/Rocky/Alma Linux (and presumably RedHat) 8 are on glibc 2.28
  • Ubuntu 18.04, which is in extended support, is on glibc 2.27

Based on this, I'd suggest we:

  • Create a docker container based on any one of the above distros (maybe Ubuntu 18.04 since it's slightly older)
  • As part of building the container, install whatever packages we need (see this script for a reference)
  • Build within that container.

@ahl
Copy link
Collaborator

ahl commented Nov 14, 2023

I'm going to check in with the axo folks to see if they're interested in adding this to cargo-dist soon.

@david-crespo david-crespo removed this from the MVP milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known issue To include in customer documentation and training
Projects
None yet
Development

No branches or pull requests

4 participants