-
Notifications
You must be signed in to change notification settings - Fork 4.4k
incompatible_build_transitive_python_runfiles #16303
Description
To avoid performance issues with the upcoming Starlark implementation of the rules, the legacy behavior of py_binary targets that are only dependencies (not top-level requested targets) having their runfile symlinks materialized under bazel-bin is being disabled. This behavior has been undesirable since ~2017, but until now has been mostly harmless.
(More specifically, a performance issue (to the tune of 1% to 10% extra CPU usage) shows up because this behavior requires the Starlark rules to create an output that higher-level Starlark rule code also creates, which then causes the expensive "generate missing init.py files" logic to run multiple times as Bazel attempts to consolidate the actual actions to run).
Instead of relying on building one target to materialize files under bazel-bin for another target, users should explicitly specify the targets of interest. e.g., if you do this:
bazel build //foo
bazel-bin/bar
then you must switch to do this:
bazel build //foo //bar
bazel-bin/bar
(note to self: breaking changes policy)