Comments (31)
@smr277 It's probably still premature for native proto_library
. However, I've done fair amount of work on https://github.com/pubref/rules_protobuf since last comment. Supports C++ protobufs with gRPC and SSL out of the box.
from bazel.
Next bazel release. There should be an issue open for it.
from bazel.
@robfig I just released https://github.com/pubref/rules_protobuf/tree/0.1.1 for my own use but hopefully it's useful for you.
from bazel.
Some form of status update is in
bazelbuild/rules_go#121 (comment)
from bazel.
For posterity, https://bazel.build/blog/2017/02/27/protocol-buffers.html is the permalink to the blog post.
from bazel.
We're not yet ready to open-source the more generic proto_library
rule. In the meantime you can use genproto
, see https://github.com/google/bazel/blob/master/src/main/protobuf/BUILD, or write a genrule
.
I'll remove the reference from the BE for now.
from bazel.
(sorry, shouldn't have closed this just yet)
from bazel.
Is there a timeline for releasing proto_library support? We'd love to ditch Kythe's campfire build system, but can't feasibly do so without proto_library.
from bazel.
For now we have a genproto that supports Java using Skylark (see
tools/build_rules/genproto.bzl and its usage in the link Laszlo sent. You
can easily adapt it for other languages.
On Fri, Apr 3, 2015 at 1:57 AM Collin Winter [email protected]
wrote:
Is there a timeline for releasing proto_library support? We'd love to
ditch Kythe's campfire build system, but can't feasibly do so without
proto_library.—
Reply to this email directly or view it on GitHub
#52 (comment).
from bazel.
The Kythe team has found that the genproto rule isn't as easy to use as you've suggested. It seems to have at least one severe issue that we'd need fixed before we migrate to using Bazel.
Bazel special-cases the genproto Skylark rule for Java (see BazelJavaRuleClasses.java). It does not, however, support the native C++ rules in the same way. We have thought of a few ways to workaround this problem but feel that they would burden us in the same way as having our own build system. Switching to Bazel (from Campfire) is meant to remove these types of concerns from our team.
Likewise, having to write our own support for C++ (and Go) means maintaining even more build-related logic. It would be nice if C++ was supported in genproto by the Bazel team. That would minimize our need for forking/maintaining the existing rule.
Other Relevant C++ issues:
from bazel.
You should be able to write a genproto rule that generate .c or .cc files
and put that into cc_library.srcs. If you want to make it look like what we
have internally, you can wrap that in a Skylark macro.
We're working on proto_library as well as go support this quarter. It's
unlikely that we'll explicitly support something else before that is ready.
If we were in a hurry, go support could be ready in ~weeks, but proper
proto_library support is tricky.
On Mon, Apr 13, 2015 at 7:06 PM, Cody Schroeder [email protected]
wrote:
The Kythe team has found that the genproto rule isn't as easy to use as
you've suggested. It seems to have at least one severe issue that we'd need
fixed before we migrate to using Bazel.Bazel special-cases the genproto Skylark rule for Java (see
BazelJavaRuleClasses.java
https://github.com/google/bazel/blob/master/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaRuleClasses.java#L118).
It does not, however, support the native C++ rules in the same way. We have
thought of a few ways to workaround this problem but feel that they would
burden us in the same way as having our own build system. Switching to
Bazel (from Campfire) is meant to remove these types of concerns from our
team.Likewise, having to write our own support for C++ (and Go) means
maintaining even more build-related logic. It would be nice if C++ was
supported in genproto by the Bazel team. That would minimize our need for
forking/maintaining the existing rule.Other Relevant C++ issues:
—
Reply to this email directly or view it on GitHub
#52 (comment).
from bazel.
I have a simple macro that creates genrule and cc_library targets for proto files, just FYI:
https://github.com/mzhaom/trunk/blob/master/third_party/grpc/grpc_proto.bzl
from bazel.
A quick status update: this is something we working on shiping but it will take a long time
from bazel.
Any ETA on this? We're using protos in Shipshape and would love to use standard rules.
from bazel.
Not yet. We are thinking of shipping it by the end of the year but it is
not yet decided. You are pinging at the good moment :)
On Tue, Oct 6, 2015, 1:53 AM clconway [email protected] wrote:
Any ETA on this? We're using protos in Shipshape
https://github.com/google/shipshape/blob/master/shipshape/proto and
would love to use standard rules.—
Reply to this email directly or view it on GitHub
#52 (comment).
from bazel.
It should happens this quarter
from bazel.
Will this support Go when it ships?
from bazel.
Yes. It will support both Skylark and native rules.
from bazel.
Hi! Is there any status update? Thanks
from bazel.
I think we are moving to making the rules provided by google/protobuf good one instead of shipping our legacy support. No ETA.
from bazel.
Any status update on this?
from bazel.
What is the current guidance for generating Java from proto files?
from bazel.
@pcj I love your graphical explanation of that repo :D
from bazel.
It seems that proto_library now exists here: http://bazel.io/docs/be/protocol-buffer.html
However, it a) needs the protobuf library to be in third_party/protobuf, and I can't seem to get it working with cc_library. Has anyone used the builtin proto_library with c++?
from bazel.
@smr277, proto_library doesn't generate for each language at this point. There will need to be per-language support for protobuf, and that is still in the works.
from bazel.
@cgrushko you mentioned in an issue for grpc-java that there's a first class support for java_proto_library
but I don't see docs for it. Is it just undocumented yet?
from bazel.
Oh, they're under java, and I was looking under protocol buffer.
My bad. Please ignore me! Sorry for the noise.
from bazel.
(didn't know it got undocumented; I thought that only happens at the next release)
I put together a demo repo in https://github.com/cgrushko/proto_library,
and I'm working on a blog post (or at least a Gist).
from bazel.
@cgrushko nice, thanks!
from bazel.
Blog post: https://bazel.build/blog/index.html#protocol-buffers-in-bazel
I'll close this issue because it seems to have grown to include too many things; if your issue hasn't been addressed, please open a new issue and CC me.
from bazel.
I failed to compile Bazel from head by Bazel. When will this feature be distributed?
from bazel.
Related Issues (20)
- Add support for compile-time input files in java_binary and java_library HOT 1
- ActionExecutionFunction are re-computed for an incremental build HOT 2
- [7.1.1] Fix two `bazel mod tidy` crashes HOT 2
- [7.1.1] Fix race condition and add more logging for null entry error message HOT 1
- [7.1.1] `bazel mod show_repo <canonical repo name>` doesn't work for module extension generated repos. HOT 1
- Bazel 7.1.0 changes output of `--consistent_labels` for overrides HOT 2
- Increased memory usage with Bazel 7 on macOS HOT 2
- [Mirror] github.com/google/go-containerregistry/releases/download/v0.18.0/go-containerregistry_Darwin_arm64.tar.gz HOT 1
- CI tests FAIL: //src/test/java/com/google/devtools/build/lib/authandtls/credentialhelper:credentialhelper HOT 1
- [7.1.1] Disable //src/test/shell/bazel:srcs_test on Intel macOS HOT 1
- java_binary: superfluous dependency on MANIFEST from runfiles HOT 11
- The following libraries were linked statically by different cc_shared_libraries but not exported HOT 10
- [7.1.1] java_binary: superfluous dependency on MANIFEST from runfiles
- Release notes include a Bazel bot account HOT 1
- Hang in 'checking cached actions' HOT 3
- 7.1.0: Fetch runs analysis on targets that do not require external dependencies HOT 4
- [7.2.0] Declare support for `gcc_quoting_for_param_files` feature in Unix cc_toolchain HOT 2
- [7.2.0] Add support for feature generate_linkmap to cc_binary HOT 2
- [7.2.0] The following libraries were linked statically by different cc_shared_libraries but not exported
- Absolute path inclusions found in rule HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel.