treewide: use toolchain resolution to access protoc

Change-Id: I7eb5cfe2619dba7b56c7952c2042313a6e8db6ac
Reviewed-on: https://review.monogon.dev/c/monogon/+/3610
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/build/proto_docs/proto_docs.bzl b/build/proto_docs/proto_docs.bzl
index ecbcdc0..4149300 100644
--- a/build/proto_docs/proto_docs.bzl
+++ b/build/proto_docs/proto_docs.bzl
@@ -29,11 +29,13 @@
             continue
         args.append(src.path)
 
+    protoc = ctx.toolchains["@rules_proto//proto:toolchain_type"].proto.proto_compiler.executable
+
     ctx.actions.run(
         tools = [ctx.executable._protoc_gen_doc],
         inputs = transitive_sources,
         outputs = [out],
-        executable = ctx.executable._protoc,
+        executable = protoc,
         arguments = args,
     )
     return [DefaultInfo(files = depset([out]))]
@@ -50,12 +52,6 @@
             providers = [ProtoInfo],
             default = [],
         ),
-        "_protoc": attr.label(
-            default = Label("@protobuf//:protoc"),
-            cfg = "exec",
-            executable = True,
-            allow_files = True,
-        ),
         "_protoc_gen_doc": attr.label(
             default = Label("@com_github_pseudomuto_protoc_gen_doc//cmd/protoc-gen-doc"),
             cfg = "exec",
@@ -63,4 +59,5 @@
             allow_files = True,
         ),
     },
+    toolchains = ["@rules_proto//proto:toolchain_type"]
 )