You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing an enum from another protobuf file in the same repo (local dependency) that enum can be used as a member field, but cannot be used as a repeated member field in java_proto_library and java_grpc_library. This issue is reproducible with both versions 5.0.0 and 5.0.1 of rules_proto_grpc_java.
I've pushed a small repo reproducing the issue. This line of code is the source. Changing the usage of the enum to a non-repeated field or commenting it out, the build works, but as a repeated field it fails.
Our project currently is on version 4.4.0 and we are able to build java_proto_library and java_grpc_library with that version when we import enums from dependency protobuf files and use them as repeated members, the targets build succesfully.
Log Output
bazel-out/darwin_x86_64-fastbuild/bin/protobuf/_javac/transactions_java/libtransactions_java_tmp/com/justtechnologies/proto/type/Transaction.java:127: error: cannot find symbol
private static final com.google.protobuf.Internal.IntListAdapter.IntConverter<
^
symbol: class IntListAdapter
location: class Internal
bazel-out/darwin_x86_64-fastbuild/bin/protobuf/_javac/transactions_java/libtransactions_java_tmp/com/justtechnologies/proto/type/Transaction.java:129: error: cannot find symbol
new com.google.protobuf.Internal.IntListAdapter.IntConverter<
^
symbol: class IntListAdapter
location: class Internal
bazel-out/darwin_x86_64-fastbuild/bin/protobuf/_javac/transactions_java/libtransactions_java_tmp/com/justtechnologies/proto/type/Transaction.java:142: error: cannot find symbol
return new com.google.protobuf.Internal.IntListAdapter<
^
symbol: class IntListAdapter
location: class Internal
bazel-out/darwin_x86_64-fastbuild/bin/protobuf/_javac/transactions_java/libtransactions_java_tmp/com/justtechnologies/proto/type/Transaction.java:847: error: cannot find symbol
return new com.google.protobuf.Internal.IntListAdapter<
^
symbol: class IntListAdapter
location: class Internal
In an effort to try to discern if this is an issue that should be filed on the protobuf repository, I used the protoc CLI directly and was able to generate both protobuf and grpc outputs with protoc. Invoking protoc at the command line resulted in succesful generation of Java protobuf and gRPC code.
I used protoc version 29.2, which is the same version I have installed via Bazel in the reproduction repo.
Edit: i've tested with protoc version 27.1 at the command line and java outputs are generated correctly so I'm not sure what the issue could be when building through rules_proto_grpc
Issue Description
When importing an
enum
from another protobuf file in the same repo (local dependency) that enum can be used as a member field, but cannot be used as arepeated
member field injava_proto_library
andjava_grpc_library
. This issue is reproducible with both versions 5.0.0 and 5.0.1 ofrules_proto_grpc_java
.I've pushed a small repo reproducing the issue. This line of code is the source. Changing the usage of the
enum
to a non-repeated field or commenting it out, the build works, but as a repeated field it fails.Our project currently is on version 4.4.0 and we are able to build
java_proto_library
andjava_grpc_library
with that version when we import enums from dependency protobuf files and use them asrepeated
members, the targets build succesfully.Log Output
rules_proto_grpc Version
5.0.0
Bazel Version
7.4.1
OS
MacOS Sonoma 14.6.1 (23G93)
Link to Demo Repo
https://github.com/justtechnologies/java-grpc-enum
MODULE.bazel or WORKSPACE Content
BUILD Content
Proto Content
The text was updated successfully, but these errors were encountered: