Code Monkey home page Code Monkey logo

Comments (31)

pcj avatar pcj commented on May 9, 2024 3

@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.

cgrushko avatar cgrushko commented on May 9, 2024 2

Next bazel release. There should be an issue open for it.

from bazel.

pcj avatar pcj commented on May 9, 2024 1

@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.

cgrushko avatar cgrushko commented on May 9, 2024 1

Some form of status update is in
bazelbuild/rules_go#121 (comment)

from bazel.

ejona86 avatar ejona86 commented on May 9, 2024 1

For posterity, https://bazel.build/blog/2017/02/27/protocol-buffers.html is the permalink to the blog post.

from bazel.

laszlocsomor avatar laszlocsomor commented on May 9, 2024

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.

laszlocsomor avatar laszlocsomor commented on May 9, 2024

(sorry, shouldn't have closed this just yet)

from bazel.

collinw avatar collinw commented on May 9, 2024

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.

damienmg avatar damienmg commented on May 9, 2024

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.

schroederc avatar schroederc commented on May 9, 2024

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.

ulfbot avatar ulfbot commented on May 9, 2024

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.

mzhaom avatar mzhaom commented on May 9, 2024

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.

damienmg avatar damienmg commented on May 9, 2024

A quick status update: this is something we working on shiping but it will take a long time

from bazel.

clconway avatar clconway commented on May 9, 2024

Any ETA on this? We're using protos in Shipshape and would love to use standard rules.

from bazel.

damienmg avatar damienmg commented on May 9, 2024

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.

damienmg avatar damienmg commented on May 9, 2024

It should happens this quarter

from bazel.

perezd avatar perezd commented on May 9, 2024

Will this support Go when it ships?

from bazel.

damienmg avatar damienmg commented on May 9, 2024

Yes. It will support both Skylark and native rules.

from bazel.

arslan-urtashev avatar arslan-urtashev commented on May 9, 2024

Hi! Is there any status update? Thanks

from bazel.

damienmg avatar damienmg commented on May 9, 2024

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.

kqyang avatar kqyang commented on May 9, 2024

Any status update on this?

from bazel.

robfig avatar robfig commented on May 9, 2024

What is the current guidance for generating Java from proto files?

from bazel.

jcanizales avatar jcanizales commented on May 9, 2024

@pcj I love your graphical explanation of that repo :D

from bazel.

smr277 avatar smr277 commented on May 9, 2024

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.

ejona86 avatar ejona86 commented on May 9, 2024

@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.

lukaszx0 avatar lukaszx0 commented on May 9, 2024

@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.

lukaszx0 avatar lukaszx0 commented on May 9, 2024

Oh, they're under java, and I was looking under protocol buffer.

My bad. Please ignore me! Sorry for the noise.

from bazel.

cgrushko avatar cgrushko commented on May 9, 2024

(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.

lukaszx0 avatar lukaszx0 commented on May 9, 2024

@cgrushko nice, thanks!

from bazel.

cgrushko avatar cgrushko commented on May 9, 2024

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.

renning22 avatar renning22 commented on May 9, 2024

I failed to compile Bazel from head by Bazel. When will this feature be distributed?

from bazel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.