helloworld bazel build error on windows

280 views
Skip to first unread message

siddhesh

unread,
Jan 29, 2021, 5:07:19 PM1/29/21
to bazel-discuss
Hello group,

I am a new member of this group. Just joined today. Looking forward to learning more about using bazel to build grpc c++ applications. I am working on a windows machine. 

I started with the helloworld tutorial explained on the grpc.io website. I've attached my files to this conversation. My folder contains the basic greeter client and server files along with the helloworld.proto file. I am struggling with getting the correct WORKSPACE and BUILD files. My current files are also in the attachment. Any help / suggestions are highly appreciated.

Here's the error message on running "bazel build :greeter_server" in the vs code powershell terminal:

----------------------------------------------------------------------------------------------------------------------------------------

ERROR: D:/work/git/tutorials/grpc/grpc_getting_started/BUILD:35:16: Action helloworld.grpc.pb.h failed (Exit -1073741515): protoc.exe failed: error executing command
  cd C:/users/bj3pgh/_bazel_bj3pgh/4ot2dzx3/execroot/__main__
bazel-out/host/bin/external/com_google_protobuf/protoc.exe --plugin=protoc-gen-PLUGIN=bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/grpc_cpp_plugin.exe --PLUGIN_out=bazel-out/x64_windows-fastbuild/bin --proto_path=. --proto_path=bazel-out/x64_windows-fastbuild/bin helloworld.proto
Execution platform: @local_config_platform//:host
Target //:greeter_server failed to build
ERROR: D:/work/git/tutorials/grpc/grpc_getting_started/BUILD:53:10 Action helloworld.grpc.pb.h failed (Exit -1073741515): protoc.exe failed: error executing command
  cd C:/users/bj3pgh/_bazel_bj3pgh/4ot2dzx3/execroot/__main__
bazel-out/host/bin/external/com_google_protobuf/protoc.exe --plugin=protoc-gen-PLUGIN=bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/grpc_cpp_plugin.exe --PLUGIN_out=bazel-out/x64_windows-fastbuild/bin --proto_path=. --proto_path=bazel-out/x64_windows-fastbuild/bin helloworld.proto
Execution platform: @local_config_platform//:host
INFO: Elapsed time: 1.299s, Critical Path: 0.27s
INFO: 5 processes: 5 internal.
FAILED: Build did NOT complete successfully

--------------------------------------------------------------------------------------------------------------------------------------------

Thank you in advance.

siddhesh

unread,
Feb 1, 2021, 2:05:52 PM2/1/21
to bazel-discuss
Apologies. Forgot to provide the attachment. 
greeter_server.zip

Konstantin

unread,
Feb 6, 2021, 9:59:21 PM2/6/21
to bazel-discuss
Hi siddhesh,

The archive you attached misses the BUILD file and without it I cannot try it. 

In the past I noticed that gRPC default hello_world example is more complex than necessary and the following example is easier to follow: https://pencilflip.medium.com/getting-started-with-grpc-and-bazel-24725fd9e5c2

Konstantin

siddhesh

unread,
Feb 8, 2021, 10:25:15 AM2/8/21
to bazel-discuss
Hi Konstantin, sorry about that. And thank you for taking the time to look into the issue. I've attached a new zip folder with all the necessary files. Will also try out the instructions in the link you sent. 

Regards,
Siddhesh
greeter_client_server.zip

Konstantin

unread,
Feb 8, 2021, 1:38:37 PM2/8/21
to bazel-discuss
Siddhesh, I have updated your WORKSPACE file and now it compiles for me.
For some reason this group software does not allow me to attach the file, so I published it for you here: https://gist.github.com/konste/5ac691c8c5b094b4749a7b68b1066d91

Konstantin

Reply all
Reply to author
Forward
0 new messages