bazel-contrib / bazel-contrib/toolchains_llvm
Use musl as target_libc on linux
- Dominant language
- Starlark
- Stars
- 371
- Forks
- 283
- Avg merge
- 1d 55m
- Merged PRs (30d)
- 25
Description
Currently, glic_unknown is used for libc when running on linux as can be seen here: https://github.com/grailbio/bazel-toolchain/blob/3cf6c59742b58980093e2062e9ec056c3bd492e5/toolchain/cc_toolchain_config.bzl#L76
This is unfortunate, because it makes the toolchain non-hermetic in that any binary which depends on being compiled with libc is now dependent upon the system installed version of libc rather than one being provided by the toolchain on linux.
Musl is specifically designed to compat this issue and I'd love to have this toolchain make use of it and become even more hermetic.
Contributor guide
Research direction
Start in toolchain/cc_toolchain_config.bzl at the referenced target_libc configuration around line 76, and trace how the Linux toolchain selects libc. Confirm the change makes the Linux toolchain use musl rather than the system libc, then run the repository's available toolchain tests or Linux build checks to verify the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100