Hi
I am trying to use bazel with grpc and protobuf on my macbook.
I keep running into the problem described below.
Note that when I pull the entire grpc repo - i am able to build the entire repo bazel as:
bazel build :all
Next when I try to add a proto in my application repo and follow the instructions to build it in my repo i am not having any luck.
I have read through the grpc, protobuf and bazel web sites as well as sites such as:
https://rules-proto-grpc.com/en/stable/
https://grpc.io/blog/bazel-rules-protobuf/
Here is a copy of the examples subdirectory from grpc in my own repo.If you pull this repo and try building you should see the problem I am encountering.
(i.e See log below).
Any help appreciated!
--rags
====================
git clone https://github.com/rags12345/bazel_pb_grpc_debug/blob/main/BUILD
chatgpt@MacBook-Pro hello_world_from_repo % git clone https://github.com/rags12345/bazel_pb_grpc_debug
Cloning into 'bazel_pb_grpc_debug'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (8/8), done.
Receiving objects: 100% (10/10), 4.97 KiB | 4.97 MiB/s, done.
Resolving deltas: 100% (2/2), done.
remote: Total 10 (delta 2), reused 10 (delta 2), pack-reused 0 (from 0)
chatgpt@MacBook-Pro hello_world_from_repo % ls
bazel_pb_grpc_debug
chatgpt@MacBook-Pro hello_world_from_repo % cd bazel_pb_grpc_debug
chatgpt@MacBook-Pro bazel_pb_grpc_debug % ls
BUILD hellostreamingworld.proto
MODULE.bazel helloworld.proto
README.md keyvaluestore.proto
auth_sample.proto route_guide.proto
chatgpt@MacBook-Pro bazel_pb_grpc_debug % bazel build //:dosd_cpp_grpc
Starting local Bazel server (8.2.1) and connecting to it...
ERROR: /Users/chatgpt/cplus_plus_play/projects/grpc_github_examples/hello_world_from_repo/bazel_pb_grpc_debug/BUILD:51:1: name 'cc_grpc_library' is not defined (did you mean 'cc_proto_library'?)
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:dosd_cpp_grpc': no such target '//:dosd_cpp_grpc': target 'dosd_cpp_grpc' not declared in package '' defined by /Users/chatgpt/cplus_plus_play/projects/grpc_github_examples/hello_world_from_repo/bazel_pb_grpc_debug/BUILD
ERROR: no such target '//:dosd_cpp_grpc': target 'dosd_cpp_grpc' not declared in package '' defined by /Users/chatgpt/cplus_plus_play/projects/grpc_github_examples/hello_world_from_repo/bazel_pb_grpc_debug/BUILD
INFO: Elapsed time: 13.532s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
--