Skip to content

Commit d798f21

Browse files
committed
Bump Bazel, Scalafmt, Guava, sbt, gRPC, proto-java
Dependency version and documentation updates broken out from bazel-contrib#1710. - Bazel: 7.5.0 => 7.6.0 - gRPC: 2.53.0 => 2.54.1 - Guava: 33.4.0-jre => 33.4.4-jre - Scalafmt: 3.9.2 => 3.9.4 - `com-google-protobuf:protobuf-java`: 4.30.0 => 4.30.1 - `org.scala-sbt:util-interface`: 1.10.10 => 1.10.11 The documentation updates include: - Minor editing updates and typo fixes - The new "Removal of `bind()` aliases for `twitter_scrooge` dependencies" section of `README.md` The Guava 33.4.4-jre update introduces a new dependency on `org.jspecify:jspecify:1.0.0`. 33.4.5-jre changes Guava to be a Java module, but that release currently has problems, so we're sticking with 34.4.4-jre until that 34.4.6-jre release. The Guava v33.4.1 release message contains all the details. - https://jspecify.dev/ - https://dev.java/learn/modules/intro/ - https://github.com/google/guava/releases/tag/v33.4.1
1 parent 11d3b32 commit d798f21

File tree

35 files changed

+359
-281
lines changed

35 files changed

+359
-281
lines changed

.bazelci/presubmit.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ tasks:
2929
# Install xmllint
3030
- sudo apt update && sudo apt install --reinstall libxml2-utils -y
3131
- "./test_rules_scala.sh"
32-
test_rules_scala_linux_latest:
33-
name: "./test_rules_scala (latest Bazel)"
32+
# Switch `last_rc` to `last_green` once Bzlmod lands.
33+
# https://github.com/bazelbuild/rules_scala/issues/1482
34+
test_rules_scala_linux_last_rc:
35+
name: "./test_rules_scala (last_rc Bazel)"
3436
platform: ubuntu2004
35-
# Restore `bazel: latest` once Bazel 8 compatibility lands (#1625, #1652).
36-
bazel: 7.x
37+
bazel: last_rc
3738
shell_commands:
3839
# Install xmllint
3940
- sudo apt update && sudo apt install --reinstall libxml2-utils -y
4041
- echo "build --enable_workspace" >> .bazelrc
41-
- "./test_rules_scala.sh || buildkite-agent annotate --style 'warning' \"Optional build with latest Bazel version failed, [see here](${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}) (It is not mandatory but worth checking)\""
42+
- "./test_rules_scala.sh || buildkite-agent annotate --style 'warning' \"Optional build with last_rc Bazel version failed, [see here](${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}) (It is not mandatory but worth checking)\""
4243
test_rules_scala_macos:
4344
name: "./test_rules_scala"
4445
platform: macos
@@ -53,16 +54,16 @@ tasks:
5354
- "set PATH=/usr/bin;%PATH%" #Make sure bash uses msys commands over windows commands. (i.e. find).
5455
- "bash -lc \"pacman --noconfirm --needed -S libxml2\"" #tests require xmllint
5556
- "bash test_rules_scala.sh"
56-
test_coverage_linux_7_5_0:
57+
test_coverage_linux_7_6_0:
5758
name: "./test_coverage"
5859
platform: ubuntu2004
59-
bazel: 7.5.0
60+
bazel: 7.6.0
6061
shell_commands:
6162
- "./test_coverage.sh"
62-
test_coverage_macos_7.5.0:
63+
test_coverage_macos_7.6.0:
6364
name: "./test_coverage"
6465
platform: macos
65-
bazel: 7.5.0
66+
bazel: 7.6.0
6667
shell_commands:
6768
- "./test_coverage.sh"
6869
test_reproducibility_linux:
@@ -93,13 +94,13 @@ tasks:
9394
examples_linux:
9495
name: "./test_examples"
9596
platform: ubuntu2004
96-
bazel: 7.5.0
97+
bazel: 7.6.0
9798
shell_commands:
9899
- "./test_examples.sh"
99100
cross_build_linux:
100101
name: "./test_cross_build"
101102
platform: ubuntu2004
102-
bazel: 7.5.0
103+
bazel: 7.6.0
103104
shell_commands:
104105
- "./test_cross_build.sh"
105106
lint_linux:

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.9.2"
1+
version = "3.9.4"
22
runner.dialect = scala213
33
align.openParenCallSite = false
44
align.openParenDefnSite = false

README.md

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ load("@rules_scala//:scala_config.bzl", "scala_config")
126126
# scala_config(scala_version = "2.13.16")
127127
#
128128
# You may define your own custom toolchain using Maven artifact dependencies
129-
# configured by your `WORKSPACE` file, imported using external loader like
130-
# https://github.com/bazelbuild/rules_jvm_external.
129+
# configured by your `WORKSPACE` file, imported using an external loader like
130+
# https://github.com/bazelbuild/rules_jvm_external. See docs/scala_toolchain.md.
131131
scala_config()
132132

133133
load(
@@ -264,20 +264,26 @@ maximum available at the time of writing.
264264
- For the actual versions used by `rules_scala`, see
265265
[scala/deps.bzl](scala/deps.bzl).
266266

267-
- See [the configuration file][ci-config] for the exact Bazel versions verified
268-
with the continuous-integration builds.
269-
270-
[ci-config]: ./.bazelci/presubmit.yml
267+
- See [.bazelci/presubmit.yml](./.bazelci/presubmit.yml) for the exact Bazel
268+
versions verified by the continuous integration builds.
271269

272270
| Bazel/Dependency | `rules_scala` 7.x |
273271
| :-: | :-: |
274-
| Bazel versions using Bzlmod<br/>(Coming soon! See bazelbuild/rules_scala#1482.) | 7.5.0, 8.x,<br/>`rolling`, `last_green` |
275-
| Bazel versions using `WORKSPACE` | 6.5.0, 7.5.0, 8.x<br/>(see the [notes on 6.5.0 compatibility](#6.5.0)) |
276-
| `protobuf` | v30.0 |
277-
| `abseil-cpp` | 20250127.0 |
278-
| `rules_java` | 8.10.0 |
272+
| Bazel versions using Bzlmod<br/>(Coming soon! See bazelbuild/rules_scala#1482.) | 7.6.0, 8.x,<br/>`rolling`, `last_green` |
273+
| Bazel versions using `WORKSPACE` | 6.5.0, 7.6.0, 8.x<br/>(see the [notes on 6.5.0 compatibility](#6.5.0)) |
274+
| `protobuf` | v30.1 |
275+
| `rules_proto` | 7.1.0 |
276+
| `abseil-cpp` | 20250127.1 |
277+
| `rules_java` | 8.11.0 |
279278
| `ScalaPB` | 1.0.0-alpha.1 |
280279

280+
The next major release will likely drop support for `protobuf` versions before
281+
v29 and remove `rules_proto` completely. This is to comply with the guidance in
282+
[Protobuf News: News Announcements for Version 29.x](
283+
https://protobuf.dev/news/v29/). For more details, see this [comment from #1710
284+
explaining why rules_proto remains for now](
285+
https://github.com/bazelbuild/rules_scala/pull/1710#issuecomment-2750001012).
286+
281287
## Usage with [bazel-deps](https://github.com/johnynek/bazel-deps)
282288

283289
Bazel-deps allows you to generate bazel dependencies transitively for maven artifacts. Generally we don't want bazel-deps to fetch
@@ -682,7 +688,7 @@ Under Bzlmod, repos are only visible to the module extension that creates them,
682688
unless the `MODULE.bazel` file brings them into scope with
683689
[`use_repo()`](https://bazel.build/rules/lib/globals/module#use_repo). This can
684690
lead to errors like those from the following example, which [originally called
685-
`setup_scala_toolchain()` under Bzlmod](
691+
'setup_scala_toolchain()' under Bzlmod](
686692
https://github.com/michalbogacz/scala-bazel-monorepo/blob/17f0890a4345529e09b9ce83bcb2e3d15687c522/BUILD.bazel):
687693

688694
```py
@@ -756,7 +762,7 @@ bazelbuild/bazel#25198 describes how the semantics of some instances of
756762
`$(rootpath)` fixed them.
757763

758764
The good news is that replacing such instances `$(location)` with `$(rootpath)`
759-
is backwards compatible to Bazel 6.5.0 and 7.5.0. Updating them now will ensure
765+
is backwards compatible to Bazel 6.5.0 and 7.6.0. Updating them now will ensure
760766
future compatibility.
761767

762768
### <a id="6.5.0"></a>Limited Bazel 6.5.0 compatibility
@@ -809,10 +815,52 @@ https://github.com/scalapb/ScalaPB/releases/tag/v1.0.0-alpha.1), we had to
809815
remove the Scala 2.11 test cases.
810816

811817
Building `scala_proto` for Scala 2.11 requires [building with Bazel 6.5.0
812-
under `WORKSPACE`](#6.5.0), with the maximum dependency versions specified in
818+
under WORKSPACE](#6.5.0), with the maximum dependency versions specified in
813819
that section. While this may continue to work for some time, it is not
814820
officially supported.
815821

822+
### Removal of `bind()` aliases for `twitter_scrooge` dependencies
823+
824+
`rules_scala` 7.x removes all of the obsolete [`bind()`][] aliases under
825+
`//external:io_bazel_rules_scala/dependency/` created for `twitter_scrooge`
826+
toolchain dependencies. If your project happens to depend on these aliases, you
827+
can replace them with the following repository references:
828+
829+
| `bind()` alias under `//external:io_bazel_rules_scala/dependency/` | Repository reference |
830+
| :-- | :-- |
831+
| `scala/guava` | `@io_bazel_rules_scala_guava` |
832+
| `thrift/javax_annotation_api` | `@io_bazel_rules_scala_javax_annotation_api` |
833+
| `thrift/libthrift` | `@libthrift` |
834+
| `thrift/mustache` | `@io_bazel_rules_scala_mustache` |
835+
| `thrift/scopt` | `@io_bazel_rules_scala_scopt` |
836+
| `thrift/scrooge_core` | `@io_bazel_rules_scala_scrooge_core` |
837+
| `thrift/scrooge_generator` | `@io_bazel_rules_scala_scrooge_generator` |
838+
| `thrift/util_core` | `@io_bazel_rules_scala_util_core` |
839+
| `thrift/util_logging` | `@io_bazel_rules_scala_util_logging` |
840+
841+
[`bind()`]: https://bazel.build/reference/be/workspace#bind
842+
843+
To access these repositories under Bzlmod, you'll need to add the following to
844+
your `MODULE.bazel` file:
845+
846+
```py
847+
scala_deps.toolchains(
848+
twitter_scrooge = True,
849+
)
850+
use_repo(
851+
scala_deps,
852+
"io_bazel_rules_scala_guava",
853+
"io_bazel_rules_scala_javax_annotation_api",
854+
"io_bazel_rules_scala_mustache",
855+
"io_bazel_rules_scala_scopt",
856+
"io_bazel_rules_scala_scrooge_core",
857+
"io_bazel_rules_scala_scrooge_generator",
858+
"io_bazel_rules_scala_util_core",
859+
"io_bazel_rules_scala_util_logging",
860+
"libthrift",
861+
)
862+
```
863+
816864
### Bazel module compatibility levels
817865

818866
`rules_scala` 7.0.0 will set the

docs/scala_toolchain.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ scala_toolchains()
2525
scala_register_toolchains()
2626
```
2727

28-
### B) Defining your own `scala_toolchain` requires 2 steps
28+
### B) Defining your own `scala_toolchain`
2929

3030
#### Step 1
3131

@@ -57,15 +57,15 @@ toolchain(
5757

5858
If you want to use your own compiler JARs, use `setup_scala_toolchain()`
5959
instead. This example assumes the external libraries are resolved with
60-
[rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external)
60+
[rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external):
6161

6262
```py
6363
# //toolchains/BUILD
6464
load("@rules_scala//scala:scala.bzl", "setup_scala_toolchain")
6565

6666
setup_scala_toolchain(
6767
name = "my_toolchain",
68-
# configure toolchain dependecies
68+
# configure toolchain dependencies
6969
parser_combinators_deps = [
7070
"@maven//:org_scala_lang_modules_scala_parser_combinators_2_12",
7171
],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

examples/crossbuild/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

0 commit comments

Comments
 (0)