Hi Nicolas,
Thanks for reply!
I just git pull. Now I am at the same commit as you. But It still doesn't build, although this time it is a different error message. I am not sure if I am the only person who can get this error. Here is what I did:
$ cd GRPC_REPOSITORY
$ git show --oneline
c4f85b78f3 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #11474 from makdharma/cares_fix
// same commit as yours
$ ~/bazel version
Build label: 0.5.2- (@non-git)
// brew hasn't updated bazel and 0.5.1 has a bug. I built bazel from 0.5.2 distribution package
$ ~/bazel build examples/...
external/com_google_protobuf/BUILD.bazel:367:1: in cc_binary rule @com_google_protobuf//:protoc: cycle in dependency graph:
//examples:_auth_sample_codegen
//external:protocol_compiler (host)
.-> @com_google_protobuf//:protoc (host)
| @com_google_protobuf//:protoc_lib (host)
| @com_google_protobuf//:protobuf (host)
| @com_google_protobuf//:src/google/protobuf/util/internal/testdata/timestamp_duration.pb.h (host)
| @com_google_protobuf//:cc_test_protos_genproto (host)
`-- @com_google_protobuf//:protoc (host)
This cycle occurred because of a configuration option.
ERROR: Analysis of target '//examples:_auth_sample_codegen' failed; build aborted.
// I checked protobuf BUILD file and I don't know how is @com_google_protobuf//:protobuf depends on a target of timestamp_duration.pb.h.
I realized that more stuff is needed in WORKSPACE of my own example. Now I have went through all errors of "BUILD file not found", added missing external dependency and bind in my WORKSPACE, and fixed all of them. I no longer get any error about package or BUILD. But this time it seems bazel cannot output cc files successfully.
$ cd MY_OWN_EXAMPLE
$ ~/bazel build :helloworld
ERROR: /Users/yukang/git-projects/grpc-example/BUILD:31:1: output 'rotos/helloworld.pb.h' was not created.
ERROR: /Users/yukang/git-projects/grpc-example/BUILD:31:1: output 'rotos/
helloworld.pb.cc' was not created.
ERROR: /Users/yukang/git-projects/grpc-example/BUILD:31:1: not all outputs were created or valid.
ERROR: /Users/yukang/git-projects/grpc-example/BUILD:31:1: output 'rotos/helloworld.grpc.pb.h' was not created.
ERROR: /Users/yukang/git-projects/grpc-example/BUILD:31:1: output 'rotos/
helloworld.grpc.pb.cc' was not created.
Target //:helloworld failed to build
It shows output as 'rotos/.....', while the output should actually be 'protos/.....' (the first letter 'p' is missing). This looks like a bazel issue. I also tried to build with -s
$ ~/bazel clean
$ ~/bazel build :helloworld -s
Last output before the error is often this one:
>>>>> # //:_helloworld_codegen [action 'Generating rotos/helloworld.pb.h']
(cd /private/var/tmp/_bazel_yukang/daf269fd3c8ea3827a82b98ac2b45027/execroot/__main__ && \
exec env - \
bazel-out/host/bin/external/com_google_protobuf/protoc '--cpp_out=:bazel-out/darwin_x86_64-fastbuild/genfiles' '-Iprotos/helloworld.proto=protos/helloworld.proto' protos/helloworld.proto)
If I run the command as is, i.e. first cd into __main__, and then use exec env - bazel-out....., my terminal crashes immediately. I don't know where I can find any error log about the crash.
The interesting thing is if I modify this command by a little. I still cd into __main__, remove 'exec env - ' and run only 'bazel-out/..../protoc ....'. It works. and I can see the output cc files in my bazel-out. This looks like a bazel issue.