Bazel wants full dependency graph for incompatible targets - why aren't they just skipped? #14132
Labels
team-Configurability
platforms, toolchains, cquery, select(), config transitions
type: support / not a bug (process)
untriaged
Description of the problem / feature request:
Hi!
I have a target that is only compatible with the
aarch64
platform:Now, the
bar
dependency comes in two flavors, so I have an alias:Now, my problem is that when I build for
x86
using wildcard, Bazel complains that it cannot find anybar
for x86. And that's of course expected - there's nobar
or x86! However why is Bazel complaining here? I specified that this target is incompatible withx86
, so it shouldn't need to analyze it. Why is it doing that?If I remove the
bar
dependency, Bazel just skips the target and exits gracefully without errors.I could solve this problem adding a default condition for
bar
, but I don't want that. It will silence a useful warning. If I ever want to support a 3rdaarch64
version, the default condition will silence the warning without prompting me to add a 3rdaarch64
version ofbar
.I also don't want to add a
select
in thedeps
field of thecc_binary
either - it's redundant and adds noise. I already specify that the target is only compatible withaarch64
. I don't need to add thedeps
only foraarch64
.Is this expected? Is there any other way I could solve this problem?
Thanks!
Feature requests: what underlying problem are you trying to solve with this feature?
I want Bazel to ignore incompatible targets, without it trying to find its dependencies (which may not exist at all for an incompatible platform)
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
See above.
What operating system are you running Bazel on?
Ubuntu 18.04
What's the output of
bazel info release
?release 5.0.0-pre.20210907.1
Have you found anything relevant by searching the web?
Nothing on the web. Asked in bazel-discuss without answer.
The text was updated successfully, but these errors were encountered: