How to locally build protovalidate protos?
In this commit: https://github.com/bufbuild/protovalidate-java/commit/265d6891cc1702e5c452c96146b846da5320f145 how did we build these files?
I am trying to downgrade proto to 3.19.1, but these files are generated with a newer protoc compiler, so they're giving errors.
How can I re-generate these files with an older protoc compiler?
Adding some more details: First issue I encountered was cel was using newer proto runtime. I moved it to 3.19.1 with the following changes in CEL:
repo: cel-java: checkout v0.4.4 gradle/libs.version.toml: protobuf = "3.25.1" => protobuf = "3.19.1" All unit tests pass.
Now, publish to mavenLocal
repo: protovalidate-java checkout v0.2.1
buf.gen.yaml:
- plugin: buf.build/protocolbuffers/java:v25.3 => - plugin: buf.build/protocolbuffers/java:v21.7
buf.gen.imports.yaml:
- plugin: buf.build/protocolbuffers/java:v25.3 => - plugin: buf.build/protocolbuffers/java:v21.7
buf.gen.noimports.yaml:
- plugin: buf.build/protocolbuffers/java:v25.3 => - plugin: buf.build/protocolbuffers/java:v21.7
gradle/libs.versions.toml: cel = "0.4.4" => cel = "0.4.4-LOCAL" protobuf = "3.25.3" => protobuf = "3.21.7" <Since buf.build/protocolbuffers/java:v19.1 doesn't exist, I'm trying to move to protobuf 3.21.7>
run ./gradlew generate => files are generated successfully
run ./gradlew test => fails
/home/user/repos/protovalidate-java/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedMinAndMaxItemLen.java:46: error: emptyList() is not public in LazyStringArrayList; cannot be accessed from outside package
com.google.protobuf.LazyStringArrayList.emptyList();
^
/home/user/repos/protovalidate-java/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedMinAndMaxItemLen.java:278: error: emptyList() is not public in LazyStringArrayList; cannot be accessed from outside package
com.google.protobuf.LazyStringArrayList.emptyList();
^
/home/user/repos/protovalidate-java/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedMinAndMaxItemLen.java:422: error: emptyList() is not public in LazyStringArrayList; cannot be accessed from outside package
com.google.protobuf.LazyStringArrayList.emptyList();
^
/home/user/repos/protovalidate-java/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedMinAndMaxItemLen.java:511: error: emptyList() is not public in LazyStringArrayList; cannot be accessed from outside package
com.google.protobuf.LazyStringArrayList.emptyList();
Hey rishabh2a, you are using a very old version of protoc from 2021. Going to close this since this issue is a bit old and we have made a few updates to this project since then, but if you are having a problem feel free to file a new issue.