From 71971b1b7a94f9b3342e4a03ca16cd8cdcaf13e5 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 6 Mar 2025 11:17:27 -0500 Subject: [PATCH 1/2] Upgrade to `protobuf` v25.6 Updates the `protobuf` version to one that's still compatible with Bazel 6.5.0 and 7.5.0 without updating `scalapb`. Broken out from #1710, and part of #1482 and #1652. Like #1711, updates `.bazelversion` files to 7.5.0 and the CI builds in `.bazelci/presubmit.yml` to use Bazel 7.5.0. Unlike #1711, contains only these updates: - `abseil-cpp`: 20220623.1 => 20250127.0 - `protobuf`: v21.7 => v25.6 This change aims make #1710 smaller and more focused, and should ultimately make that pull request smaller and/or easier to review. Specifically, this is an attempt to see whether MSVC will build successfully with `protobuf` v25.6. If it doesn't, I will update this change to include the protocol compiler toolchainization changes from #1710. --- .bazelci/presubmit.yml | 12 ++++++------ .bazelversion | 2 +- dt_patches/compiler_sources/.bazelversion | 2 +- dt_patches/test_dt_patches/.bazelversion | 2 +- .../test_dt_patches_user_srcjar/.bazelversion | 2 +- examples/crossbuild/.bazelversion | 2 +- examples/scala3/.bazelversion | 2 +- examples/semanticdb/.bazelversion | 2 +- .../multi_frameworks_toolchain/.bazelversion | 2 +- .../testing/scalatest_repositories/.bazelversion | 2 +- .../specs2_junit_repositories/.bazelversion | 2 +- scala/deps.bzl | 15 +++++++-------- test/proto_cross_repo_boundary/repo/.bazelversion | 2 +- test_cross_build/.bazelversion | 2 +- .../test/example_external_workspace/.bazelversion | 2 +- third_party/test/new_local_repo/.bazelversion | 2 +- third_party/test/proto/.bazelversion | 2 +- 17 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 83c24e0e6..668847d20 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -53,16 +53,16 @@ tasks: - "set PATH=/usr/bin;%PATH%" #Make sure bash uses msys commands over windows commands. (i.e. find). - "bash -lc \"pacman --noconfirm --needed -S libxml2\"" #tests require xmllint - "bash test_rules_scala.sh" - test_coverage_linux_6_5_0: + test_coverage_linux_7_5_0: name: "./test_coverage" platform: ubuntu2004 - bazel: 6.5.0 + bazel: 7.5.0 shell_commands: - "./test_coverage.sh" - test_coverage_macos_6.5.0: + test_coverage_macos_7.5.0: name: "./test_coverage" platform: macos - bazel: 6.5.0 + bazel: 7.5.0 shell_commands: - "./test_coverage.sh" test_reproducibility_linux: @@ -93,13 +93,13 @@ tasks: examples_linux: name: "./test_examples" platform: ubuntu2004 - bazel: 6.5.0 + bazel: 7.5.0 shell_commands: - "./test_examples.sh" cross_build_linux: name: "./test_cross_build" platform: ubuntu2004 - bazel: 6.5.0 + bazel: 7.5.0 shell_commands: - "./test_cross_build.sh" lint_linux: diff --git a/.bazelversion b/.bazelversion index f22d756da..18bb4182d 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/dt_patches/compiler_sources/.bazelversion b/dt_patches/compiler_sources/.bazelversion index f22d756da..18bb4182d 100644 --- a/dt_patches/compiler_sources/.bazelversion +++ b/dt_patches/compiler_sources/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/dt_patches/test_dt_patches/.bazelversion b/dt_patches/test_dt_patches/.bazelversion index f22d756da..18bb4182d 100644 --- a/dt_patches/test_dt_patches/.bazelversion +++ b/dt_patches/test_dt_patches/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/dt_patches/test_dt_patches_user_srcjar/.bazelversion b/dt_patches/test_dt_patches_user_srcjar/.bazelversion index f22d756da..18bb4182d 100644 --- a/dt_patches/test_dt_patches_user_srcjar/.bazelversion +++ b/dt_patches/test_dt_patches_user_srcjar/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/examples/crossbuild/.bazelversion b/examples/crossbuild/.bazelversion index f22d756da..18bb4182d 100644 --- a/examples/crossbuild/.bazelversion +++ b/examples/crossbuild/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/examples/scala3/.bazelversion b/examples/scala3/.bazelversion index f22d756da..18bb4182d 100644 --- a/examples/scala3/.bazelversion +++ b/examples/scala3/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/examples/semanticdb/.bazelversion b/examples/semanticdb/.bazelversion index f22d756da..18bb4182d 100644 --- a/examples/semanticdb/.bazelversion +++ b/examples/semanticdb/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/examples/testing/multi_frameworks_toolchain/.bazelversion b/examples/testing/multi_frameworks_toolchain/.bazelversion index f22d756da..18bb4182d 100644 --- a/examples/testing/multi_frameworks_toolchain/.bazelversion +++ b/examples/testing/multi_frameworks_toolchain/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/examples/testing/scalatest_repositories/.bazelversion b/examples/testing/scalatest_repositories/.bazelversion index f22d756da..18bb4182d 100644 --- a/examples/testing/scalatest_repositories/.bazelversion +++ b/examples/testing/scalatest_repositories/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/examples/testing/specs2_junit_repositories/.bazelversion b/examples/testing/specs2_junit_repositories/.bazelversion index f22d756da..18bb4182d 100644 --- a/examples/testing/specs2_junit_repositories/.bazelversion +++ b/examples/testing/specs2_junit_repositories/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/scala/deps.bzl b/scala/deps.bzl index c41687cc8..706790011 100644 --- a/scala/deps.bzl +++ b/scala/deps.bzl @@ -23,13 +23,12 @@ def rules_scala_dependencies(): strip_prefix = "rules_cc-0.0.9", ) - # Needed by protobuf-21.7 and Bazel 6.5.0, as later versions require C++14. maybe( http_archive, - name = "com_google_absl", - sha256 = "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8", - strip_prefix = "abseil-cpp-20220623.1", - url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz", + name = "abseil-cpp", + sha256 = "16242f394245627e508ec6bb296b433c90f8d914f73b9c026fddb905e27276e8", + strip_prefix = "abseil-cpp-20250127.0", + url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20250127.0.tar.gz", ) maybe( @@ -44,9 +43,9 @@ def rules_scala_dependencies(): maybe( http_archive, name = "com_google_protobuf", - sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae", - strip_prefix = "protobuf-21.7", - url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.7.tar.gz", + sha256 = "ecfeb9f673e63321b4871c1cee6b5adeb0ef711d08a0c5bb1945271767df65bf", + strip_prefix = "protobuf-25.6", + url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v25.6.tar.gz", ) maybe( diff --git a/test/proto_cross_repo_boundary/repo/.bazelversion b/test/proto_cross_repo_boundary/repo/.bazelversion index f22d756da..18bb4182d 100644 --- a/test/proto_cross_repo_boundary/repo/.bazelversion +++ b/test/proto_cross_repo_boundary/repo/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/test_cross_build/.bazelversion b/test_cross_build/.bazelversion index f22d756da..18bb4182d 100644 --- a/test_cross_build/.bazelversion +++ b/test_cross_build/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/third_party/test/example_external_workspace/.bazelversion b/third_party/test/example_external_workspace/.bazelversion index f22d756da..18bb4182d 100644 --- a/third_party/test/example_external_workspace/.bazelversion +++ b/third_party/test/example_external_workspace/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/third_party/test/new_local_repo/.bazelversion b/third_party/test/new_local_repo/.bazelversion index f22d756da..18bb4182d 100644 --- a/third_party/test/new_local_repo/.bazelversion +++ b/third_party/test/new_local_repo/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 diff --git a/third_party/test/proto/.bazelversion b/third_party/test/proto/.bazelversion index f22d756da..18bb4182d 100644 --- a/third_party/test/proto/.bazelversion +++ b/third_party/test/proto/.bazelversion @@ -1 +1 @@ -6.5.0 +7.5.0 From 3c351f1da4dc9a74694c1d8480dd5366307c7a9a Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 6 Mar 2025 13:31:04 -0500 Subject: [PATCH 2/2] Downgrade to `protobuf` v25.5 It turns out `protobuf` v26.6 isn't compatibile with ScalaPB 0.9.8 used by Scala 2.11: ```txt Caused by: java.lang.UnsupportedOperationException: As of 2022/09/29 (release 21.7) makeExtensionsImmutable should not be called from protobuf gencode. If you are seeing this message, your gencode is vulnerable to a denial of service attack. You should regenerate your code using protobuf 25.6 or later. Use the latest version that meets your needs. However, if you understand the risks and wish to continue with vulnerable gencode, you can set the system property `-Dcom.google.protobuf.use_unsafe_pre22_gencode` on the command line. See security vulnerability: https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-h4h5-3hr4-j3g2 ``` As mentioned in #1710, we should consider dropping Scala 2.11 support at this point, since there's no ScalaPB release for it that supports later versions of `protobuf`. That, and we could remove some of the special case code added in the following changes, amongst other 2.11 support details: - #1631 - #1648 - #1687 - #1688 --- scala/deps.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scala/deps.bzl b/scala/deps.bzl index 706790011..df7707edd 100644 --- a/scala/deps.bzl +++ b/scala/deps.bzl @@ -43,9 +43,9 @@ def rules_scala_dependencies(): maybe( http_archive, name = "com_google_protobuf", - sha256 = "ecfeb9f673e63321b4871c1cee6b5adeb0ef711d08a0c5bb1945271767df65bf", - strip_prefix = "protobuf-25.6", - url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v25.6.tar.gz", + sha256 = "3cf7d5b17c4ff04fe9f038104e9d0cae6da09b8ce271c13e44f8ac69f51e4e0f", + strip_prefix = "protobuf-25.5", + url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v25.5.tar.gz", ) maybe(