bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.31k stars 4.09k forks source link

cquery doesn't handle `attr` and `select` properly #20452

Open katre opened 12 months ago

katre commented 12 months ago

When doing cquery using the attr function, on an attribute with a select, all values of the select appear to be included, leading to confusing results.

See a small demo: https://github.com/katre/cquery-attr-demo

katre commented 12 months ago

cquery is probably re-using the select analysis code from query, when it should be using the actual implementation. I'm not familiar enough with PostAnalysisQueryEnvironment to say where to fix it, however.

katre commented 12 months ago

Okay, looks like the problem is in two places:

Next step would be to make sure this isn't on purpose.