Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate stub doesn't work #37

Closed
kevin-sakemaer opened this issue Oct 21, 2017 · 14 comments
Closed

generate stub doesn't work #37

kevin-sakemaer opened this issue Oct 21, 2017 · 14 comments

Comments

@kevin-sakemaer
Copy link

When i launch this command :
protoc --dart_out=grpc:lib/src/generated -Iprotos protos/metadata.proto
i got the following error :

protoc-gen-dart: program not found or is not executable
--dart_out: protoc-gen-dart: Plugin failed with status code 1.

i have installed everything (protoc and the protoc_plugin)

@jakobr-google
Copy link
Contributor

The error indicates that you don't have protoc-gen-dart on your PATH. If you've installed it using pub global activate protoc_plugin, you'll also need to add ~/.pub-cache/bin to PATH.

Alternatively, you can point protoc at the plugin by adding --plugin=protoc-gen-dart=<full path to>/protoc-gen-dart to the protoc command line.

@kevin-sakemaer
Copy link
Author

I can launch both from my terminal :/
Will try with the full path alternative

@jakobr-google
Copy link
Contributor

What happens when you launch protoc-gen-dart directly? If everything works, it should "hang" (waiting for stdio input from protoc).

@kevin-sakemaer
Copy link
Author

it's exactly what happend the program is waiting for input

@jakobr-google
Copy link
Contributor

Then you've got me stumped. What version of protoc do you have?

@kevin-sakemaer
Copy link
Author

libprotoc 3.4.0

@jakobr-google
Copy link
Contributor

protoc 3.4.0 works for me, so that should be fine. Are there any spaces or other "weirdness" in the path to protoc-gen-dart? What OS are you running on?

If you can't get it to work using pub global activate, another alternative is to clone dart-lang/dart-protoc-plugin and use --plugin=protoc-gen-dart=<path/to/dart-protoc-plugin>/bin/protoc-gen-dart.

@kevin-sakemaer
Copy link
Author

i have compile the source from the cpp release here https://github.com/google/protobuf/releases/tag/v3.4.0

@kevin-sakemaer
Copy link
Author

no weird spaces or other in my path /home/kleak/.pub-cache/bin for protoc-gen-dart
I'm running on linux

@jakobr-google
Copy link
Contributor

Pretty similar setup to mine. What does strace -f protoc --dart_out=... say? Does protoc look for protoc-gen-dart in the right place?

@kevin-sakemaer
Copy link
Author

kevin-sakemaer commented Nov 6, 2017

Ok i have found what is the problem
in my .profile i had and it doesn't work.

PATH="$PATH:~/.pub-cache/bin"

i have change to

PATH="$PATH:/home/kleak/.pub-cache/bin"

and it work now :)

@jakobr-google
Copy link
Contributor

Ah, yes. Looks like protoc doesn't do ~ expansion, so we need the full path in PATH.

I'll close this one, then. Thanks for confirming!

@kevin-sakemaer
Copy link
Author

kevin-sakemaer commented Nov 7, 2017 via email

@ericbets
Copy link

If you come across this, try replacing all mentions of ~ in your $path to /home/yourname. That fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants