Incompatible change: java_output.source_jars
will return a Depset instead of a list
#18966
Labels
incompatible-change
Incompatible/breaking change
P2
We'll consider working on this in future. (Assignee optional)
team-Rules-Java
Issues for Java rules
The type returned by the
source_jars
field ofJavaInfo.java_outputs
is being changed from a list to aDepset
. This is required to efficiently de-duplicatejava_output
provider instances in Starlark, since having alist
field makes a provider mutable/non-hashable. Not de-duplicating would run into #17170Migration
If there is a need to support old and new Bazel versions, one can update usages from:
to
Alternatively, for a more ergonomic solution, the appropriate check could be added to https://github.com/bazel-contrib/bazel_features
To temporarily preserve the old behavior, one can use the build flag
--incompatible_depset_for_java_output_source_jars=false
. Note this flag will become a no-op after the next Bazel LTS release (7.0).The text was updated successfully, but these errors were encountered: