Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up ConfiguredTargetValueAccessor and ConfiguredTargetAccessor #12549

Closed
wants to merge 1 commit into from

Conversation

katre
Copy link
Member

@katre katre commented Nov 24, 2020

  • Fix looking up a target from the walkable graph.
    • This prevents ConfiguredTargetValueAccessor from needing to look into
      ConfiguredTargetAccessor.
    • And removes duplicated code.
  • Move CTVA into the correct package.

Part of #11993.

- Fix looking up a target from the walkable graph.
  - This prevents ConfiguredTargetValueAccessor from needing to look into
    ConfiguredTargetAccessor.
  - And removes duplicated code.
- Move CTVA into the correct package.

Part of bazelbuild#11993.
@@ -159,6 +161,11 @@ public final FilteringQueryFunction asFilteringFunction() {
public abstract int getExpressionToFilterIndex();
}

@FunctionalInterface
interface TargetLookup {
Target getTarget(Label label) throws TargetNotFoundException, InterruptedException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apologies I think I'm missing something - where does this actually get implemented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a functional interface, so in ActionGraphQueryEnvironment's constructor, the method reference ActionGraphQueryEnvironment::getTarget is used as a TargetLookup and passed into ConfiguredTargetValueAccessor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, and AGQE has an inherited getTarget method from PostAnalysisQE. Missed that bit. Thanks!

@bazel-io bazel-io closed this in 27e15ad Nov 25, 2020
@katre katre deleted the i11993-01-fix-ctva branch November 25, 2020 12:42
philwo pushed a commit that referenced this pull request Mar 15, 2021
- Fix looking up a target from the walkable graph.
  - This prevents ConfiguredTargetValueAccessor from needing to look into
    ConfiguredTargetAccessor.
  - And removes duplicated code.
- Move CTVA into the correct package.

Part of #11993.

Closes #12549.

PiperOrigin-RevId: 344151199
philwo pushed a commit that referenced this pull request Mar 15, 2021
- Fix looking up a target from the walkable graph.
  - This prevents ConfiguredTargetValueAccessor from needing to look into
    ConfiguredTargetAccessor.
  - And removes duplicated code.
- Move CTVA into the correct package.

Part of #11993.

Closes #12549.

PiperOrigin-RevId: 344151199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants