Skip to content

bazel query output order is wrong for rules with attr specifying aspects that depend on utility target #12320

@ghvg1313

Description

@ghvg1313

Description of the problem:

We've been using bazel query --output=proto --order_output=full approach to calculate the targethash for our repo. This has been working relatively well until we introduced a custom rule (target instance A) that:

  • has an attr that that supports aspect propagation (attr.label(aspect=...)))
  • The underlying aspect implementation relies on another target (B)

This forms dependency from A to B, and by invoking GetRuleInput on A seems to confirm that, but the output order is wrong despite --order_output=full is specified.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

I've forked the bazel example repo and made some small changes to simplify the case.
bazel query --output=proto --order_output=full "deps(//aspect:example_rule)" and check the output proto file to see the issue

What operating system are you running Bazel on?

macos 10.15.6

What's the output of bazel info release?

3.3.1

Have you found anything relevant by searching the web?

No

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)query bugsBugs related to "bazel (c)query"staleIssues or PRs that are stale (no activity for 30 days)team-PerformanceIssues for Performance teamstype: bugunder investigation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions