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

Make C.UTF-8 locale available on CentOS 7 #2059

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fmeum
Copy link
Contributor

@fmeum fmeum commented Oct 17, 2024

CentOS 7 is EoL and lacks a C.UTF-8 locale. Simulate it while CI hasn't been updated yet to unblock migrating Bazel to consistently use a UTF-8 locale.

CentOS 7 is EoL and lacks a C.UTF-8 locale. Simulate it while CI hasn't been updated yet to unblock migrating Bazel to consistently use a UTF-8 locale.
@fmeum
Copy link
Contributor Author

fmeum commented Oct 17, 2024

@meteorcloudy This is needed to unblock bazelbuild/bazel#24021.

@fmeum fmeum changed the title Make C.UTF-8 locale available on CentOS 7 Make C.UTF-8 locale available on CentOS 7 Oct 17, 2024
@meteorcloudy
Copy link
Member

This is a bit tricky. I tried to rebuild all docker images two days ago, and the centos7 image is already not buildable due to https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm being 404.

We should just switch to a successor of centos7, maybe rocky linux 8.

What matters is the glibc version for the release build, we want a low glibc version to make sure Bazel can work on older Linux distribution. Currently we have:

  • centos7 (EOL): ldd (GNU libc) 2.17
  • debain10 (EOL): ldd (Debian GLIBC 2.28-10+deb10u3) 2.28
  • ubuntu1804 (EOL): ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27
  • debian11: ldd (Debian GLIBC 2.31-13+deb11u11) 2.31
  • ubuntu2004: ldd (GNU libc) 2.31
  • rockylinux:8 (a popular successor to centos): ldd (GNU libc) 2.28

/cc @fweikert

@fmeum Can you just skip broken tests on centos7 for now? I'll find some time to properly migrate it to a new platform.

@fmeum
Copy link
Contributor Author

fmeum commented Oct 18, 2024

Will do!

If you want to avoid having to maintain an old distro in CI, but want to keep a low minimum glibc version, you could also use a hermetic toolchain that compiles against a sysroot (e.g. one from Chromium).

@meteorcloudy
Copy link
Member

Interesting! Can you give me some pointer to the hermetic toolchain?

@fmeum
Copy link
Contributor Author

fmeum commented Oct 18, 2024

It's mostly just this (the bug mentioned in the comment below has been fixed since): https://github.com/CodeIntelligenceTesting/jazzer/blob/aa376ca3c0255b9cf04e1fc79fcf1fe5c63b2376/MODULE.bazel#L397

The only caveat is that the official LLVM releases are extremely bloated and slow to extract even on fast machines. There are multiple options around this:

  1. Use toolchains_musl to link against musl instead. Super small toolchain and no need to maintain a sysroot, but musl may regress performance in the native code parts. If you have a way to rule this out with benchmarks, it would be the easiest to maintain in the long run.
  2. Use a much smaller LLVM distribution: https://github.com/dzbarsky/static-clang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants