Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ register_toolchains("//tools/java_toolchain:repository_default_java_toolchain_de
bazel_dep(name = "apple_support", version = "1.23.1", repo_name = "build_bazel_apple_support")

# https://github.com/protocolbuffers/protobuf/tree/main?tab=readme-ov-file#bazel-with-bzlmod
bazel_dep(name = "protobuf", version = "32.0")
bazel_dep(name = "protobuf", version = "32.1")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This update to protobuf's bazel dependency from 32.0 to 32.1 is a minor change, but it highlights a larger potential issue with Protobuf versioning in this project.

There appears to be a significant version mismatch between the protoc compiler and the protobuf-java runtime library:

  • protoc compiler version: The bazel_dep for protobuf (which is a facade for rules_proto) and grpc-java both depend on protoc version 27.1 (via rules_proto@7.1.0).
  • protobuf-java runtime version: Your maven.install block pins protobuf-java and protobuf-java-util to version 4.32.0 (lines 101-102).

The rules_jvm_external dependency resolver will likely use version 4.32.0 for the Java runtime, as it's the highest version specified.

This setup is risky because Protobuf does not guarantee compatibility between generated code from an older protoc (27.1) and a much newer runtime library (4.32.0). This can lead to subtle runtime bugs or crashes. The recommended practice is to keep the protoc compiler and the runtime libraries at the same version.

Additionally, protobuf-java:4.32.0 does not appear to be a publicly released version, which might indicate a typo. The latest public version compatible with protoc 27.x is in the 4.27.x range (e.g., 4.27.2).

To resolve this, I recommend aligning the protobuf-java version in your maven.install block with the version expected by your other dependencies (4.27.1 or a compatible version like 4.27.2).


# https://registry.bazel.build/modules/rules_java
bazel_dep(name = "rules_java", version = "8.15.2")
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading