Bazel and Glibc Versions
6 hours ago
- #build-systems
- #glibc
- #Bazel
- Bazel's caching and remote execution can lead to issues with differing glibc versions across environments.
- A scenario where a developer's build passes locally but fails in production due to a missing GLIBC version.
- The problem arises because Bazel's C/C++ action keys do not account for system-level dependencies like glibc versions.
- Three solutions are proposed: manually partitioning the action cache (AC), restricting AC writes to remote execution (RE) only, and using sysroots.
- Solution A involves capturing and comparing local and remote glibc versions to modify cache keys.
- Solution B suggests restricting AC writes to RE workers to control the build environment.
- Solution C, using sysroots, is the most robust but complex, involving multiple glibc versions and modifying the Bazel C/C++ toolchain.
- The article emphasizes the importance of addressing glibc version skew to prevent production failures.