Skip to content

--incompatible_check_testonly_for_output_files #28875

@fmeum

Description

@fmeum

Motivation

Only test and testonly targets are exempted from the test trimming transition, which means that non-testonly targets with dependencies on tests can result in highly unexpected action conflicts. Flipping this flag fixes the remaining loophole that permits this.

Description

Targets that aren't tests but depend on test rule's output files now have to be marked testonly, just like any such target that directly depends on a test rule.

Incompatible Flag

--incompatible_check_testonly_for_output_files

Migration Guide

Add testonly = True or remove the dependency.

In which Bazel LTS version will this incompatible change be enabled?

Bazel 10

Additional Context

#28056

TODO List

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions