Skip to content

Bazel downstream projects are broken due to out-dated rules_java version with Bazel@HEAD #18551

@meteorcloudy

Description

@meteorcloudy

Context

In #18373, we agreed on using rule sets as the source of truth to load toolchains and required dependencies for specific languages (e.g. rules_java, rules_cc). This reduces the duplicated information in Bazel's default @bazel_tools repo and fits our long term goal to make Bazel language-agnostic.

975866a implemented that for rules_java. Unfortunately, this is a breaking change because Bazel now relies on a compatible rules_java version to be defined.

  • When using Bzlmod, this is no problem, because the default bazel_tools module specify a new rules_java version, and thanks to minimal version resolution, we'll always get a compatible rules_java version.
  • When using WORKSPACE, Bazel append a WORKSPACE suffix which defines the compatible rules_java version, however, it could be overridden by user's WORKSPACE content.

Related:

Broken projects

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3066

Potential Solutions

  • Upgrade projects to use newer rules_java. There are too many projects to fix and this is probably not a one-time effort since rules_java is coupled with Bazel's builtin starlarkified java rules.
  • Rename the embedded rules_java in WORKSPACE suffix to rules_java_builtin.

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)breakageteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions