@@ -166,12 +166,13 @@ v6.x:
166
166
167
167
- __ ` rules_scala ` no longer requires the ` io_bazel_rules_scala ` repository
168
168
name__ unless your ` BUILD ` files or those of your dependencies require it
169
- (bazelbuild/rules_scala #1696 ). You can use the ` repo_mapping ` attribute of
170
- ` http_archive ` , or equivalent Bzlmod mechanisms, to translate ` @rules_scala `
171
- to ` @io_bazel_rules_scala ` for dependencies. The
172
- [ '@io_bazel_rules_scala_config' is now '@rules_scala_config'] ( #map ) section
173
- below describes these options in detail. (That section is about
174
- ` @rules_scala_config ` , but the same mechanisms apply.)
169
+ (bazelbuild/rules_scala #1696 ).
170
+
171
+ You can use the ` repo_mapping ` attribute of ` http_archive ` or equivalent
172
+ Bzlmod mechanisms to translate ` @rules_scala ` to ` @io_bazel_rules_scala `
173
+ for dependencies. See the [ '@io_bazel_rules_scala_config' is now
174
+ '@rules_scala_config'] ( #map ) section below for details. (That section is
175
+ about ` @rules_scala_config ` , but the same mechanisms apply.)
175
176
176
177
- __ ` rules_scala ` v7.0.0 introduces a new ` scala_toolchains() ` API that is
177
178
very different from ` rules_scala ` 6__ . For details on what's changed, see
@@ -384,7 +385,7 @@ maximum available at the time of writing.
384
385
385
386
| Bazel/Dependency | ` rules_scala ` 7.x |
386
387
| :-: | :-: |
387
- | Bazel versions using Bzlmod<br />(Coming soon! See bazelbuild/rules_scala #1482 .) | 7.5.0, 8.x |
388
+ | Bazel versions using Bzlmod<br />(Coming soon! See bazelbuild/rules_scala #1482 .) | 7.5.0, 8.x,< br /> ` rolling ` , ` last_green ` |
388
389
| Bazel versions using ` WORKSPACE ` | 6.5.0, 7.5.0, 8.x<br />(see the [ notes on 6.5.0 compatibility] ( #6.5.0 ) ) |
389
390
| ` protobuf ` | v29.3 |
390
391
| ` abseil-cpp ` | 20250127.0 |
@@ -574,7 +575,8 @@ load(
574
575
" scala_toolchains" ,
575
576
)
576
577
577
- # Note that `rules_scala` toolchain repos are _always_ configured.
578
+ # The `scala_version` toolchain repos used by `scala_library` and `scala_binary`
579
+ # are _always_ configured, but all others are optional.
578
580
scala_toolchains(
579
581
scalafmt = True,
580
582
scalatest = True,
@@ -590,9 +592,9 @@ examples.
590
592
591
593
### Replacing toolchain registration macros in ` WORKSPACE `
592
594
593
- Almost all ` rules_scala ` toolchains are automatically configured and registered by
594
- ` scala_toolchains() ` and ` scala_register_toolchains() ` . There are two toolchain
595
- macro replacements that require special handling.
595
+ Almost all ` rules_scala ` toolchains configured using ` scala_toolchains() ` are
596
+ automatically registered by ` scala_register_toolchains() ` . There are two
597
+ toolchain macro replacements that require special handling.
596
598
597
599
The first is replacing ` scala_proto_register_enable_all_options_toolchain() `
598
600
with the following ` scala_toolchains() ` parameters:
@@ -681,12 +683,10 @@ shouldn't affect most users, but it may break some builds using
681
683
` @io_bazel_rules_scala_config ` to define custom [ cross-compilation targets] (
682
684
./docs/cross-compilation.md).
683
685
684
- If you can't fix uses of ` @io_bazel_rules_scala_config ` in your own project
685
- immediately, or have dependencies that need it, there are options.
686
- Use one of the following mechanisms to override it with ` @rules_scala_config ` .
687
-
688
- The same mechanisms also apply if you need to translate ` @rules_scala ` to
689
- ` @io_bazel_rules_scala ` for your dependencies.
686
+ If you can't update ` @io_bazel_rules_scala_config ` references in your own
687
+ project immediately, or have dependencies that require it, use the workarounds
688
+ below. (The same workarounds also apply if you need to translate ` @rules_scala `
689
+ to ` @io_bazel_rules_scala ` .)
690
690
691
691
#### Bzlmod
692
692
@@ -766,8 +766,8 @@ supporting Bazel + MSVC builds per:
766
766
- [ protocolbuffers/protobuf #20085 : Breaking Change: Dropping support for
767
767
Bazel+MSVC] ( https://github.com/protocolbuffers/protobuf/issues/20085 )
768
768
769
- Enable [ protocol compiler toolchainization] ( #protoc ) to fix broken Windows
770
- builds by avoiding ` @com_google_protobuf//:protoc ` recompilation.
769
+ To fix this problem, enable [ protocol compiler toolchainization] ( #protoc ) to
770
+ avoid ` @com_google_protobuf//:protoc ` recompilation.
771
771
772
772
### Embedded resource paths no longer begin with ` external/<repo_name> `
773
773
@@ -838,9 +838,9 @@ ERROR: no such package
838
838
```
839
839
840
840
In this case, where the toolchain only sets different compiler options, the best
841
- fix is to [ use ` scala_toolchain ` directly instead] [ scala_tc_direct ] . Its
842
- underlying ` BUILD ` rule uses builtin toolchain dependencies via existing targets
843
- visible within ` rules_scala ` , without forcing users to import them:
841
+ fix is to [ use the ' scala_toolchain' rule directly instead] [ scala_tc_direct ] .
842
+ Its underlying ` BUILD ` rule uses builtin toolchain dependencies via existing
843
+ targets visible within ` rules_scala ` , without forcing users to import them:
844
844
845
845
[ scala_tc_direct ] : https://github.com/michalbogacz/scala-bazel-monorepo/blob/2cac860f386dcaa1c3be56cd25a84b247d335743/BUILD.bazel
846
846
0 commit comments