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

gRPC codegen fails for large file name like io.envoyproxy.controlplane:api on windows #38759

Closed
ls-bit opened this issue Feb 13, 2024 · 8 comments · Fixed by #39291
Closed

gRPC codegen fails for large file name like io.envoyproxy.controlplane:api on windows #38759

ls-bit opened this issue Feb 13, 2024 · 8 comments · Fixed by #39291
Labels
area/grpc gRPC env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@ls-bit
Copy link

ls-bit commented Feb 13, 2024

Describe the bug

I stumbled upon this problem while testing envoy control plane api.

gRPC codegen fails with an exception when adding quarkus.generate-code.grpc.scan-for-proto=io.envoyproxy.controlplane:api to scan envoy controlplane api for proto files.

Caused by: io.quarkus.bootstrap.prebuild.CodeGenException: Failed to generate java files from proto file in C:\test\code-with-quarkus\build\classes\java\quarkus-generated-sources\proto\.
        at io.quarkus.grpc.deployment.GrpcCodeGen.trigger(GrpcCodeGen.java:177)
        at io.quarkus.deployment.CodeGenerator.lambda$trigger$4(CodeGenerator.java:204)
        at io.quarkus.deployment.CodeGenerator.callWithClassloader(CodeGenerator.java:179)
        at io.quarkus.deployment.CodeGenerator.trigger(CodeGenerator.java:201)
        at io.quarkus.deployment.CodeGenerator.initAndRun(CodeGenerator.java:78)
        ... 28 more
Caused by: java.io.IOException: Cannot run program "C:\test\code-with-quarkus\build\com.google.protobuf-protoc-windows-x86_64-exe": CreateProcess error=206, The filename or extension is too long
        at io.quarkus.deployment.util.ProcessUtil.launchProcess(ProcessUtil.java:38)
        at io.quarkus.grpc.deployment.GrpcCodeGen.trigger(GrpcCodeGen.java:165)
        ... 32 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long

Probably only an issue on windows, as it builds fine on a WSL Ubuntu VM.

Note that the io.envoyproxy.controlplane:api artifact also contains generated code, so it is possible to use the code from the artifact.

Expected behavior

No exception occurs

Actual behavior

java.io.IOException: CreateProcess error=206, The filename or extension is too long occurs

How to Reproduce?

Reproducer: https://github.com/ls-bit/quarkus-grpc-codegen-issue

Output of uname -a or ver

Microsoft Windows [Version 10.0.22631.3007]

Output of java -version

openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment GraalVM CE 17.0.8+7.1 (build 17.0.8+7-jvmci-23.0-b15)
OpenJDK 64-Bit Server VM GraalVM CE 17.0.8+7.1 (build 17.0.8+7-jvmci-23.0-b15, mixed mode, sharing)

Quarkus version or git rev

Quarkus 3.7.2

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------
Gradle 8.5
------------------------------------------------------------

Build time:   2023-11-29 14:08:57 UTC
Revision:     28aca86a7180baa17117e0e5ba01d8ea9feca598

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.8 (GraalVM Community 17.0.8+7-jvmci-23.0-b15)
OS:           Windows 11 10.0 amd64

Additional information

No response

@ls-bit ls-bit added the kind/bug Something isn't working label Feb 13, 2024
@quarkus-bot quarkus-bot bot added area/grpc gRPC env/windows Impacts Windows machines labels Feb 13, 2024
Copy link

quarkus-bot bot commented Feb 13, 2024

/cc @alesj (grpc), @cescoffier (grpc)

@cescoffier
Copy link
Member

I'm not sure we can do anything. Can you try with WSL?

@ls-bit
Copy link
Author

ls-bit commented Feb 13, 2024

Yes, it works with WSL. Maybe it is possible to pass some kind of parameter file to protoc as mentioned in protocolbuffers/protobuf#274 ?

@cescoffier
Copy link
Member

Hum, it worse a try - I fear it's windows specific (meaning I cannot test).

@cescoffier cescoffier changed the title gRPC codegen fails for io.envoyproxy.controlplane:api gRPC codegen fails for large file name like io.envoyproxy.controlplane:api Feb 13, 2024
@cescoffier cescoffier changed the title gRPC codegen fails for large file name like io.envoyproxy.controlplane:api gRPC codegen fails for large file name like io.envoyproxy.controlplane:api on windows Feb 13, 2024
@ls-bit
Copy link
Author

ls-bit commented Feb 14, 2024

if it is of any help, i can offer to test on windows

@cescoffier
Copy link
Member

@ls-bit Sorry for the late reply - can you check #39291?

@ls-bit
Copy link
Author

ls-bit commented Mar 8, 2024

Awesome, I can confirm that the issue is fixed by your PR, thanks!

@cescoffier
Copy link
Member

Thanks for the feedback!

@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Mar 11, 2024
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

Successfully merging a pull request may close this issue.

2 participants