Bump protobuf bazel_dep 33.4 -> 33.6 (refs #339)#355
Closed
tinder-maxwellelliott wants to merge 1 commit into
Closed
Bump protobuf bazel_dep 33.4 -> 33.6 (refs #339)#355tinder-maxwellelliott wants to merge 1 commit into
tinder-maxwellelliott wants to merge 1 commit into
Conversation
Pulls in the latest 33.x BCR-released protobuf module. The Java runtime used by the deploy jar's `java_proto_library` targets ([@protobuf]) tracks the module version directly, so this is the single source of truth for what ships inside bazel-diff.jar -- there is no separate Maven dep to update. Why not 34.x: protobuf 34.0 began passing `option_deps` and `extension_declarations` to `ProtoInfo(...)`, which Bazel 7.x's builtin `ProtoInfo` provider does not accept. CI test-jre11-run-example matrix runs against Bazel 7.x and fails analysis with `_create_proto_info() got unexpected keyword arguments: option_deps, extension_declarations`. Staying on the 33.x line preserves Bazel 7.x support; a follow-up PR that drops 7.x from CI can move to 34.x. Known limitation: protobuf 33.6's `UnsafeUtil` still calls `sun.misc.Unsafe.arrayBaseOffset` (verified by grepping the bytecode of the freshly-built `bazel-bin/cli/bazel-diff_deploy.jar`), so the JDK 24+ "terminally deprecated method" warning reported in #339 will continue to print until upstream protobuf migrates `MemoryAccessor` to `VarHandle`. That migration is tracked at protocolbuffers/protobuf#20760 and has not landed at any released tag (verified against protobuf `main` branch). Verified with `bazel test` on the 15 cli unit-test targets; all pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fb6b83c to
d11d7f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #339. Bumps the bzlmod
protobufdep from33.4to33.6, the latest stable release on the 33.x line. The Java runtime used by the deploy jar'sjava_proto_librarytargets ([@protobuf]) tracks the module version directly, so this is the single source of truth for what ships insidebazel-diff.jar— there is no separate Maven dep to update (we don't pullcom.google.protobuf:protobuf-javafrommaven_install.json).Why not 34.x
I first pushed this PR targeting protobuf
34.1(latest stable on BCR). CI'stest-jre11-run-examplematrix runs against Bazel 7.x and failed analysis with:protobuf 34.0 began passing
option_depsandextension_declarationstoProtoInfo(...), and Bazel 7.x's builtinProtoInfoprovider does not accept those. That's a hard incompatibility — 34.x requires Bazel 8+. Staying on the 33.x line preserves the existing Bazel 7.x CI matrix; a follow-up PR that drops 7.x from CI can move us to 34.x (and then to whatever lands the Unsafe migration).Honest disclosure: does this fix the Unsafe warning?
No, not on its own. I verified by grepping the bytes of the freshly-built
bazel-bin/cli/bazel-diff_deploy.jar:protobuf v33.6's
UnsafeUtil$MemoryAccessor.arrayBaseOffsetstill callssun.misc.Unsafe.arrayBaseOffset(Class)directly — the same call site producing the JDK 24+ "terminally deprecated method" warning in #339. I also checked the protobufmainbranch source: the call is still there, unchanged. v34.1 has it too.The migration off
sun.misc.Unsafe(likely toVarHandle) is tracked upstream at protocolbuffers/protobuf#20760. It has not landed at any released tag yet.Bumping to 33.6 keeps us on the latest 33.x release so we'll pick up smaller fixes in this line. We'll pick up the Unsafe migration in a subsequent bump once it ships upstream and we move off Bazel 7.x.
I'd recommend leaving #339 open until upstream lands the fix and we bump again, rather than closing on this PR.
Verification
bazel build //cli:bazel-diff_deploy.jar— succeeds with protobuf 33.6.bazel testover the 15 cli unit-test targets — all pass:BazelClientTest,BazelModServiceTest,BazelRuleTest,BuildGraphHasherTestCalculateImpactedTargetsInteractorTest,CalculateImpactedTargetsInteractorIssue335Test,ContentHashProviderTestDeserialiseHashesInteractorTest,ModuleGraphParserTestNormalisingPathConverterTest,OptionsConverterTestProcessStdinHangRegressionTest,SourceFileHasherTestStderrPollutionRegressionTest,TargetHashTestUnable to locate a Java Runtimeinside the nested bazel server, present on master without these changes). CI will run them.Test plan
bazel build //cli:bazel-diff_deploy.jarpasses.bazel test.🤖 Generated with Claude Code