quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.34k stars 2.55k forks source link

Grpc code generation disregards include and exclude #41225

Open agreedSkiing opened 2 weeks ago

agreedSkiing commented 2 weeks ago

Describe the bug

Whilst generating a part of the external-authz project from the io.envoyproxy.controlplane:api dependency I noticed that it generated 3472 source files and that is with scan-for-proto-include and scan-for-proto-exclude set (see below)

quarkus.generate-code.grpc.scan-for-imports=all
quarkus.generate-code.grpc.scan-for-proto=io.envoyproxy.controlplane:api
quarkus.generate-code.grpc.scan-for-proto-include."io.envoyproxy.controlplane:api"=envoy/service/auth/v3/external_auth.proto
quarkus.generate-code.grpc.scan-for-proto-exclude."io.envoyproxy.controlplane:api"=**/*v2*/*.*

But if I extract the files from io.envoyproxy.controlplane:api for the external_auth.proto then it creates 156 source files

quarkus.generate-code.grpc.scan-for-imports=none
# quarkus.generate-code.grpc.scan-for-proto=io.envoyproxy.controlplane:api
# quarkus.generate-code.grpc.scan-for-proto-include."io.envoyproxy.controlplane:api"=envoy/service/auth/v3/external_auth.proto
# quarkus.generate-code.grpc.scan-for-proto-exclude."io.envoyproxy.controlplane:api"=**/*v2*/*.*

Expected behavior

Generating only needed files for the specified protos or failing since not all imports have been specified.

Actual behavior

Generates more files than expected

How to Reproduce?

external-authorization-grpc.zip

Output of uname -a or ver

Linux amd-burk 6.6.32-1-MANJARO #1 SMP PREEMPT_DYNAMIC Mon May 27 03:41:25 UTC 2024 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

Quarkus version or git rev

3.11.2 ### Build tool (ie. output of `mvnw --version` or `gradlew --version`) Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: /home/eriase/.m2/wrapper/dists/apache-maven-3.8.6-bin/67568434/apache-maven-3.8.6 Java version: 17.0.2, vendor: Oracle Corporation, runtime: /home/eriase/.asdf/installs/java/openjdk-17.0.2 Default locale: en_US, platform encoding: ANSI_X3.4-1968 OS name: "linux", version: "6.6.32-1-manjaro", arch: "amd64", family: "unix" ### Additional information _No response_
quarkus-bot[bot] commented 2 weeks ago

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

cescoffier commented 2 weeks ago

Yes, that's a change in protoc which makes computing the command line way more complicated. Any plain usage of protoc with the right command is more than welcome.