Skip to content

Bazel 8.0.0 compatibility #1652

Closed
Closed
@gergelyfabian

Description

@gergelyfabian

When testing Bazel 8.0.0 RC versions I discovered rules_scala may be incompatible with the latest rules_java (that you in turn my need for Bazel 8.0.0).

This came out when testing a Bazel bug's solution: bazelbuild/bazel#24235.

After upgrading rules_java to 8.5.0+ rules_scala reported errors:

# Using https://github.com/gergelyfabian/bazel-scala-example/tree/bazel-8.0.0rc1
$ USE_BAZEL_VERSION=8.0.0rc3 bazel build //...
INFO: Invocation ID: b8abf68e-49c2-48ee-a5e4-f0d8710f759d
ERROR: Traceback (most recent call last):
	File "/home/user/.cache/bazel/_bazel_user/64527517dacf7170f7d914889f83481c/external/io_bazel_rules_scala/scala/private/rules/scala_doc.bzl", line 52, column 37, in <toplevel>
		_scaladoc_transitive_aspect = aspect(
Error in aspect: Illegal argument: element in 'required_aspect_providers' is of unexpected type. Either all elements should be providers, or all elements should be lists of providers, but got list with an element of type NoneType.
ERROR: Error computing the main repository mapping: at /home/user/.cache/bazel/_bazel_user/64527517dacf7170f7d914889f83481c/external/io_bazel_rules_scala/scala/scala.bzl:20:5: initialization of module 'scala/private/rules/scala_doc.bzl' failed

# Or another one:

$ USE_BAZEL_VERSION=8.0.0rc3 bazel build //...
INFO: Invocation ID: 117a90d7-da17-400c-9f83-908c7ddd7317
WARNING: WORKSPACE support will be removed in Bazel 9 (late 2025), please migrate to Bzlmod, see https://bazel.build/external/migration.
ERROR: Traceback (most recent call last):
	File "/home/user/.cache/bazel/_bazel_user/64527517dacf7170f7d914889f83481c/external/io_bazel_rules_scala/scala/private/common_attributes.bzl", line 18, column 28, in <toplevel>
		"deps": attr.label_list(
Error in label_list: Illegal argument: element in 'providers' is of unexpected type. Either all elements should be providers, or all elements should be lists of providers, but got list with an element of type NoneType.
ERROR: Error computing the main repository mapping: at /home/user/.cache/bazel/_bazel_user/64527517dacf7170f7d914889f83481c/external/io_bazel_rules_scala/scala/scala.bzl:37:5: at /home/user/.cache/bazel/_bazel_user/64527517dacf7170f7d914889f83481c/external/io_bazel_rules_scala/scala/private/rules/scala_repl.bzl:5:5: initialization of module 'scala/private/common_attributes.bzl' failed

Please note, that rules_cc version is also too "old" for Bazel 8.0.0, so I upgraded it on my branch too explicitly. It may need to be updated in rules_scala.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions