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

Bump to com.google.protobuf:protobuf-java:4.28.2 #1624

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Oct 17, 2024

Description

Bumps every Scala version up to use protobuf-java:4.28.2. Part of #1482.

Motivation

As part of my Bzlmod exploration in my rules_scala fork, I found that //test/scalafmt/... wouldn't build under Scala 2.13.14 due to using an outdated Scalafmt version (which I'll describe in a future PR). However, bumping to Scalafmt 3.8.3 produced:

$ bazel test //test/scalafmt/...

INFO: Analyzed 9 targets (80 packages loaded, 3307 targets configured).
ERROR: .../test/scalafmt/BUILD:43:20: ScalaFmt
  test/scalafmt/test/scalafmt/formatted/formatted-test.scala.fmt.output
  failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at .../bazel-workers/worker-134-ScalaFmt.log ---8<---8<---
Exception in thread "main" java.lang.NoSuchMethodError:
  'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'
  [ ...snip... ]

This issue seemed to suggest a protobuf-java version bump might fix it, and it did:

Fortunately, even though this is a major version bump from 3.10.0 to 4.28.2, there were no compatibility issues, per:

Protobuf major version releases may also be backwards-compatible with the last release of the previous major version. See the release notice for more details.

cc: @BillyAutrey @jayconrod @benjaminp @TheGrizzlyDev

Part of bazelbuild#1482.

Bumps every Scala version up to use protobuf-java:4.28.2, to
preemptively avoid the following error produced by upcoming Scalafmt
updates:

```txt
$ bazel test --repo_env=SCALA_VERSION=2.11.12 //test/scalafmt/...

INFO: Analyzed 9 targets (80 packages loaded, 3307 targets configured).
ERROR: .../test/scalafmt/BUILD:43:20: ScalaFmt
  test/scalafmt/test/scalafmt/formatted/formatted-test.scala.fmt.output
  failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at .../bazel-workers/worker-134-ScalaFmt.log ---8<---8<---
Exception in thread "main" java.lang.NoSuchMethodError:
  'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'
  [ ...snip... ]
```

This issue seemed to suggest a library bump may fix it, and it did:

- protocolbuffers/protobuf#9236

Fortunately, even though this is a major version bump from 3.10.0 to
4.28.2, there were no compatibility issues, per:

> Protobuf major version releases may also be backwards-compatible with
> the last release of the previous major version. See the release notice
> for more details.
>
> - https://github.com/protocolbuffers/protobuf/tree/main/java#compatibility-notice
@mbland mbland force-pushed the bzlmod-update-protobuf-java branch from 2ca3aeb to 0a23063 Compare October 21, 2024 14:57
@mbland
Copy link
Contributor Author

mbland commented Oct 21, 2024

Rebased and passing after #1627, including latest Bazel 7.3.2.

@simuons simuons merged commit 14a3286 into bazelbuild:master Oct 23, 2024
2 checks passed
@mbland mbland deleted the bzlmod-update-protobuf-java branch October 23, 2024 14:13
@mbland mbland mentioned this pull request Oct 23, 2024
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

Successfully merging this pull request may close these issues.

2 participants