use of com.google.devtools.build.lib.skyframe.RecursivePackageProviderBackedTargetPatternResolver in project bazel by bazelbuild.
the class SkyQueryEnvironment method beforeEvaluateQuery.
private void beforeEvaluateQuery() throws InterruptedException {
if (graph == null || !graphFactory.isUpToDate(universeKey)) {
// If this environment is uninitialized or the graph factory needs to evaluate, do so. We
// assume here that this environment cannot be initialized-but-stale if the factory is up
// to date.
EvaluationResult<SkyValue> result;
try (AutoProfiler p = AutoProfiler.logged("evaluation and walkable graph", LOG)) {
result = graphFactory.prepareAndGet(universeKey, loadingPhaseThreads, universeEvalEventHandler);
}
checkEvaluationResult(result);
packageSemaphore = makeFreshPackageMultisetSemaphore();
graph = result.getWalkableGraph();
blacklistPatternsSupplier = InterruptibleSupplier.Memoize.of(new BlacklistSupplier(graph));
graphBackedRecursivePackageProvider = new GraphBackedRecursivePackageProvider(graph, universeTargetPatternKeys, pkgPath);
}
if (executor == null) {
executor = MoreExecutors.listeningDecorator(new ThreadPoolExecutor(/*corePoolSize=*/
queryEvaluationParallelismLevel, /*maximumPoolSize=*/
queryEvaluationParallelismLevel, /*keepAliveTime=*/
1, /*units=*/
TimeUnit.SECONDS, /*workQueue=*/
new BlockingStack<Runnable>(), new ThreadFactoryBuilder().setNameFormat("QueryEnvironment %d").build()));
}
resolver = new RecursivePackageProviderBackedTargetPatternResolver(graphBackedRecursivePackageProvider, eventHandler, TargetPatternEvaluator.DEFAULT_FILTERING_POLICY, packageSemaphore);
}
Aggregations