grpc-kotlin: protoc-gen-grpckt: program not found or is not executable
After following the steps in the README.md file I am not able to generate the proto files from the command line
git clone git@github.com:grpc/grpc-kotlin.git
cd grpc-kotlin/
./gradlew build
vi test.proto // make some test proto file
mkdir testDir
protoc --plugin=protoc-gen-grpc-kotlin=build/artifacts/protoc-gen-grpc-kotlin --grpckt_out=testDir --proto_path=. test.proto
And the result from this is
protoc-gen-grpckt: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpckt_out: protoc-gen-grpckt: Plugin failed with status code 1.
protoc version - 3.11.4
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 27
Commits related to this issue
- better docs for compiler - related #98 — committed to grpc/grpc-kotlin by jamesward 4 years ago
@jamesward alternatively you can prepend the shebang on *nix systems:
0.1.5 is working as binary but the build jar for 0.2.0 is not working.
Download URL: https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-kotlin/0.2.0/protoc-gen-grpc-kotlin-0.2.0-jdk7.jar
Tried chmod +x on the jar file without success.
Here are some execution tests:
@eleduardo What version of the protoc gradle plugin are you using? You need to have at least 0.8.13. I’ll add that note to the new README.
Ah, so I have a better understanding now of what is going on. Thanks all for providing more details. So the way that the Gradle protoc plugin is able to have
protoc-gen-grpc-kotlin.jar
called as a command is that it sticks some stuff at the beginning of the file to make it work as an executable. (Note: I’m not sure how the Maven plugin makes things work but somehow it does.)For those who want to call
protoc-gen-grpc-kotlin.jar
without using Gradle or Maven build plugins then you’ll have to create a shell script that does thejava -jar
thing and tellprotoc
to call your shell script. I think that we should investigate releasing some artifacts that are executable but that is going to take a decent amount of work. (Note: I think a newer version of Java has an easier way to do this.)For now we do need to update the README with correct info.
I am having the same problem, even running every single step that is show in the README and trying to compile one of the
proto
files in the test directory@eleduardo Great! I’ve added that to the updated README. Thanks for helping us improve this.
@jamesward Just FYI, getting the same problem using the gradle proto plugin
Notice I commented out the 0.2.1 version, if I use 0.1.5 it works but 0.2.1 also gets the
but using 0.1.5 works
Any update on this the version “0.2.1” also has the same issue.
I followed the first set of instructions, installing from https://mvnrepository.com/artifact/io.grpc/protoc-gen-grpc-kotlin, and had similar issues to this issue.
The issue is that the docs, and the instructions here, includes the flag
—grpckt_out=testDir
.protoc
tries to find a plugin calledprotoc-gen-grpckt
, which it finds either through the plugins list, or a binary (in$PATH
). In this case,protoc
can’t find either and bombs out.To fix, either run:
protoc --plugin=protoc-gen-grpc-kotlin=build/artifacts/protoc-gen-grpc-kotlin --grpc-kotlin_out=testDir --proto_path=. test.proto
Or:
protoc --plugin=protoc-gen-grpckt=build/artifacts/protoc-gen-grpc-kotlin --grpckt_out=testDir --proto_path=. test.proto
Or, install the plugin from the above url using something like:
At which point the command becomes something like:
(Note the lack of the
—plugin
opt)OS: OSX Catalina Protoc: 3.12.1
Running from Gradle following those steps: https://github.com/grpc/grpc-kotlin/tree/master/compiler#compiling-and-testing-the-codegen. + …/gradlew prependShellStub
Also trying the pre-compiled binary following those steps: https://github.com/grpc/grpc-kotlin/tree/master/compiler#grpc-kotlin-codegen-plugin-for-protobuf-compiler
Am not a Kotlin/Java dev myself so I might be missing something.
We probably need to add to the README but you need to run:
../gradlew prependShellStub
Otherwise the artifacts are not runnable.