How to integrate grpc into a bazel workspace?

21 views
Skip to first unread message

ming...@gmail.com

unread,
Apr 22, 2019, 2:42:10 PM4/22/19
to grpc.io
Hi,

I would like to incorporate grpc into my existing bazel workspace so grpc can be automatically built as a dependency.

I realize that there have been so many changes introduced to grpc/protobuf/bazel since the last time I did that. I wonder what's the recommended way of doing that today. Should I just use local_repository and expect that should work?

Thanks,
Ming


Nicolas Noble

unread,
Apr 24, 2019, 2:12:14 PM4/24/19
to grpc.io
With bazel still not being stable (current version being 0.24), its API is subject to change rapidly and it's difficult for us to keep up to date. As a result, our current bazel files are really going to work fine with bazel 0.23.2 at the moment. Buyers beware.

This being said, integrating grpc as a bazel dependency is doable. It's not 100% easy, due to the way bazel doesn't handle transitive dependencies at the moment, but here's an example on how this is supposed to work:


Basically, you import our grpc_deps function, and invoke it in your workspace. This should register all of our dependencies into your workspace. 
Reply all
Reply to author
Forward
0 new messages