sigstore / sigstore-java

java clients for sigstore
Apache License 2.0
36 stars 20 forks source link

chore: avoid generating protobuf(proto-google-common-protos) protobufs every time #734

Open vlsi opened 1 month ago

vlsi commented 1 month ago

protobuf(...) causes protoc to generate code for the listed proto files compileProtoPath adds the listed artifacts on the "include path", so we can reference third-party definitions and generate code for our proto files only.

Note: com.google.protobuf searches both compileProtoPath and implementation dependencies for .proto files. io.grpc:grpc-protobuf already depends on proto-google-common-protos, so the build would work even without explicit dependency. However, we import google/api protos, so it would be nice to explicitly mention the used dependencies even though they are present as transitive.

vlsi commented 1 month ago

I guess the reason for the failure is that proto-google-common-protos builds using an old protoc version. We use 4.26.1 for sigstore-java, and api-commons-protos seem to use 3.14.0: https://github.com/googleapis/api-common-protos/blob/3332dec527759859840a3a2ff108c67a54708130/Dockerfile#L7