Hi everyone,
Consider the following fictitious BUILD:
foo_binary(
name = "main",
...,
transitive_defines = ["bar"],
deps = [":lib"],
)
foo_library(
name = "lib",
...
)
Now assume foo_binary internally uses a transition to apply the transitive_defines to all its transitive dependencies. Assuming further that :lib requires "bar" to be defined in order to compile, in this situation `bazel build //:main` would pass but `bazel build //...` would fail.
In this particular case this is easily worked around by adding `tags = ["manual"]` to :lib, but that doesn't scale and also risks :lib breaking without being noticed if all targets that depend on it go away. Even if the build of :lib doesn't fail outright, having it built both through :main and in the top-level configuration increases build times, often without the user being aware of this duplication.
Is anyone else experiencing this issue? Do you have thoughts on how to deal with this issue properly?
Fabian