So, first, you can't just grab a portion of the tree and expect it to work elsewhere. What's important is that it's able to find the WORKSPACE file properly. So your second test with the copy wouldn't work without a proper WORKSPACE file. Plus some of the examples are referring to files down the tree, such as, well, the grpc library itself.
Then, the error itself you're seeing seems is an old one that was fixed a while ago, so I'm not sure you're really at head here. :~/sources/grpc (master)$ git show --oneline c4f85b7 Merge pull request #11474 from makdharma/cares_fix :~/sources/grpc (master)$ bazel build examples/... INFO: Found 18 targets... INFO: Elapsed time: 102.154s, Critical Path: 9.91s :~/sources/grpc (master)$ ./bazel-bin/examples/greeter_server & [1] 11025 I0628 02:05:58.983490133 11025 server_builder.cc:254] Synchronous server. Num CQs: 4, Min pollers: 1, Max Pollers: 2, CQ timeout (msec): 10000 Server listening on 0.0.0.0:50051 :~/sources/grpc (master)$ ./bazel-bin/examples/greeter_client Greeter received: Hello world On Mon, Jun 26, 2017 at 10:15 AM, Yukang Yang <[email protected]> wrote: > Hi GRPC experts, > > I found the proto in GRPC example doesn't build with bazel. I used GRPC > from head. bazel is got from brew install bazel. > > Here is what I did: > > git clone https://github.com/grpc/grpc.git > cd grpc > git pull && git submodule init && git submodule update && git submodule > status > cd examples > bazel build :helloworld > > I got: > > ERROR: /Users/yukang/git-projects/grpc/WORKSPACE:16:1: no such package > '@com_google_protobuf//': In new_local_repository rule //external:com_go > ogle_protobuf the 'build_file' attribute does not specify an existing file > (/Users/yukang/git-projects/grpc/third_party/protobuf/BUILD does not > exist) and referenced by '//external:protobuf'. > ERROR: Analysis of target '//examples:helloworld' failed; build aborted. > > I have verified that > /Users/yukang/git-projects/grpc/third_party/protobuf/BUILD > exists. > > I also copied example out of GRPC repository and tried to set up an > external dependency on grpc repository. > > Here is what I did: > > https://bitbucket.org/xyyk/grpc-example/overview > > git clone [email protected]:xyyk/grpc-example.git > cd grpc-example > bazel build :helloworld > > I got: > > ERROR: error loading package '': Extension file not found. Unable to load > package for '@grpc//bazel:grpc_build_system.bzl': BUILD file not found on > package path. > > I also saw the post at http://www.grpc.io/blog/bazel_rules_protobuf. But > their example at https://github.com/pubref/grpc_greetertimer doesn't > build either. > > Does someone know what is wrong here? > > Thanks, > Yukang > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/grpc-io. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/grpc-io/b7f43ecb-0ebf-47d4-a0aa-20157f210881%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/b7f43ecb-0ebf-47d4-a0aa-20157f210881%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAEvr0PEOHVqX2DMKQCVGHJfDz7QywJzOPCuO64JBPoi70f%3DKxg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
