diff options
Diffstat (limited to 'src/main/java/com/google')
4 files changed, 9 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunner.java b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunner.java index 26b119386c..15e08b3df7 100644 --- a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunner.java +++ b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunner.java @@ -468,7 +468,7 @@ public class LoadingPhaseRunner { // packages/targets have been visited since the last sync/clear. boolean loadingSuccessful = pkgLoader.sync(eventHandler, targetsToLoad, labelsToLoad, keepGoing, loadingPhaseThreads, Integer.MAX_VALUE); - Set<Package> errorFreePackages = pkgLoader.getErrorFreeVisitedPackages(); + Set<Package> errorFreePackages = pkgLoader.getErrorFreeVisitedPackages(eventHandler); ImmutableSet<Target> targetsToAnalyze; if (loadingSuccessful) { diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/TransitivePackageLoader.java b/src/main/java/com/google/devtools/build/lib/pkgcache/TransitivePackageLoader.java index 96d3cd4024..d3c7ee0966 100644 --- a/src/main/java/com/google/devtools/build/lib/pkgcache/TransitivePackageLoader.java +++ b/src/main/java/com/google/devtools/build/lib/pkgcache/TransitivePackageLoader.java @@ -72,7 +72,7 @@ public interface TransitivePackageLoader { * * <p>Not thread-safe; do not call during visitation. */ - Set<Package> getErrorFreeVisitedPackages(); + Set<Package> getErrorFreeVisitedPackages(EventHandler eventHandler); /** * Return a mapping between the specified top-level targets and root causes. Note that targets in diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index 07272529d9..cbf864d840 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -279,7 +279,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { this.tsgm = tsgm; this.workspaceStatusActionFactory = workspaceStatusActionFactory; this.packageManager = new SkyframePackageManager( - new SkyframePackageLoader(), new SkyframeTransitivePackageLoader(reporter), + new SkyframePackageLoader(), new SkyframeTransitivePackageLoader(), new SkyframeTargetPatternEvaluator(this), syscalls, cyclesReporter, pkgLocator, numPackagesLoaded, this); this.errorEventListener = Preconditions.checkNotNull(reporter); @@ -1361,17 +1361,10 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { @VisibleForTesting public TransitivePackageLoader pkgLoader() { checkActive(); - return new SkyframeLabelVisitor( - new SkyframeTransitivePackageLoader(errorEventListener), cyclesReporter); + return new SkyframeLabelVisitor(new SkyframeTransitivePackageLoader(), cyclesReporter); } class SkyframeTransitivePackageLoader { - private final EventHandler eventHandler; - - SkyframeTransitivePackageLoader(EventHandler eventHandler) { - this.eventHandler = eventHandler; - } - /** * Loads the specified {@link TransitiveTargetValue}s. */ @@ -1390,7 +1383,8 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { eventHandler); } - public Set<Package> retrievePackages(Set<PackageIdentifier> packageIds) { + public Set<Package> retrievePackages( + final EventHandler eventHandler, Set<PackageIdentifier> packageIds) { final List<SkyKey> valueNames = new ArrayList<>(); for (PackageIdentifier pkgId : packageIds) { valueNames.add(PackageValue.key(pkgId)); 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 f325dc3ba3..1315fcf60d 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 @@ -56,7 +56,7 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader { private Set<PackageIdentifier> errorFreeVisitedPackages; private Set<Label> visitedTargets; private Set<TransitiveTargetValue> previousBuildTargetValueSet = null; - private boolean lastBuildKeepGoing = false; + private boolean lastBuildKeepGoing; private final Multimap<Label, Label> rootCauses = HashMultimap.create(); SkyframeLabelVisitor(SkyframeTransitivePackageLoader transitivePackageLoader, @@ -229,15 +229,14 @@ final class SkyframeLabelVisitor implements TransitivePackageLoader { previousBuildTargetValueSet = currentBuildTargetValueSet; } - @Override public Set<PackageIdentifier> getVisitedPackageNames() { return allVisitedPackages; } @Override - public Set<Package> getErrorFreeVisitedPackages() { - return transitivePackageLoader.retrievePackages(errorFreeVisitedPackages); + public Set<Package> getErrorFreeVisitedPackages(EventHandler eventHandler) { + return transitivePackageLoader.retrievePackages(eventHandler, errorFreeVisitedPackages); } /** |