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

How to locally build protovalidate protos? #170

Open
rishabh2a opened this issue Aug 27, 2024 · 1 comment
Open

How to locally build protovalidate protos? #170

rishabh2a opened this issue Aug 27, 2024 · 1 comment

Comments

@rishabh2a
Copy link

In this commit: 265d689
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?

@rishabh2a
Copy link
Author

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant