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

quarkus-grpc-protoc-plugin windows script fails with java.exe in Program Files #11550

Closed
Shohou opened this issue Aug 24, 2020 · 2 comments
Closed
Labels
area/grpc gRPC env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@Shohou
Copy link

Shohou commented Aug 24, 2020

Describe the bug
protoc compilation fails with "'С:\Program' is not recognized as an internal or external command, operable program or batch file."

Expected behavior
protoc compilation successfully runs

Actual behavior
protoc compilation fails with "'С:\Program' is not recognized as an internal or external command, operable program or batch file."

To Reproduce
Steps to reproduce the behavior:

  1. Have java in C:\Program Files\Java
  2. Use quarkus gradle plugin with quarkus-grpc dependency to compile some protoc files
  3. It will fail with exception from https://github.com/quarkusio/quarkus/blob/1.7/extensions/grpc/codegen/src/main/java/io/quarkus/grpc/deployment/GrpcCodeGen.java line 86 saying "Failed to generate Java classes from proto files:" which doesn't explain anything.
  4. If you try to run generated command yourself you will get a real reason saying C:\Program is not a command.
  5. Further investigation will show that GrpcCodeGen.java generates a cmd sript on line 207 which contains a java command -
    C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\bin\java.EXE -cp "C:\Users\blablabla"
  6. Adding double quotes around java command fixes the issue

Environment (please complete the following information):

  • Quarkus version or git rev: 1.7.0.Final
  • Build tool (ie. output of mvnw --version or gradlew --version):

Gradle 6.6

Build time: 2020-08-10 22:06:19 UTC
Revision: d119144684a0c301aea027b79857815659e431b9

Kotlin: 1.3.72
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM: 11.0.7 (AdoptOpenJDK 11.0.7+10)
OS: Windows 10 10.0 amd64

Issue seems to be specific to quarkus 1.7.0.Final. At least changing version to 1.6.1.Final doesn't throw this exception, but it seems like it also doesn't try to compile proto files at all.

@Shohou Shohou added the kind/bug Something isn't working label Aug 24, 2020
@quarkusbot quarkusbot added area/grpc gRPC env/windows Impacts Windows machines labels Aug 24, 2020
@quarkusbot
Copy link

/cc @michalszynkiewicz, @cescoffier

@gsmet
Copy link
Member

gsmet commented Aug 24, 2020

@Shohou could you provide a PR with the fix? If I can get it by tomorrow evening Paris time, it will be part of 1.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc gRPC env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants