Skip to content

Conversation

@auscompgeek
Copy link
Member

@auscompgeek auscompgeek commented Nov 22, 2025

This pulls a hermetic LLVM toolchain into the Bazel workspace, for use in our Linux x86-64 builds. This removes our dependency on the host OS C++ toolchain, and hence makes building in a container largely redundant.

Since we no longer build in a container, this also frees up some disk space for our CI builds, however this is somewhat displaced by the size of the toolchain download.

Note that this doesn't register the toolchain with an isolated sysroot, so this now relies on the host image for its sysroot.

we should probs pull in x11 from bcr?
tbh probably imgui/glfw from bcr too
@auscompgeek auscompgeek requested a review from a team as a code owner November 22, 2025 01:48
@github-actions github-actions bot added component: apriltag AprilTag library 2027 2027 target labels Nov 22, 2025
Comment on lines +81 to +87
# TODO(davo): update version after the next release of toolchains_llvm after 1.5.0
http_archive(
name = "toolchains_llvm",
integrity = "sha256-Ht0UsdgsySFX+H7AU3TS992uZr8nV5TP60lADgKeP7s=",
strip_prefix = "toolchains_llvm-cebf1ed19db1521bcaae489a40dd736d50e9302f",
url = "https://github.com/bazel-contrib/toolchains_llvm/archive/cebf1ed19db1521bcaae489a40dd736d50e9302f.tar.gz",
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no toolchains_llvm release that supports the extra_*_flags parameters yet.

@auscompgeek auscompgeek added the build Monorepo organization, gradle/cmake, upstream_utils, etc label Nov 22, 2025
@auscompgeek auscompgeek changed the title [bazel] Build with LLVM 19.1.7 [bazel] Build with LLVM Nov 22, 2025
@AustinSchuh
Copy link
Contributor

libtinfo5 is a library you can install (or patch into the llvm install) on 22.04.

"darwin-aarch64": CONLY_FLAGS,
"darwin-x86_64": CONLY_FLAGS,
"linux-aarch64": CONLY_FLAGS,
"linux-x86_64": CONLY_FLAGS,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AustinSchuh was there a particular reason bazel-contrib/toolchains_llvm#435 doesn't allow specifying a global conly_flags default with the empty string key like the other params?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason other than it probably didn't exist when that code was originally written 6 years ago.

@AustinSchuh
Copy link
Contributor

Bazel bits look good. In general, I'm a big clang fan, but I can't judge if that is good for this project or not.

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

Labels

2027 2027 target build Monorepo organization, gradle/cmake, upstream_utils, etc component: apriltag AprilTag library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants