aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
diff options
context:
space:
mode:
authorGravatar juliexxia <juliexxia@google.com>2018-03-09 16:59:52 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-09 17:02:03 -0800
commit6596f9c0ed34f3c0b51846eb0c3922bb8a4a001a (patch)
treeb7a786bd26c706754c395f8c1a87440fa47ceb4c /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
parent4ce4919d2dd6ce54bebbadce9a62dfab26fd5dc7 (diff)
Remove cycle error reporting from query results since they're not strictly relevant and only trigger when the implicit or explicit max depth > 20 which is confusing.
PiperOrigin-RevId: 188559702
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
index e8d25da219..c61c69ff9d 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitor.java
@@ -27,12 +27,13 @@ import com.google.devtools.build.skyframe.SkyKey;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
import javax.annotation.Nullable;
/**
* Skyframe-based transitive package loader.
*/
-final class SkyframeLabelVisitor implements TransitivePackageLoader {
+public final class SkyframeLabelVisitor implements TransitivePackageLoader {
private final SkyframeTransitivePackageLoader transitivePackageLoader;
private final AtomicReference<CyclesReporter> skyframeCyclesReporter;
@@ -43,7 +44,6 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader {
this.skyframeCyclesReporter = skyframeCyclesReporter;
}
- // The only remaining non-test caller of this code is BlazeQueryEnvironment.
@Override
public boolean sync(
ExtendedEventHandler eventHandler,
@@ -51,6 +51,17 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader {
boolean keepGoing,
int parallelThreads)
throws InterruptedException {
+ return sync(eventHandler, labelsToVisit, keepGoing, parallelThreads, true);
+ }
+
+ // The only remaining non-test caller of this code is BlazeQueryEnvironment.
+ public boolean sync(
+ ExtendedEventHandler eventHandler,
+ Set<Label> labelsToVisit,
+ boolean keepGoing,
+ int parallelThreads,
+ boolean errorOnCycles)
+ throws InterruptedException {
EvaluationResult<TransitiveTargetValue> result = transitivePackageLoader.loadTransitiveTargets(
eventHandler, labelsToVisit, keepGoing, parallelThreads);
@@ -59,6 +70,17 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader {
}
Set<Entry<SkyKey, ErrorInfo>> errors = result.errorMap().entrySet();
+ if (!errorOnCycles) {
+ errors =
+ errors
+ .stream()
+ .filter(error -> Iterables.isEmpty(error.getValue().getCycleInfo()))
+ .collect(Collectors.toSet());
+ if (errors.isEmpty()) {
+ return true;
+ }
+ }
+
if (!keepGoing) {
// We may have multiple errors, but in non keep_going builds, we're obligated to print only
// one of them.