From e72d5222d47ad7b7857f4a3f4eaa6225f6cc8433 Mon Sep 17 00:00:00 2001 From: Janak Ramakrishnan Date: Thu, 26 Feb 2015 17:09:18 +0000 Subject: Add a SkyQueryEnvironment which runs queries by examining the Skyframe graph. This environment eagerly preloads the transitive closure of a specified query "universe", and so may not be as efficient as the standard query for limited-scope queries. It is activated when the universe is specified and ordered results are not requested (since it is currently unable to order results). Tests were modified/added to exercise this environment where deemed interesting. Some ugly hacks were done to add coverage in AbstractQueryTest and friends, because currently even if the full depot is loaded (using //...), individual target patterns most likely won't be present in the graph. A better way to deal with this situation, suggested by felly, is probably to extract target pattern resolution logic to an auxiliary function so that query is able to resolve target patterns without mutating the graph, and then call into the read-only graph with the resolved patterns. That may be done in a follow-up, in which case the "scope" of every query could be //... . -- MOS_MIGRATED_REVID=87257028 --- .../google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java') diff --git a/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java index 827cc7b4e7..695d025613 100644 --- a/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java +++ b/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java @@ -158,7 +158,11 @@ public final class InMemoryMemoizingEvaluator implements MemoizingEvaluator { ParallelEvaluator evaluator = new ParallelEvaluator(graph, intVersion, skyFunctions, eventHandler, emittedEventState, keepGoing, numThreads, progressReceiver, dirtyKeyTracker); - return evaluator.eval(roots); + EvaluationResult result = evaluator.eval(roots); + return EvaluationResult.builder() + .mergeFrom(result) + .setWalkableGraph(new DelegatingWalkableGraph(graph)) + .build(); } finally { lastGraphVersion = intVersion; setAndCheckEvaluateState(false, roots); -- cgit v1.2.3