bufbuild / rules_buf

Bazel rules for Buf.
Apache License 2.0
47 stars 17 forks source link

Don't hard-code @com_google_protobuf//:protoc #74

Open alexeagle opened 5 months ago

alexeagle commented 5 months ago

According to https://github.com/bazelbuild/rules_proto/discussions/213 users of Bazel 7 can now ask Bazel to resolve protoc from a toolchain.

There are two spots at HEAD:

 "_protoc": attr.label(
    default = "@com_google_protobuf//:protoc",
    executable = True,
    cfg = "exec",
),
momilo commented 2 months ago

This change would be highly appreciated. We have recently migrated to using Aspect Build's kindly-provided pre-compiled protoc toolchain (toolchains_protoc) (which seems to be the recommended approach since the new versions of rules_go, and deprecation of rules_proto) , which has sped-up all our processed significantly.

Relying on rules_buf would force us to re-introduce compilation of protoc from scratch, which is something we cannot really afford to do (any more).

It would be great if we could leverage the registered toolchain instead.