buildbuddy-io / buildbuddy

BuildBuddy is an open source Bazel build event viewer, result store, remote cache, and remote build execution platform.

Home Page:https://buildbuddy.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support registering multiple toolchains

sluongng opened this issue · comments

Is your feature request related to a problem? Please describe.
With RBE running on multiple platforms: i.e. host platform being darwin arm64 while exec platform being linux amd64, we need multiple toolchains registered within the same WORKSPACE.

Describe the solution you'd like
Stop using rctx.os to register a single toolchain that is only compatible with the host platform.
Instead, let the user specify a range of platforms (CPU Arch-es and OSes) and use that to register multiple Zig toolchains, each with different exec_compatible.

This also means that we need to move the Zig Wrapper to the build phase instead of building it during the repository_ctx loading phase. The Zig wrapper will be lazily built on the correct exec platform (locally or remotely).

Describe alternatives you've considered
N/A. This is how rules_go does it and it's compatible with both local and remote execution

Additional context
N/A

Wrong repo 🥲