-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Closed
Copy link
Labels
P2We'll consider working on this in future. (Assignee optional)We'll consider working on this in future. (Assignee optional)breaking-change-7.0Incompatible flags to be flipped in Bazel 7.0Incompatible flags to be flipped in Bazel 7.0incompatible-changeIncompatible/breaking changeIncompatible/breaking changeteam-Rules-JavaIssues for Java rulesIssues for Java rulestype: support / not a bug (process)
Description
Rules which use java_common need to register @bazel_tools//tools/jdk:toolchain_type.
This is a breaking change for rules which are using java_common and not registering @bazel_tools//tools/jdk:toolchain_type.
The error you might see if you're affected by this change is:
Rule 'custom_rule' in 'location' must declare '@bazel_tools//tools/jdk:toolchain_type' toolchain in order to use java_common.
How to fix this error?
Just register @bazel_tools//tools/jdk:toolchain_type inside rule's toolchains in the rule's definition:
custom_rule = rule(
impl = _impl,
...,
toolchains = ['@bazel_tools//tools/jdk:toolchain_type']
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2We'll consider working on this in future. (Assignee optional)We'll consider working on this in future. (Assignee optional)breaking-change-7.0Incompatible flags to be flipped in Bazel 7.0Incompatible flags to be flipped in Bazel 7.0incompatible-changeIncompatible/breaking changeIncompatible/breaking changeteam-Rules-JavaIssues for Java rulesIssues for Java rulestype: support / not a bug (process)