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 4d7c103fdbb753..fe93375460ca1a 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 @@ -260,7 +260,8 @@ protected EvaluationContext newEvaluationContext() { .build(); } - protected void beforeEvaluateQuery(QueryExpression expr) + protected void beforeEvaluateQuery( + QueryExpression expr, ThreadSafeOutputFormatterCallback callback) throws QueryException, InterruptedException { UniverseSkyKey universeKey = universeScope.getUniverseKey(expr, parserPrefix); ImmutableList universeScopeListToUse = universeKey.getPatterns(); @@ -295,10 +296,11 @@ protected void beforeEvaluateQuery(QueryExpression expr) /* workQueue= */ new BlockingStack<>(), new ThreadFactoryBuilder().setNameFormat("QueryEnvironment %d").build())); } - resolver = makeNewTargetPatternResolver(); + resolver = makeNewTargetPatternResolver(expr, callback); } - protected TargetPatternResolver makeNewTargetPatternResolver() { + protected TargetPatternResolver makeNewTargetPatternResolver( + QueryExpression expr, ThreadSafeOutputFormatterCallback callback) { return new RecursivePackageProviderBackedTargetPatternResolver( graphBackedRecursivePackageProvider, eventHandler, @@ -458,7 +460,7 @@ protected void handleInterruptedShutdown() {} public QueryEvalResult evaluateQuery( QueryExpression expr, ThreadSafeOutputFormatterCallback callback) throws QueryException, InterruptedException, IOException { - beforeEvaluateQuery(expr); + beforeEvaluateQuery(expr, callback); // SkyQueryEnvironment batches callback invocations using a BatchStreamedCallback, created here // so that there's one per top-level evaluateQuery call. The batch size is large enough that diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageErrorMessageValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageErrorMessageValue.java index fa545974dd1299..54c68a635525b2 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageErrorMessageValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageErrorMessageValue.java @@ -56,7 +56,7 @@ public enum Result { * If {@code getResult().equals(NO_SUCH_PACKAGE_EXCEPTION)}, returns the error message from the * {@link com.google.devtools.build.lib.packages.NoSuchPackageException} encountered. */ - abstract String getNoSuchPackageExceptionMessage(); + public abstract String getNoSuchPackageExceptionMessage(); static PackageErrorMessageValue ofPackageWithNoErrors() { return NO_ERROR_VALUE; @@ -109,7 +109,7 @@ public Result getResult() { } @Override - String getNoSuchPackageExceptionMessage() { + public String getNoSuchPackageExceptionMessage() { throw new IllegalStateException(); } }; @@ -123,7 +123,7 @@ public Result getResult() { } @Override - String getNoSuchPackageExceptionMessage() { + public String getNoSuchPackageExceptionMessage() { throw new IllegalStateException(); } }; @@ -141,7 +141,7 @@ public Result getResult() { } @Override - String getNoSuchPackageExceptionMessage() { + public String getNoSuchPackageExceptionMessage() { return errorMessage; }