Skip to content

Commit ab5b542

Browse files
committed
Update Runfiles usage to fix BCR, bump versions
Fixes the runfiles problems with Windows builds for Bazel 8 and later seen in bazelbuild/bazel-central-registry#5490. Bumps a number of dependencies, and bumps the `rules_scala` version in `MODULE.bazel` from `7.1.0` to `7.1.1`. Dependency version bumps include: - Go: 1.24.5 => 1.25.0 - `golang.org/x/tools`: v0.35.0 => v0.36.0 - `jline`: 3.30.4 => 3.30.5 - `protobuf-java`: 4.31.1 => 4.32.0 - `protobuf`: v31.1 => v32.0 - `rules_java`: 8.15.0 => 8.15.1 - `rules_python`: 1.5.2 => 1.5.3 Also: - Restores `examples/crossbuild/protobuf.patch` to a symlink, undoing the change from #1760. - Fixes precompiled Windows protoc selection on ARM64 in `protoc/private/protoc_toolchains.bzl`. - Removes `RULES_SCALA_MAIN_WS_NAME` from the ScalaTest runner implementation. - Removes `rules_jvm_external` from `scala/latest_deps.bzl`. --- bazelbuild/continuous-integration#2350 resolved the Windows symlink problem, fixing the bazelbuild/bazel-central-registry#5490 Bazel 7 Windows build. This enables the restoration of the original `examples/crossbuild/protobuf.patch` symlink, effectively closing bazelbuild/bazel-central-registry#5506. The `src/java/io/bazel/rulesscala/exe/LauncherFileWriter.java` changes fix the remaining bazelbuild/bazel-central-registry#5490 breakages. Specifically, adding the `.exe` suffix only when necessary under Bazel 7 fixes the Windows builds for Bazel 8 and later. However, we'll have to close that pull request and push the v7.1.1 tag to begin a new release. The updates to use `@AutoBazelRepository` and `Runfiles.preload()`, etc. are from the `com.google.devtools.build.Runfiles` docstring: - https://github.com/bazelbuild/rules_java/blob/8.15.1/java/runfiles/src/main/java/com/google/devtools/build/runfiles/Runfiles.java#L31-L134 `RULES_SCALA_MAIN_WS_NAME` is no longer necessary given proper runfiles library usage, and technically became obsolete in commit f758956. Instantiating `rules_jvm_external` ourselves is no longer necessary because `protobuf` v32.0 contains protocolbuffers/protobuf#22225, which closed protocolbuffers/protobuf#19129. I've tested this change using my personal Windows 11 ARM64 virtual machine, hence the updates to `protoc/private/protoc_toolchains.bzl`. Previously, the `exec_compatible_with` attribute of the toolchain target contained `@platforms//cpu:x86_64` instead of `@platforms//cpu:aarch64`. This caused `@protobuf//bazel/private:proto_toolchain_type` to resolve to `@protobuf//bazel/private/toolchains:protoc_sources`, triggering recompilation. I also had to use `python.single_version_platform_override` and to fix `@bazel_tools//tools/jdk:proguard_whitelister` on Windows ARM64. This is because the latest `rules_python` 1.5.3 doesn't contain any entries for `aarch64-pc-windows-msvc` in `//python:versions.bzl`. However, it appears such entries are coming in the next `rules_python` release, which will eliminate the need for such a workaround. For that reason, I haven't tried to include it in this change. - https://github.com/bazelbuild/bazel/blob/7.6.1/tools/jdk/BUILD.tools#L133-L138 - https://github.com/bazel-contrib/rules_python/blob/1.5.3/python/versions.bzl - https://github.com/astral-sh/python-build-standalone/releases/ - https://rules-python.readthedocs.io/en/latest/api/rules_python/python/extensions/python.html#python.single_version_platform_override - bazel-contrib/rules_python#2276 - bazel-contrib/rules_python#3062 - bazel-contrib/rules_python#3074 - bazel-contrib/rules_python#3116 A couple of interesting new facts I learned about `protobuf` in the process of producing this change: - v32.0 officially drops support for Bazel 6: https://github.com/protocolbuffers/protobuf/releases/tag/v32.0 protocolbuffers/protobuf@da0077e - v34 isn't dropping MSVC support after all: https://protobuf.dev/news/2025-07-16/ protocolbuffers/protobuf#20085 protocolbuffers/protobuf#20085 (comment)
1 parent 3921c50 commit ab5b542

File tree

36 files changed

+209
-286
lines changed

36 files changed

+209
-286
lines changed

MODULE.bazel

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

33
module(
44
name = "rules_scala",
5-
version = "7.1.0",
5+
version = "7.1.1",
66
bazel_compatibility = [">=7.1.0"],
77
compatibility_level = 7,
88
)
@@ -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.15.0",
45+
version = "8.15.1",
4646
)
4747

4848
bazel_dep(name = "rules_proto", version = "6.0.0")
@@ -63,7 +63,7 @@ single_version_override(
6363
module_name = "protobuf",
6464
patch_strip = 1,
6565
patches = ["//protoc:0001-protobuf-19679-rm-protoc-dep.patch"],
66-
version = "31.1",
66+
version = "32.0",
6767
)
6868

