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
256 stars 159 forks source link

protoc version #364

Closed jjh42 closed 2 weeks 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 3 weeks 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