Build grpc with bazel

63 views
Skip to first unread message

Jim King

unread,
Apr 10, 2018, 4:44:17 PM4/10/18
to grpc.io
I am having trouble building grpc with bazel. I get the following errors:

ERROR: /usr/local/google/home/jsking/.cache/bazel/_bazel_jsking/5829c07283a19b7748a372d152deaad4/external/com_github_cares_cares/BUILD.bazel:59:1: undeclared inclusion(s
) in rule '@com_github_cares_cares//:ares':
this rule is missing dependency declarations for the following files included by 'external/com_github_cares_cares/ares__get_hostent.c':
 '/usr/lib/clang/4.0.1/include/stddef.h'
 '/usr/lib/clang/4.0.1/include/stdarg.h'
 '/usr/lib/clang/4.0.1/include/stdbool.h'
 '/usr/lib/clang/4.0.1/include/stdint.h'
Target //:grpc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.370s, Critical Path: 0.16s
FAILED: Build did NOT complete successfully

I read that this is caused by bazel not having those paths in its default include paths and that they need to be added to the toolchain.  However, adding a toolchain file looked horribly complicated.  Is there a simple way to just add some include paths to the default set?
I am building this directly from the clone of the repo with no modifications.

Vijay Pai

unread,
Apr 11, 2018, 1:02:18 PM4/11/18
to grpc.io
This seems like an issue in bazel build configuration and not gRPC specifically, as those are all system header files that it's complaining about. Although I don't know anything about your platform, I recall having a similar issue when I first installed on a new Mac and had not yet agreed to the Xcode license. So in addition to doing the proper licensing, I had to do a bazel clean --expunge to get everything in order. You may want to bing for other answers, but I'm pretty sure that this is just a bazel configuration thing.

Paul Johnston

unread,
Apr 17, 2018, 9:05:13 PM4/17/18
to grpc.io
How did you invoke bazel? (i.e. what target did you invoke, and in what repo?)
Reply all
Reply to author
Forward
0 new messages