Pass along the QueryExpressionContext from SkyQueryEnvironment#getRBuildFiles
to RBuildFilesVisitor#processPartialResults and back to
SkyQueryEnvironment#getBuildFileTargetsForPackageKeysAndProcessViaCallback.
Also improve a few comments.
RELNOTES: None
PiperOrigin-RevId: 214981215
diff --git a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
index 9bb1e30..3dca23f 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
@@ -1077,7 +1077,9 @@
}
protected void getBuildFileTargetsForPackageKeysAndProcessViaCallback(
- Iterable<SkyKey> packageKeys, Callback<Target> callback)
+ Iterable<SkyKey> packageKeys,
+ QueryExpressionContext<Target> context,
+ Callback<Target> callback)
throws QueryException, InterruptedException {
Set<PackageIdentifier> pkgIds =
Streams.stream(packageKeys)
@@ -1096,17 +1098,20 @@
}
/**
- * Calculates the set of packages that transitively depend on, via load statements, the specified
- * paths. The emitted {@link Target}s are BUILD file targets.
+ * Calculates the set of packages whose evaluation transitively depends on (e.g. via 'load'
+ * statements) the contents of the specified paths. The emitted {@link Target}s are BUILD file
+ * targets.
*/
@ThreadSafe
QueryTaskFuture<Void> getRBuildFiles(
- Collection<PathFragment> fileIdentifiers, Callback<Target> callback) {
+ Collection<PathFragment> fileIdentifiers,
+ QueryExpressionContext<Target> context,
+ Callback<Target> callback) {
return QueryTaskFutureImpl.ofDelegate(
safeSubmit(
() -> {
ParallelSkyQueryUtils.getRBuildFilesParallel(
- SkyQueryEnvironment.this, fileIdentifiers, callback);
+ SkyQueryEnvironment.this, fileIdentifiers, context, callback);
return null;
}));
}