Closed
Description
Rules shipped with Bazel (e.g. java_binary
and cc_binary
) will merge the files
in DefaultInfo
providers of data
dependencies in their runfiles, even if these files are not contained in DefaultInfo.default_runfiles
. This brings native rules in line with the recommended behavior for Starlark rules.
This behavior can be temporarily disabled via --noincompatible_always_include_files_in_data
. This flag was introduced in #15052.
Migration
Since this change can only add additional runfiles, in most cases no migration should be required.
- Tests that assert the presence of only a particular set of runfiles on native rules may need to be adapted.
- If a custom rule includes costly to build artifacts in its default outputs but not in runfiles, they will now be built if rule targets are added to data dependencies of native rules. This can be worked around by moving the outputs to a custom output group and adding a corresponding
--output_groups
line to.bazelrc
.