-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR]: Add example for cc_proto_library
#21
Comments
In theory, C++ doesn't have to be covered here because the official Protobuf documentation says that C++ developers ought to build it from source: If you author C++ code then it's reasonable to require every engineer on your team has a functioning local toolchain, or you've configured Bazel with a hermetic toolchain. In practice of course it's ALWAYS annoying to compile protoc and watch its gcc warnings scrolling by, and I'd love to have C++ here too! |
Tagging @thesayyn who might recall whether any work happened with |
Just to add a bit of context, it's entirely possible that you don't author any C++ code, but still need a C++ toolchain. In my case, the Python gRPC plugin is implemented in C++ and needs to generate C++ libraries for |
@ouillie I had exactly that discussion with a team today, who wishes the scope of this repo included gRPC as well to avoid building those programs from source. Sadly that scope increase isn't funded here. |
Ah. Well, I just forked gRPC and added a little script to upload pre-built plugin binaries for Linux / MacOS e.g. v1.67.1. It's a pretty small/easy script. I'll see if they're OK with taking it upstream. Would you have any appetite for me to submit a PR to |
Just thinking aloud, the Python gRPC plugin is also published as grpcio-tools, could this py_binary be used as a executable tool for the grpc plugin? Update: Yes, seems like it can be used, see https://github.com/chrisirhc/precompiled-grpc-in-bazel-python . However, you'll be coupling your grpc version with the protoc plugin version brought in by the grpcio-tools. Blog post: https://blog.sirh.cc/post/precompiled-grpc-compiler-bazel-python/ |
What is the current behavior?
I can't quite get
cc_proto_library
to work and there is no end-to-end example for C++.Describe the feature
I'd like to enable
--incompatible_enable_proto_toolchain_resolution
and use a precompiled protoc.I got this mostly working:
MODULE.bazel
:toolchain/BUILD
:BUILD
:foo.proto
:Output:
edit
I think the
runtime
attribute ofproto_lang_toolchain
should be something like@com_google_protobuf//:protoc_lib
.I’ll experiment some more.
The text was updated successfully, but these errors were encountered: