kleaf: Define and Register @kleaf_rust_toolchain
This commit implements the rust_toolchain_repository rule to generate
the toolchain repository dynamically, and registers the toolchains
in Bzlmod. This enables Bazel to build rust_binary and rust_bindgen
targets using local prebuilt Rust and Clang.
Additionally, this adds an integration test suite under
kleaf/tests/rust_test to verify the toolchain functionality.
TAG=agy
CONV=275cc5d9-a7b7-439a-a560-76b83cbd139d
Bug: 284390729
Bug: 489310593
Test: tools/bazel test //build/kernel/kleaf/tests/rust_test:rust_test
Test: tools/bazel build //common:kernel_aarch64
Test: tools/bazel build --rust //common:kernel_aarch64
Test: tools/bazel build --config=gbl //bootable/libbootloader:gbl_efi_dist
Assisted-by: Antigravity:Gemini-Next
Change-Id: I5fe35bc09c2b3fe56ebafc2f2b4526c60dfd86cd
(cherry picked from commit d1216aa855d5203bb0eb087af6c911894373d0fa)
(cherry picked from commit 6b2453923044e93617efaf84cfb26849379deee3)
12 files changed