Skip to content

Commit

Permalink
Bazel 7 and MSVC compatible version updates (#1711)
Browse files Browse the repository at this point in the history
* Bazel 7 and MSVC compatible version updates

Dependency version updates that still work with Bazel 6.5.0 and 7.5.0.
Broken out from #1710, and part of #1482 and #1652.

Updates `.bazelversion` files to 7.5.0 and the CI builds in
`.bazelci/presubmit.yml` to use Bazel 7.5.0.

Bumps the following dependencies, which should not cause build breakages
on Windows + MSVC:

- Go: 1.24.0 => 1.24.1
- Scalafmt: 3.9.1 => 3.9.2
- `abseil-cpp`: 20220623.1 => 20250127.0
- `grpc`: 1.70.0 => 1.71.1
- `protobuf-java`: 4.29.3 => 4.30.0
- `sbt-compiler-interface`: 1.10.7 => 1.10.8
- `sbt-compiler-util`: 1.10.7 => 1.10.10
- `google-common-protos`: 2.52.0 => 2.53.0

Defers the following updates, which are already present in #1710:

- `protobuf`: v21.7 => v28.3 (or v30.0)
- `rules_cc`: 0.0.9 => 0.1.1
- `rules_proto`: 6.0.2 => 7.1.0
- `rules_python`: 0.38.0 => 1.2.0
- `scalapb`: 0.11.17 => 1.0.0-alpha1

These deferred updates all need to happen together, as updating only a
subset of them will break the build.

This change is smaller and more focused than #1710, and should
ultimately make that pull request smaller and/or easier to review.

* Add `abseil-cpp` repo mapping to `protobuf`

This will make sure `protobuf` uses the version of `abseil-cpp` that we
import.

* Set `common --enable_workspace --noenable_bzlmod`

These flags affect `bazel query`, and Bazel 8 defaults to
`--noenable_workspace --enable_bzlmod`. Using `common` ensures `bazel
query` sees the same settings as `bazel build`. This prevents the
`WORKSPACE` run of `test_semanticdb_handles_removed_sourcefiles` from
failing under Bazel 8.

Bazel 6.5.0 doesn't define `--[no]enable_workspace`, so it makes sense
to include it in the change that sets all `.bazelversion` files to
7.5.0.
  • Loading branch information
mbland authored Mar 10, 2025
1 parent 1c2a792 commit bfc9495
Show file tree
Hide file tree
Showing 34 changed files with 311 additions and 311 deletions.
12 changes: 6 additions & 6 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ build --enable_platform_specific_config

build:windows --worker_quit_after_build --enable_runfiles

# Remove upon completing Bzlmod compatibility work.
# - https://github.com/bazelbuild/rules_scala/issues/1482
build --noenable_bzlmod
# Switch to --noenable_workspace when Bzlmod lands.
# https://github.com/bazelbuild/rules_scala/issues/1482
common --enable_workspace --noenable_bzlmod
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.9.1"
version = "3.9.2"
runner.dialect = scala213
align.openParenCallSite = false
align.openParenDefnSite = false
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ load(

go_rules_dependencies()

go_register_toolchains(version = "1.24.0")
go_register_toolchains(version = "1.24.1")

http_archive(
name = "bazelci_rules",
Expand Down
2 changes: 1 addition & 1 deletion dt_patches/compiler_sources/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion dt_patches/test_dt_patches/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion dt_patches/test_dt_patches_user_srcjar/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion examples/crossbuild/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion examples/scala3/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion examples/semanticdb/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion examples/testing/multi_frameworks_toolchain/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion examples/testing/scalatest_repositories/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion examples/testing/specs2_junit_repositories/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
10 changes: 5 additions & 5 deletions scala/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -47,6 +46,7 @@ def rules_scala_dependencies():
sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
strip_prefix = "protobuf-21.7",
url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.7.tar.gz",
repo_mapping = {"@com_google_absl": "@abseil-cpp"},
)

maybe(
Expand Down
12 changes: 6 additions & 6 deletions scripts/create_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
"3.6.4"
]
PARSER_COMBINATORS_VERSION = '1.1.2'
SBT_COMPILER_INTERFACE_VERSION = '1.10.7'
SBT_UTIL_INTERFACE_VERSION = '1.10.7'
SBT_COMPILER_INTERFACE_VERSION = '1.10.8'
SBT_UTIL_INTERFACE_VERSION = '1.10.10'
SCALATEST_VERSION = "3.2.19"
SCALAFMT_VERSION = "3.9.1"
SCALAFMT_VERSION = "3.9.2"
KIND_PROJECTOR_VERSION = "0.13.3"
PROTOBUF_JAVA_VERSION = "4.29.3"
PROTOBUF_JAVA_VERSION = "4.30.0"
JLINE_VERSION = '3.29.0'
SCALAPB_VERSION = '0.11.17'
PROTOC_BRIDGE_VERSION = '0.9.8'
GRPC_VERSION = '1.70.0'
GRPC_COMMON_PROTOS_VERSION = '2.52.0'
GRPC_VERSION = '1.71.0'
GRPC_COMMON_PROTOS_VERSION = '2.53.0'
GRPC_LIBS = ['netty', 'protobuf', 'stub']
GUAVA_VERSION = '33.4.0-jre'

Expand Down
2 changes: 1 addition & 1 deletion test/proto_cross_repo_boundary/repo/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion test/scalafmt/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.9.1"
version = "3.9.2"
runner.dialect = scala213
maxColumn = 40
lineEndings = preserve
2 changes: 1 addition & 1 deletion test_cross_build/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.5.0
2 changes: 1 addition & 1 deletion test_cross_build/scalafmt/.scalafmt2.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.9.1"
version = "3.9.2"
runner.dialect = scala213
maxColumn = 40
lineEndings = preserve
2 changes: 1 addition & 1 deletion test_cross_build/scalafmt/.scalafmt3.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.9.1"
version = "3.9.2"
runner.dialect = scala3
maxColumn = 40
lineEndings = preserve
40 changes: 20 additions & 20 deletions third_party/repositories/scala_2_11.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ artifacts = {
"sha256": "88241573467ddca44ffd4d74aa04c2bbfd11bf7c17e0c342c94c9de7a70a7c64",
},
"com_google_protobuf_protobuf_java": {
"artifact": "com.google.protobuf:protobuf-java:4.29.3",
"sha256": "442db5991a11974d72127353be7d7e7abdf8d943d83b16668cb2e336d7392f54",
"artifact": "com.google.protobuf:protobuf-java:4.30.0",
"sha256": "3e9ec992a1bd02eeec7229879e5e99798c0f582a3cbfc924792640256e87b67d",
},
"com_lihaoyi_fansi": {
"artifact": "com.lihaoyi:fansi_2.11:0.2.6",
Expand Down Expand Up @@ -566,24 +566,24 @@ artifacts = {
"sha256": "f412ecbb235c2460b45e63584109723dea8d94b819c78c9bfc38f50cba8546c0",
},
"scala_proto_rules_grpc_api": {
"artifact": "io.grpc:grpc-api:1.70.0",
"sha256": "45faf2ac1bf2791e8fdabce53684a86b62c99b84cba26fb13a5ba3f4abf80d6c",
"artifact": "io.grpc:grpc-api:1.71.0",
"sha256": "49771bad244de122f05780c12f3e74ba9a301be125d0941a85e649212f4a8a01",
"deps": [
"@com_google_code_findbugs_jsr305",
"@com_google_errorprone_error_prone_annotations",
"@io_bazel_rules_scala_guava",
],
},
"scala_proto_rules_grpc_context": {
"artifact": "io.grpc:grpc-context:1.70.0",
"sha256": "eb2824831c0ac03e741efda86b141aa863a481ebc4aaf5a5c1f13a481dbb40ff",
"artifact": "io.grpc:grpc-context:1.71.0",
"sha256": "dd0484ac5d0baf7ee810331504dc6202c7b426bc88dce24100e77f576904dd52",
"deps": [
"@scala_proto_rules_grpc_api",
],
},
"scala_proto_rules_grpc_core": {
"artifact": "io.grpc:grpc-core:1.70.0",
"sha256": "c2b5576b8b363b1b1006673c492d912500baaa1581430a7f9c05e82cc5bdfba4",
"artifact": "io.grpc:grpc-core:1.71.0",
"sha256": "03099494c60cb9fea5802ebba8d767e44697062ec05e5207b5ae897e09bd38e9",
"deps": [
"@com_google_android_annotations",
"@com_google_code_gson_gson",
Expand All @@ -596,8 +596,8 @@ artifacts = {
],
},
"scala_proto_rules_grpc_netty": {
"artifact": "io.grpc:grpc-netty:1.70.0",
"sha256": "466bc29f36bb3b33ba6fa044d17cdfac494e5715ff606e1794541d0b90b42c16",
"artifact": "io.grpc:grpc-netty:1.71.0",
"sha256": "dc45a8d584b9994645470f7e3543238a8618c67ea3cfa03089d2a67ea1a4ddf1",
"deps": [
"@com_google_errorprone_error_prone_annotations",
"@io_bazel_rules_scala_guava",
Expand All @@ -612,8 +612,8 @@ artifacts = {
],
},
"scala_proto_rules_grpc_protobuf": {
"artifact": "io.grpc:grpc-protobuf:1.70.0",
"sha256": "9b98039ed826604c46d6ac8f8a182d413d348ec6abe26467736b05aa92e7e1d3",
"artifact": "io.grpc:grpc-protobuf:1.71.0",
"sha256": "7eba0625fba8e176c0fc1b80610fc2c52c036d95805ffdd3f6985a51c968de94",
"deps": [
"@com_google_code_findbugs_jsr305",
"@com_google_protobuf_protobuf_java",
Expand All @@ -624,17 +624,17 @@ artifacts = {
],
},
"scala_proto_rules_grpc_protobuf_lite": {
"artifact": "io.grpc:grpc-protobuf-lite:1.70.0",
"sha256": "e7cc2ca8981672851cbebf83a24bfb93c1b2b058e75c1a817a757b914f33403d",
"artifact": "io.grpc:grpc-protobuf-lite:1.71.0",
"sha256": "ffad977400b49649fa2d5404abaadfca66c7e5956974f192411e8946a12e5f53",
"deps": [
"@com_google_code_findbugs_jsr305",
"@io_bazel_rules_scala_guava",
"@scala_proto_rules_grpc_api",
],
},
"scala_proto_rules_grpc_stub": {
"artifact": "io.grpc:grpc-stub:1.70.0",
"sha256": "5adaa1ec1f744b67ae14a8dbc39c9589c010fad0fd557b0a02966202e4d23a18",
"artifact": "io.grpc:grpc-stub:1.71.0",
"sha256": "51912e612b28db65eec0332a8be494b3c54d347ecd2c5f6a7fdd2cb994fab360",
"deps": [
"@com_google_errorprone_error_prone_annotations",
"@io_bazel_rules_scala_guava",
Expand All @@ -643,8 +643,8 @@ artifacts = {
],
},
"scala_proto_rules_grpc_util": {
"artifact": "io.grpc:grpc-util:1.70.0",
"sha256": "683aff93d2cabc44ff21dc9ab7794f8ae7b4c65d18748c8474535311eabe8dc4",
"artifact": "io.grpc:grpc-util:1.71.0",
"sha256": "32a9197c541bb072dc2f728e235347c3c0f7cf8062abf3de58c50b4fc70f31b1",
"deps": [
"@io_bazel_rules_scala_guava",
"@org_codehaus_mojo_animal_sniffer_annotations",
Expand Down Expand Up @@ -779,8 +779,8 @@ artifacts = {
"sha256": "c7b478503ec524e55df19b424d46d27c8a68aeb801664fadd4f069b71f52d0f6",
},
"scala_proto_rules_proto_google_common_protos": {
"artifact": "com.google.api.grpc:proto-google-common-protos:2.52.0",
"sha256": "425c5a015b661e583d8b28ebf4fc443eed160835bc93041b9aa97bcd947ab5c5",
"artifact": "com.google.api.grpc:proto-google-common-protos:2.53.0",
"sha256": "61ac7fbd31a9f604890d22330a6f94b3f410ea2d7247e0f5f11a87ae34087385",
"deps": [
"@com_google_protobuf_protobuf_java",
],
Expand Down
Loading

0 comments on commit bfc9495

Please sign in to comment.