Skip to content

Commit 898484e

Browse files
committed
Bump dependency versions for rules_scala v7.1.0
Bumps most dependency versions (except `rules_python` under `WORKSPACE`) to the latest available before releasing `rules_scala` v7.1.0. Also bumps the `rules_scala` version number in `MODULE.bazel` to `7.1.0`. - Go: 1.24.4 => 1.24.5 - Scalafmt: 3.9.7 => 3.9.8 - `bazel_skylib`: 1.7.1 => 1.8.1 - `gazelle`: 0.43.0 => 0.44.0 - `golang.org/x/tools`: v0.34.0 => v0.35.0 - `org.scala-sbt:util-interface`: 1.11.1 => 1.11.3 - `proto-google-common-protos`: 2.58.0 => 2.59.2 - `rules_cc`: 0.1.1 => 0.1.4 - `rules_go`: 0.55.0 => 0.55.1 - `rules_java`: 8.12.0 => 8.14.0 - `rules_jvm_external`: 6.7 => 6.8 - `rules_python`: 1.4.1 => 1.5.1 (Bzlmod only) Also: - Moves the `http_archive` instantiations of `rules_python` and `rules_shell` from individual `WORKSPACE` files to `//scala:latest_deps.bzl`. Removes `load` statements for `http_archive` throughout all `WORKSPACE` files. - Removes the `--incompatible_autoload_externally` flag from `.bazelrc`. - Fixes `_get_compiler_srcjar` from `//scala/private:macros/scala_repositories.bzl` to return empty `compiler_srcjar_objects` instead of returning a valid object. Caught by `test_compiler_srcjar_error 2.12.11` from `dt_patches/dt_patch_test.sh` when testing under `WORKSPACE`. Added `test_fail_if_compiler_srcjar_object_is_empty` to `test/shell/test_compiler_sources_integrity.sh` to catch the specific problem sooner. --- This is to ensure that we're compatible with the latest dependencies available before releasing a new minor version. I moved the `rules_python` instantiation to `//scala:latest_deps.bzl` because it was such a pain to update everywhere. `latest_deps.bzl` is essentially a development file, or a "use at your own risk" file, and the primary consumers are internal test modules. This will make future `rules_python` updates less noisy. The only `rules_shell` instantiations were in the top level `WORKSPACE` and `test_version/WORKSPACE.template`. I moved `rules_shell` into `latest_deps.bzl` to eliminate these direct instantations as well, and to remove the `http_archive` imports from those files. I'd added `--incompatible_autoload_externally` in bazel-contrib#1748 when fixing problems with `WORKSPACE` builds under Bazel 8.2.1. However, it's not really necessary, so I removed it. Updating `rules_python` from 1.4.1 to 1.5.1 produced the following error in Bazel 7.6.1 WORKSPACE builds, even with `--incompatible_autoload_externally=+@rules_python`: ```txt $ bazel build //src/... //test/... WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_python' found. This will result in a failure if there's a reference to those rules or symbols. ERROR: test/BUILD:824:10: in py_binary rule //test:py_resource_binary: Traceback (most recent call last): File ".../external/rules_python/python/private/py_binary_rule.bzl", line 24, column 30, in _py_binary_impl return py_executable_impl( File ".../external/rules_python/python/private/py_executable.bzl", line 255, column 35, in py_executable_impl py_executable_base_impl( File ".../external/rules_python/python/private/py_executable.bzl", line 1140, column 46, in py_executable_base_impl exec_result = semantics.create_executable( File ".../external/rules_python/python/private/py_executable.bzl", line 365, column 33, in _create_executable _create_stage1_bootstrap( File ".../external/rules_python/python/private/py_executable.bzl", line 809, column 27, in _create_stage1_bootstrap if runtime and runtime.supports_build_time_venv: Error: 'PyRuntimeInfo' value has no field or method 'supports_build_time_venv' Available attributes: bootstrap_template, coverage_files, coverage_tool, files, interpreter, interpreter_path, python_version, stub_shebang ERROR: test/BUILD:824:10: Analysis of target '//test:py_resource_binary' failed ERROR: Analysis of target '//test:py_resource_binary' failed; build aborted ``` This is due to bazel-contrib/rules_python#2760. In contrast, Bazel 8.3.1 builds work fine, as do Bazel 7.6.1 builds under Bzlmod. Trying `--incompatible_autoload_externally=PyRuntimeInfo` to work around the problem under Bazel 7.6.1 produced: ```txt $ bazel build //src/... //test/... FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.IllegalStateException: Symbol in 'PyRuntimeInfo' can't be removed, because it's still used by: py_binary, py_test, py_library at com.google.devtools.build.lib.packages.AutoloadSymbols.<init>(AutoloadSymbols.java:192) [...snip...] ``` And with `--incompatible_autoload_externally=@rules_python` produced: ```txt WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_python' found. This will result in a failure if there's a reference to those rules or symbols. ERROR: .../external/bazel_tools/tools/python/toolchain.bzl:25:44: name 'PyRuntimeInfo' is not defined ERROR: .../external/bazel_tools/tools/python/toolchain.bzl:33:44: name 'PyRuntimeInfo' is not defined ERROR: .../external/bazel_tools/tools/python/toolchain.bzl:64:26: name 'PyRuntimeInfo' is not defined ERROR: .../external/bazel_tools/tools/python/toolchain.bzl:72:26: name 'PyRuntimeInfo' is not defined WARNING: Target pattern parsing failed. ERROR: Skipping '//test/...': error loading package under directory 'test': error loading package 'test': at .../external/rules_python/python/defs.bzl:21:6: at .../external/rules_python/python/py_runtime_pair.bzl:17:6: compilation of module 'tools/python/toolchain.bzl' failed ERROR: error loading package under directory 'test': error loading package 'test': at .../external/rules_python/python/defs.bzl:21:6: at .../external/rules_python/python/py_runtime_pair.bzl:17:6: compilation of module 'tools/python/toolchain.bzl' failed ``` `tools/python/toolchain.bzl` from Bazel 7.6.1 breaks because it references the builtin `PyRuntimeInfo` instead of `load`ing it from `@rules_python`. Bazel 8 replaces that file's entire implementation with a function that `fail`s with a deprecation error and doesn't use `PyRuntimeInfo`: - https://github.com/bazelbuild/bazel/blob/7.6.1/tools/python/toolchain.bzl - https://github.com/bazelbuild/bazel/blob/8.0.0/tools/python/toolchain.bzl Using `+@rules_python` or `+PyRuntimeInfo` produced the original error. Nothing I could do could avoid using the builtin `PyRuntimeInfo` under Bazel 7.6.1. Since it's only a development dependency for `WORKSPACE` builds, I decided to keep `rules_python` at 1.4.1 in `latest_deps.bzl` for now. I've filed bazel-contrib/rules_python#3119 to get it on the record.
1 parent 933d698 commit 898484e