6969
bazel_dep(name = "bazel_worker_java", version = "0.0.6")
@@ -267,7 +267,7 @@ go_sdk = use_extension(
267267
"go_sdk",
268268
dev_dependency = True,
269269
)
270-
go_sdk.download(version = "1.24.5")
270+
go_sdk.download(version = "1.25.0")
271271

272272
go_deps = use_extension(
273273
"@gazelle//:extensions.bzl",
@@ -289,8 +289,8 @@ go_deps = use_extension(
289289
# curl https://sum.golang.org/lookup/golang.org/x/[email protected]
290290
go_deps.module(
291291
path = "golang.org/x/tools",
292-
sum = "h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=",
293-
version = "v0.35.0",
292+
sum = "h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=",
293+
version = "v0.36.0",
294294
)
295295
go_deps.module(
296296
path = "github.com/golang/protobuf",
@@ -303,5 +303,5 @@ use_repo(
303303
"org_golang_x_tools",
304304
)
305305

306-
bazel_dep(name = "rules_python", version = "1.5.2", dev_dependency = True)
306+
bazel_dep(name = "rules_python", version = "1.5.3", dev_dependency = True)
307307
bazel_dep(name = "rules_shell", version = "0.5.1", dev_dependency = True)

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ load(
120120

121121
go_rules_dependencies()
122122

123-
go_register_toolchains(version = "1.24.5")
123+
go_register_toolchains(version = "1.25.0")
124124

125125
http_archive(
126126
name = "bazelci_rules",

deps/latest/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module(
88

99
bazel_dep(name = "bazel_skylib", version = "1.8.1")
1010
bazel_dep(name = "platforms", version = "1.0.0")
11-
bazel_dep(name = "protobuf", version = "31.1")
12-
bazel_dep(name = "rules_java", version = "8.15.0")
11+
bazel_dep(name = "protobuf", version = "32.0")
12+
bazel_dep(name = "rules_java", version = "8.15.1")
1313
bazel_dep(name = "rules_proto", version = "7.1.0")
1414

1515
# https://github.com/bazelbuild/bazel/pull/25681 removed

dt_patches/test_dt_patches/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ register_toolchains(
7575
# protocolbuffers/protobuf#19679.
7676
bazel_dep(
7777
name = "protobuf",
78-
version = "31.1",
78+
version = "32.0",
7979
repo_name = "com_google_protobuf",
8080
)
8181
single_version_override(
8282
module_name = "protobuf",
8383
patch_strip = 1,
8484
patches = ["//:protobuf.patch"],
85-
version = "31.1",
85+
version = "32.0",
8686
)

dt_patches/test_dt_patches_user_srcjar/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ register_toolchains(
191191
# protocolbuffers/protobuf#19679.
192192
bazel_dep(
193193
name = "protobuf",
194-
version = "31.1",
194+
version = "32.0",
195195
repo_name = "com_google_protobuf",
196196
)
197197
single_version_override(
198198
module_name = "protobuf",
199199
patch_strip = 1,
200200
patches = ["//:protobuf.patch"],
201-
version = "31.1",
201+
version = "32.0",
202202
)

examples/crossbuild/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ register_toolchains(
5555
# protocolbuffers/protobuf#19679.
5656
bazel_dep(
5757
name = "protobuf",
58-
version = "31.1",
58+
version = "32.0",
5959
repo_name = "com_google_protobuf",
6060
)
6161
single_version_override(
6262
module_name = "protobuf",
6363
patch_strip = 1,
6464
patches = ["//:protobuf.patch"],
65-
version = "31.1",
65+
version = "32.0",
6666
)

examples/crossbuild/protobuf.patch

Lines changed: 0 additions & 91 deletions
This file was deleted.

examples/crossbuild/protobuf.patch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../protoc/0001-protobuf-19679-rm-protoc-dep.patch

examples/overridden_artifacts/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ register_toolchains(
8080
# protocolbuffers/protobuf#19679.
8181
bazel_dep(
8282
name = "protobuf",
83-
version = "31.1",
83+
version = "32.0",
8484
repo_name = "com_google_protobuf",
8585
)
8686
single_version_override(
8787
module_name = "protobuf",
8888
patch_strip = 1,
8989
patches = ["//:protobuf.patch"],
90-
version = "31.1",
90+
version = "32.0",
9191
)

examples/scala3/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ register_toolchains(
3939
# protocolbuffers/protobuf#19679.
4040
bazel_dep(
4141
name = "protobuf",
42-
version = "31.1",
42+
version = "32.0",
4343
repo_name = "com_google_protobuf",
4444
)
4545
single_version_override(
4646
module_name = "protobuf",
4747
patch_strip = 1,
4848
patches = ["//:protobuf.patch"],
49-
version = "31.1",
49+
version = "32.0",
5050
)

0 commit comments

Comments
 (0)