rules_proto icon indicating copy to clipboard operation
rules_proto copied to clipboard

Need ability to specify other versions of protoc

Open gibfahn opened this issue 5 years ago • 4 comments
trafficstars

Many tools require us to specify other versions of protoc than the default that comes with the ruleset, and it would be really nice to be able to specify that in the arguments to the rules_proto setup.

The biggest issue with this is specifying the sha256s, rules_go does this by having a checked-in list: sdk_list.bzl

Previously this was possibly by simply specifying your own com_google_protobuf http_archive before setting up rules_proto, but now you have to override all of the dependencies in dependencies.bzl.

gibfahn avatar Nov 18 '20 11:11 gibfahn

Update, rules_go moved to downloading this each time: https://github.com/bazelbuild/rules_go/pull/2729

gibfahn avatar Dec 15 '20 15:12 gibfahn

Hi.

In a similar way, is it possible to avoid using the binaries for my current system?

Reason is that the binaries do not work:

/run/user/1000/.cache/bazel/_bazel_claudio/d8784845802f85734743b59142c4faef/external/com_github_protocolbuffers_protobuf/BUILD:354:15: 
  Generating Descriptor Set proto_library @com_github_protocolbuffers_protobuf//:source_context_proto failed (Exit 1): 

  protoc.exe failed: error executing command bazel-out/host/bin/external/com_google_protobuf_protoc_linux_x86_64/protoc.exe '--proto_path=bazel-out/k8-fastbuild/bin/external/com_github_protocolbuffers_protobuf/_virtual_imports/source_context_proto' ... (remaining 6 argument(s) skipped)

How can I force the rules to skip the select? TIA!

avdv avatar Apr 06 '21 15:04 avdv

Toolchainisation of protoc should make this possible.

comius avatar Feb 08 '22 07:02 comius

Hi,

can someone help me understand the current options for using a specific version/repository of protoc with rules_proto? I see there is a bazel command line flag --proto_compiler ...does that work and if so, what else is this issue trying to solve? Thanks.

mellery451 avatar Oct 29 '22 00:10 mellery451