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

Large Proto File Failing Java Compilation with Variable Assignment Error #18228

Open
ftkurt opened this issue Sep 11, 2024 · 1 comment
Open

Comments

@ftkurt
Copy link

ftkurt commented Sep 11, 2024

What version of protobuf and what language are you using?
Version: v3.14.0
Language: Java (issue occurs only when building for Java; Golang build works fine)

What operating system (Linux, Windows, ...) and version?
Operating System: Linux

What runtime / compiler are you using (e.g., python version or gcc version)
Compiler: Apache Maven, Maven Compiler Plugin 3.11.0

Build Environment:

  • The build is executed within a Docker container.
  • The build and compilation process is run on GitHub Actions CI/CD pipeline.
  • Docker image is based on a Linux environment, using the official Maven Docker image for consistency across builds.

What did you do?
Steps to reproduce the behavior:

  1. Attempted to build a large .proto file using the Java compiler.
  2. The .proto file includes 527 messages, 36 enums, 136 RPCs, and 1 service, totaling 700 entities.
  3. The error occurs at the final object of the file, which is not modified.

What did you expect to see
We expected the .proto file to compile successfully without errors as it does for Golang.

What did you see instead?
Received the following compilation errors when building for Java:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0
(default-compile) on project foo-bar-proxy: Compilation failure: [ERROR] /app/target/generated-sources/protobuf/java/com/example/api/Foo.java:[526219,5] cannot assign a value to final variable internal_static_ff_Foo_descriptor [ERROR] /app/target/generated-sources/protobuf/java/com/example/api/Foo.java:[526221,5] cannot assign a value to final variable internal_static_ff_Foo_fieldAccessorTable

Anything else we should know about your project / environment

  • The issue is specific to Java builds; the same .proto file compiles without issue for Golang.

  • The .proto file details are as follows:

    File Name Number of Lines File Size (Bytes) Number of Messages Number of Enums Number of RPCs Number of Services Total Entities
    foo.proto 3993 124560 527 36 136 1 700

Our main question is whether there is a known limit or issue with large .proto files in Java, and if so, what the recommended approach is to address this problem. Any guidance or recommendations would be greatly appreciated.

@ftkurt ftkurt added the untriaged auto added to all issues by default when created. label Sep 11, 2024
@tonyliaoss
Copy link
Member

Hi Fatih,

Java version 3.14.0 is out of support: https://protobuf.dev/support/version-support/#java

Could you try upgrading to 3.25.x and see if you still encounter this issue?

@tonyliaoss tonyliaoss added java wontfix wait for user action and removed untriaged auto added to all issues by default when created. labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants