Skip to content

Commit 7a25bac

Browse files
committed
Bump to Bazel 7.6.0, update scala = False docs
The docs are more clear that `scala_toolchains(scala = False)` applies when using custom JARs for every `setup_scala_toolchain()` argument. Otherwise `setup_scala_toolchain()` will fall back to the builtin JARs, and needs `scala = True, validate_scala_version = False`. Also removes the `scala_register_toolchains()` calls from the `dt_patches/test_dt_patches*/WORKSPACE` files. This proves that those calls were harmless before in those repos, but ultimately unnecessary. `MODULE.bazel` will still register `@rules_scala_toolchains//...:all`.
1 parent 973f330 commit 7a25bac

File tree

20 files changed

+38
-38
lines changed

20 files changed

+38
-38
lines changed

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ same exact call will also work in `MODULE.bazel`.
804804

805805
### Disabling builtin Scala toolchains when defining custom Scala toolchains
806806

807-
When [defining a 'scala_toolchain()' using custom compiler JARs](
807+
When [using 'setup_scala_toolchain()' with custom compiler JARs](
808808
docs/scala_toolchain.md#b-defining-your-own-scala_toolchain), don't use
809809
`scala_toolchains()` if you don't need any other builtin toolchains.
810810

@@ -819,9 +819,9 @@ scala_toolchains(
819819
```
820820

821821
This avoids instantiating the default Scala toolchain and compiler JAR
822-
repositories and a corresponding Scala version check, which may fail when
823-
defining a custom toolchain. It's equivalent to two ways in which the previous
824-
API avoided the same default behavior:
822+
repositories, and disables the corresponding Scala version check, which may
823+
otherwise fail. This is equivalent to two ways in which the previous API avoided
824+
the same default behavior:
825825

826826
- Calling `scala_repositories(load_jar_deps = False)` would instantiate only
827827
other `rules_scala` dependency repos (`rules_java`, `protobuf`, etc.) and

docs/scala_toolchain.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ register_toolchains("//toolchains:my_scala_toolchain")
103103

104104
#### Step 3 (optional)
105105

106-
If you use `scala_toolchains()` to instantiate other builtin toolchains, set
107-
`scala = False`:
106+
When using your own JARs for every `setup_scala_toolchain()` argument, while
107+
using `scala_toolchains()` to instantiate other builtin toolchains, set `scala =
108+
False`:
108109

109110
```py
110111
# WORKSPACE
@@ -115,10 +116,21 @@ scala_toolchains(
115116
```
116117

117118
Otherwise, `scala_toolchains()` will try to instantiate a default Scala
118-
toolchain and its compiler JAR dependency repositories. The build will then fail
119-
if the configured Scala version doesn't match the `scala_version` value in the
119+
toolchain and its compiler JAR repositories. The build will then fail if the
120+
configured Scala version doesn't match the `scala_version` value in the
120121
corresponding `third_party/repositories/scala_*.bzl` file.
121122

123+
If you don't specify your own jars for every `setup_scala_toolchain()` argument,
124+
set `validate_scala_version = False` to disable the Scala version check.
125+
126+
```py
127+
# WORKSPACE
128+
scala_toolchains(
129+
validate_scala_version = False,
130+
# ...other toolchain parameters...
131+
)
132+
```
133+
122134
## Configuration options
123135

124136
The following attributes apply to both `scala_toolchain` and
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

dt_patches/test_dt_patches/WORKSPACE

+1-7
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,11 @@ load("@compiler_sources//:extensions.bzl", "import_compiler_source_repos")
7373

7474
import_compiler_source_repos()
7575

76-
load(
77-
"@rules_scala//scala:toolchains.bzl",
78-
"scala_register_toolchains",
79-
"scala_toolchains",
80-
)
76+
load("@rules_scala//scala:toolchains.bzl", "scala_toolchains")
8177

8278
scala_toolchains(
8379
fetch_sources = True,
8480
validate_scala_version = False,
8581
)
8682

8783
register_toolchains(":dt_scala_toolchain")
88-
89-
scala_register_toolchains()
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

dt_patches/test_dt_patches_user_srcjar/WORKSPACE

+1-7
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,7 @@ srcjars_by_version = {
149149
},
150150
}
151151

152-
load(
153-
"@rules_scala//scala:toolchains.bzl",
154-
"scala_register_toolchains",
155-
"scala_toolchains",
156-
)
152+
load("@rules_scala//scala:toolchains.bzl", "scala_toolchains")
157153

158154
scala_toolchains(
159155
fetch_sources = True,
@@ -162,5 +158,3 @@ scala_toolchains(
162158
)
163159

164160
register_toolchains(":dt_scala_toolchain")
165-
166-
scala_register_toolchains()

examples/crossbuild/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

examples/scala3/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

examples/semanticdb/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

test_cross_build/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

third_party/test/proto/.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0
1+
7.6.0

0 commit comments

Comments
 (0)