You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump dependency versions for rules_scala v7.1.0 (#1755)
* 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 #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.
* Fix test_compiler_sources_integrity.sh on non-Mac
The unescaped `{` in the expected failure message caused
`test_fail_if_compiler_srcjar_object_is_empty` to fail on Linux and
Windows. Rather than escape it, it works just as well to remove it
entirely.
See also the "Escape '{', '}' in `test/shell/test_bzlmod_macros`"
message from #1722 and commit 3f37e26.
* Add job to test with Bazel 9.0.0-pre.20250710.1
This is temporary until a fix lands for bazelbuild/bazel#26579, but will
ensure that new changes get some degree of prerelease testing.
- "./test_rules_scala.sh || buildkite-agent annotate --style 'warning' \"Optional build with last_green Bazel version failed, [see here](${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}) (It is not mandatory but worth checking)\""
40
+
# Remove this job once the last_green job passes after a fix lands for
41
+
# bazelbuild/bazel#26579.
42
+
test_rules_scala_linux_9_prerelease:
43
+
name: "./test_rules_scala (Bazel 9 rolling prerelease)"
0 commit comments