Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cquery --output=proto: include more dependencies in `configured_rule_…
…input` This is an iteration of bazelbuild/bazel#15038. That PR added the concept of `configured_rule_input`, where `--output=proto` rules include both the labels and configurations of their dependencies. That used `CqueryTransitionResolver` to find the dependencies. `CqueryTransitionResolver` does this by directly querying the Skyframe graph. However, cquery's view of the graph doesn't directly match the Skyframe graph. For example, cquery doesn't explicitly list aspects: if CT `//foo` depends on aspect A which has an implicit dep on CT `//bar`, the Skyframe graph shows `//foo -> A -> //bar`. Since cquery can't directly show `A` (see [More accurate cquery](https://docs.google.com/document/d/1x-RqFFEcGIzVgtYHIq6s6Qt4vYtJWz3nuHIuqeI89dU/edit#heading=h.5mcn15i0e1ch)), cquery instead shows `//foo -> //bar`. For any cquery use we want to use cquery's interpretation of the graph as a consistent source of truth. This change refactors `--output=proto` to do that. This means, for example, that `cquery --output=proto` will now have `configured_rule_input` entries for deps like `//bar`. Before this change there's no way to tell where the dependency on `//bar` comes from. Also correctly includes aliases (doesn't dereference them as either outputs or `configured_rule_input` entries of other outputs). Also updates the API contract for `configured_rule_input`. Before, "same configuration" deps had their configuration fields omitted. Now they're always included, except for source files which have no configuration. PiperOrigin-RevId: 621245620
- Loading branch information