question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build protoc-gen-grpc-web on macOS

See original GitHub issue

I have been following the grpc-web helloworld example but am stuck when trying to build the protoc-gen-grpc-web plugin on my Mac. Here’s what happens:

nmurthy:grpc-web% sudo make install-plugin
cd "/Users/nmurthy/Workspace/grpc-web"/javascript/net/grpc/web && make install
g++ grpc_generator.o -L/usr/local/lib -lprotoc -lprotobuf -lpthread -ldl -o protoc-gen-grpc-web
ld: library not found for -lprotoc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [protoc-gen-grpc-web] Error 1
make: *** [install-plugin] Error 2

Wondering how do I properly link this library?

(Cross posted here: https://groups.google.com/forum/#!topic/grpc-io/kcIZb6N_Lhg)

Here’s my setup:

nmurthy:grpc-web% protoc --version
libprotoc 3.6.1
nmurthy:grpc-web% which protoc
/Users/nmurthy/Tools/protoc-3.6.1-osx-x86_64/bin/protoc
nmurthy:grpc-web% ls -l ~/Tools/protoc-3.6.1-osx-x86_64/include/google        
total 0
drwxr-xr-x  184 nmurthy  staff  6256 Nov  7 15:12 protobuf

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
stanley-cheungcommented, Nov 9, 2018

Oh I see, you have the protoc binary, but not the protoc library that we can link with -lprotoc.

This is not good user experience, but you will have to manually compile and install the protoc library for now.

In the helloworld example README, here’s the instructions on how to compile and install protoc:

$ ./scripts/init_submodules.sh
$ cd third_party/grpc/third_party/protobuf
$ ./autogen.sh && ./configure && make -j8
$ sudo make install

We will be providing pre-compiled binaries for the protoc-gen-grpc-web plugin across a few platforms shortly in the future.

1reaction
natemurthycommented, Nov 12, 2018

Posting here for reference because I liked this solution and maybe others will find this useful as well:

@juanjoDiaz created a Docker image that has all the protoc binaries baked in: https://github.com/grpc/grpc-web/issues/356#issuecomment-436735632

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to install protoc-gen-grpc-web - Stack Overflow
the issue was that i created a directory called "protoc-gen-grpc-web" rather than renaming the binary and placing it directly in bin.
Read more >
protoc-gen-grpc-web - Homebrew Formulae
Protoc plugin that generates code for gRPC-Web clients ... Formula JSON API: /api/formula/protoc-gen-grpc-web.json ... Build Errors (30 days).
Read more >
Protocol Buffer Compiler Installation - gRPC
You can install the protocol compiler, protoc , with a package manager under Linux or macOS using the following commands.
Read more >
protoc-gen-grpc-web: plugin failed with status code 1. - You.com
You'll need to make the protoc-gen-grpc-web plugin executable and move it to a directory that is discoverable from your PATH environment variable.
Read more >
Troubleshoot gRPC on .NET Core - Microsoft Learn
NET Core gRPC app on macOS; gRPC C# assets are not code generated from .proto files; WPF projects unable to generate gRPC C#...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found