Skip to content

incompatible_always_include_files_in_data #16654

Closed
@fmeum

Description

@fmeum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)incompatible-changeIncompatible/breaking changemigration-readyIncompatible flag is ready for migration with Bazel rolling releases or Bazel@last_greenteam-Rules-ServerIssues for serverside rules included with Bazeltype: buguntriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions