I'm trying to build GRPC inside another Bazel project, per the instructions at
https://github.com/grpc/grpc/tree/master/src/cpp#bazel
I created an empty directory and then added a file called WORKSPACE in it with the following contents:
Then I ran the command:
bazel build @grpc//:grpc
This gave an error:
WARNING: /home/lyft/.cache/bazel/_bazel_lyft/6c07f772a73c5c85819de1ca1f730e38/external/grpc/WORKSPACE:1: Workspace name in /home/lyft/.cache/bazel/_bazel_lyft/6c07f772a73c5c85819de1ca1f730e38/external/grpc/WORKSPACE (@com_github_grpc_grpc) does not match the name given in the repository's definition (@grpc); this will cause a build error in future versions
ERROR: /home/lyft/.cache/bazel/_bazel_lyft/6c07f772a73c5c85819de1ca1f730e38/external/grpc/BUILD:1752:1: no such target '//external:nanopb': target 'nanopb' not declared in package 'external' defined by /home/lyft/foo/WORKSPACE and referenced by '@grpc//:alts_proto'
ERROR: /home/lyft/.cache/bazel/_bazel_lyft/6c07f772a73c5c85819de1ca1f730e38/external/grpc/BUILD:1770:1: no such target '//external:nanopb': target 'nanopb' not declared in package 'external' defined by /home/lyft/foo/WORKSPACE and referenced by '@grpc//:alts_util'
ERROR: Analysis of target '@grpc//:grpc' failed; build aborted: Loading failed
INFO: Elapsed time: 0.175s
FAILED: Build did NOT complete successfully (0 packages loaded)
I'm guessing I need to flesh out my WORKSPACE file in some way in order to get GRPC to build, but I'm not sure what is missing. How can I make GRPC build?
Thanks,
Kerrick