Support dual execution modes in rbe_config.bzl with automatic host mode (#2747)
This change introduces automatic support for --exec_mode=host in
rbe_config.bzl when generating RBE toolchain configurations:
- By default (when RBE_CONFIG_CONTAINER is unset), rbe_config continues
to use docker mode (--exec_mode=docker), compiling rbe_configs_gen via a
golang:1.21 container (DooD) and running detection inside Docker.
- When RBE_CONFIG_CONTAINER is exported in the environment (e.g. CI
workers), rbe_config automatically switches to host mode
(--exec_mode=host), compiling rbe_configs_gen natively on the host using
go build and running detection against the host filesystem without
Docker.
- Enforces Host Container Authority in host mode: the target container
image string in @rbe_ubuntu//config:platform is authoritatively
determined by RBE_CONFIG_CONTAINER to prevent toolchain and ABI
discrepancies.
- Updates rules/README.md to document execution modes and environment
variables.
2 files changed