rules-proto-grpc / rules_proto_grpc

Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets
https://rules-proto-grpc.com
Apache License 2.0
254 stars 160 forks source link

protoc version #364

Open jjh42 opened 1 month ago

jjh42 commented 1 month ago

Description

Is there some way to easily select the version of protoc that is used.

The issue is that I need to use protoc that generates python version 4 files https://protobuf.dev/support/version-support/ since almost all python dependencies are still on that version.

But I can't figure out how to do this.

sschnug commented 4 days ago

I also currently look into the new bzlmod-based version of rules-proto-grpc and the protobuf cross-runtime guarantee topic.

Consider trying out the following:

Now is this respected in other toolchains? -> Yes!

Now the versions you can pick from must be pre-registered afaik (aka it fails for example with 25.5). It seems the source of truth here is https://github.com/aspect-build/toolchains_protoc/blob/main/protoc/private/versions.bzl