File tree

38 files changed

+270
-387
lines changed

38 files changed

+270
-387
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Remove once Bazel 8 becomes the minimum supported version.
2-
common --noenable_workspace --incompatible_use_plus_in_repo_names --incompatible_autoload_externally=
2+
common --noenable_workspace --incompatible_use_plus_in_repo_names
33

44
# Uncomment to run tests under `WORKSPACE`. Remove once Bazel 9 becomes the
55
# minimum supported version.

.scalafmt.conf

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

MODULE.bazel

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module(
44
name = "rules_scala",
5-
version = "7.0.0",
5+
version = "7.1.0",
66
bazel_compatibility = [">=7.1.0"],
77
compatibility_level = 7,
88
)
@@ -30,7 +30,7 @@ SCALA_VERSIONS = SCALA_2_VERSIONS + SCALA_3_VERSIONS
3030
bazel_dep(name = "bazel_skylib", version = "1.6.0")
3131
single_version_override(
3232
module_name = "bazel_skylib",
33-
version = "1.7.1",
33+
version = "1.8.1",
3434
)
3535

3636
bazel_dep(name = "platforms", version = "0.0.9")
@@ -42,7 +42,7 @@ single_version_override(
4242
bazel_dep(name = "rules_java", version = "7.6.0")
4343
single_version_override(
4444
module_name = "rules_java",
45-
version = "8.12.0",
45+
version = "8.14.0",
4646
)
4747

4848
bazel_dep(name = "rules_proto", version = "6.0.0")
@@ -254,18 +254,18 @@ bazel_dep(
254254
)
255255
bazel_dep(
256256
name = "rules_go",
257-
version = "0.55.0",
257+
version = "0.55.1",
258258
dev_dependency = True,
259259
repo_name = "io_bazel_rules_go", # for com_github_bazelbuild_buildtools
260260
)
261-
bazel_dep(name = "gazelle", version = "0.43.0", dev_dependency = True)
261+
bazel_dep(name = "gazelle", version = "0.44.0", dev_dependency = True)
262262

263263
go_sdk = use_extension(
264264
"@io_bazel_rules_go//go:extensions.bzl",
265265
"go_sdk",
266266
dev_dependency = True,
267267
)
268-
go_sdk.download(version = "1.24.4")
268+
go_sdk.download(version = "1.24.5")
269269

270270
go_deps = use_extension(
271271
"@gazelle//:extensions.bzl",
@@ -287,8 +287,8 @@ go_deps = use_extension(
287287
# curl https://sum.golang.org/lookup/golang.org/x/tools@v0.34.0
288288
go_deps.module(
289289
path = "golang.org/x/tools",
290-
sum = "h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=",
291-
version = "v0.34.0",
290+
sum = "h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=",
291+
version = "v0.35.0",
292292
)
293293
go_deps.module(
294294
path = "github.com/golang/protobuf",
@@ -301,5 +301,5 @@ use_repo(
301301
"org_golang_x_tools",
302302
)
303303

304-
bazel_dep(name = "rules_python", version = "1.4.1", dev_dependency = True)
304+
bazel_dep(name = "rules_python", version = "1.5.1", dev_dependency = True)
305305
bazel_dep(name = "rules_shell", version = "0.5.0", dev_dependency = True)

WORKSPACE

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
3131

3232
bazel_skylib_workspace()
3333

34-
http_archive(
35-
name = "rules_python",
36-
sha256 = "9f9f3b300a9264e4c77999312ce663be5dee9a56e361a1f6fe7ec60e1beef9a3",
37-
strip_prefix = "rules_python-1.4.1",
38-
url = "https://github.com/bazelbuild/rules_python/releases/download/1.4.1/rules_python-1.4.1.tar.gz",
39-
)
40-
4134
load("@rules_python//python:repositories.bzl", "py_repositories")
4235

4336
py_repositories()
@@ -112,10 +105,10 @@ local_repository(
112105

113106
http_archive(
114107
name = "io_bazel_rules_go",
115-
sha256 = "c6cf9da6668ac84c470c43cbfccb8fdc844ead2b5a8b918e2816d44f2986f644",
108+
sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a",
116109
urls = [
117-
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.0/rules_go-v0.55.0.zip",
118-
"https://github.com/bazel-contrib/rules_go/releases/download/v0.55.0/rules_go-v0.55.0.zip",
110+
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.0.zip",
111+
"https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
119112
],
120113
)
121114

@@ -127,7 +120,7 @@ load(
127120

128121
go_rules_dependencies()
129122

130-
go_register_toolchains(version = "1.24.4")
123+
go_register_toolchains(version = "1.24.5")
131124

132125
http_archive(
133126
name = "bazelci_rules",
@@ -149,13 +142,6 @@ dev_deps_repositories()
149142

150143
register_toolchains("//test/toolchains:java21_toolchain_definition")
151144

152-
http_archive(
153-
name = "rules_shell",
154-
sha256 = "b15cc2e698a3c553d773ff4af35eb4b3ce2983c319163707dddd9e70faaa062d",
155-
strip_prefix = "rules_shell-0.5.0",
156-
url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.5.0/rules_shell-v0.5.0.tar.gz",
157-
)
158-
159145
load(
160146
"@rules_shell//shell:repositories.bzl",
161147
"rules_shell_dependencies",

deps/latest/MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ module(
66
bazel_compatibility = [">=7.1.0"],
77
)
88

9-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
9+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
1010
bazel_dep(name = "platforms", version = "1.0.0")
1111
bazel_dep(name = "protobuf", version = "31.1")
12-
bazel_dep(name = "rules_java", version = "8.12.0")
12+
bazel_dep(name = "rules_java", version = "8.14.0")
1313
bazel_dep(name = "rules_proto", version = "7.1.0")
1414

1515
# https://github.com/bazelbuild/bazel/pull/25681 removed
1616
# `bazel_tools/tools/cpp/osx_cc_wrapper.sh.tpl` in the `last_green` Bazel as of
1717
# 2025-04-08. At least `test_cross_build` breaks without this.
18-
bazel_dep(name = "rules_cc", version = "0.1.1")
18+
bazel_dep(name = "rules_cc", version = "0.1.4")

dt_patches/test_dt_patches/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
workspace(name = "test_dt_patches")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
local_repository(
64
name = "rules_scala",
75
path = "../..",
@@ -29,13 +27,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2927

3028
bazel_skylib_workspace()
3129

32-
http_archive(
33-
name = "rules_python",
34-
sha256 = "9f9f3b300a9264e4c77999312ce663be5dee9a56e361a1f6fe7ec60e1beef9a3",
35-
strip_prefix = "rules_python-1.4.1",
36-
url = "https://github.com/bazelbuild/rules_python/releases/download/1.4.1/rules_python-1.4.1.tar.gz",
37-
)
38-
3930
load("@rules_python//python:repositories.bzl", "py_repositories")
4031

4132
py_repositories()

dt_patches/test_dt_patches_user_srcjar/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
workspace(name = "test_dt_patches")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
local_repository(
64
name = "rules_scala",
75
path = "../..",
@@ -29,13 +27,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2927

3028
bazel_skylib_workspace()
3129

32-
http_archive(
33-
name = "rules_python",
34-
sha256 = "9f9f3b300a9264e4c77999312ce663be5dee9a56e361a1f6fe7ec60e1beef9a3",
35-
strip_prefix = "rules_python-1.4.1",
36-
url = "https://github.com/bazelbuild/rules_python/releases/download/1.4.1/rules_python-1.4.1.tar.gz",
37-
)
38-
3930
load("@rules_python//python:repositories.bzl", "py_repositories")
4031

4132
py_repositories()

examples/crossbuild/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
workspace(name = "cross_build")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
local_repository(
64
name = "rules_scala",
75
path = "../..",
@@ -29,13 +27,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2927

3028
bazel_skylib_workspace()
3129

32-
http_archive(
33-
name = "rules_python",
34-
sha256 = "9f9f3b300a9264e4c77999312ce663be5dee9a56e361a1f6fe7ec60e1beef9a3",
35-
strip_prefix = "rules_python-1.4.1",
36-
url = "https://github.com/bazelbuild/rules_python/releases/download/1.4.1/rules_python-1.4.1.tar.gz",
37-
)
38-
3930
load("@rules_python//python:repositories.bzl", "py_repositories")
4031

4132
py_repositories()

examples/overridden_artifacts/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
workspace(name = "overridden_artifacts")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
local_repository(
64
name = "rules_scala",
75
path = "../..",
@@ -29,13 +27,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2927

3028
bazel_skylib_workspace()
3129

32-
http_archive(
33-
name = "rules_python",
34-
sha256 = "9f9f3b300a9264e4c77999312ce663be5dee9a56e361a1f6fe7ec60e1beef9a3",
35-
strip_prefix = "rules_python-1.4.1",
36-
url = "https://github.com/bazelbuild/rules_python/releases/download/1.4.1/rules_python-1.4.1.tar.gz",
37-
)
38-
3930
load("@rules_python//python:repositories.bzl", "py_repositories")
4031

4132
py_repositories()

examples/scala3/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
workspace(name = "specs2_junit_repositories")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
local_repository(
64
name = "rules_scala",
75
path = "../..",
@@ -29,13 +27,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2927

3028
bazel_skylib_workspace()
3129

32-
http_archive(
33-
name = "rules_python",
34-
sha256 = "9f9f3b300a9264e4c77999312ce663be5dee9a56e361a1f6fe7ec60e1beef9a3",
35-
strip_prefix = "rules_python-1.4.1",
36-
url = "https://github.com/bazelbuild/rules_python/releases/download/1.4.1/rules_python-1.4.1.tar.gz",
37-
)
38-
3930
load("@rules_python//python:repositories.bzl", "py_repositories")
4031

4132
py_repositories()

0 commit comments

Comments
 (0)