build/toolchain/protobuf: fix duplicate protoc build
We were building way too many copies of protoc. Many of these are due to
a bug in rules_go when --incompatible_enable_proto_toolchain_resolution
is enabled, but not all, so we should do this anyway, and then the bug
in rules_go is no longer relevant.
Before:
bazel cquery "deps(//...) intersect @protobuf//:protoc"
@protobuf//:protoc (e5c4511)
@protobuf//:protoc (40d0309)
@protobuf//:protoc (3bbe29a)
@protobuf//:protoc (070fbf5)
@protobuf//:protoc (ee343a7)
@protobuf//:protoc (c3e4ff6)
After:
bazel cquery "deps(//... except //build/toolchain/protobuf/...) intersect @protobuf//:protoc"
@protobuf//:protoc (ee343a7)
Change-Id: I6a826b7bc01453284982204aea808f8f2902d84c
Reviewed-on: https://review.monogon.dev/c/monogon/+/4164
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/MODULE.bazel b/MODULE.bazel
index 4ba0610..a4f20d1 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -97,6 +97,8 @@
register_toolchains("@rust_toolchains//:all")
# Protobuf Toolchains
+register_toolchains("//build/toolchain/protobuf:protoc_sources_toolchain")
+
register_toolchains("@rules_rust_protobuf//:default_proto_toolchain")
register_toolchains("//build/toolchain/rust-efi:prost_efi_toolchain")