diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/pkgcache')
3 files changed, 5 insertions, 39 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/LegacyLoadingPhaseRunner.java b/src/main/java/com/google/devtools/build/lib/pkgcache/LegacyLoadingPhaseRunner.java index 6d68c47778..09698e6176 100644 --- a/src/main/java/com/google/devtools/build/lib/pkgcache/LegacyLoadingPhaseRunner.java +++ b/src/main/java/com/google/devtools/build/lib/pkgcache/LegacyLoadingPhaseRunner.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.pkgcache; import com.google.common.base.Stopwatch; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.ListMultimap; @@ -30,13 +29,11 @@ import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.packages.NoSuchThingException; import com.google.devtools.build.lib.packages.NonconfigurableAttributeMapper; -import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.TestTargetUtils; import com.google.devtools.build.lib.syntax.Type; import com.google.devtools.build.lib.util.Preconditions; -import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.Collection; @@ -229,7 +226,7 @@ public final class LegacyLoadingPhaseRunner extends LoadingPhaseRunner { postLoadingLogging(eventBus, targetsToLoad, expandedResult.getTargets(), timer); return new LoadingResult(targets.hasError(), expandedResult.hasError(), - expandedResult.getTargets(), testsToRun, ImmutableMap.<PackageIdentifier, Path>of()); + expandedResult.getTargets(), testsToRun); } /** @@ -259,7 +256,7 @@ public final class LegacyLoadingPhaseRunner extends LoadingPhaseRunner { postLoadingLogging(eventBus, baseResult.getTargets(), expandedResult.getTargets(), timer); LoadingResult loadingResult = new LoadingResult(targets.hasError(), !baseResult.isSuccesful() || expandedResult.hasError(), - expandedResult.getTargets(), testsToRun, baseResult.roots); + expandedResult.getTargets(), testsToRun); return loadingResult; } @@ -293,7 +290,6 @@ public final class LegacyLoadingPhaseRunner extends 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(eventHandler); ImmutableSet<Target> targetsToAnalyze; if (loadingSuccessful) { @@ -307,9 +303,7 @@ public final class LegacyLoadingPhaseRunner extends LoadingPhaseRunner { } else { throw new LoadingFailedException("Loading failed; build aborted"); } - return new BaseLoadingResult( - targetsToAnalyze, loadingSuccessful, - LoadingPhaseRunner.collectPackageRoots(errorFreePackages)); + return new BaseLoadingResult(targetsToAnalyze, loadingSuccessful); } private void reportAboutPartiallySuccesfulLoading(ImmutableSet<Target> requestedTargets, @@ -340,13 +334,10 @@ public final class LegacyLoadingPhaseRunner extends LoadingPhaseRunner { private static class BaseLoadingResult { private final ImmutableSet<Target> targets; private final boolean succesful; - private final ImmutableMap<PackageIdentifier, Path> roots; - BaseLoadingResult(ImmutableSet<Target> targets, boolean succesful, - ImmutableMap<PackageIdentifier, Path> roots) { + BaseLoadingResult(ImmutableSet<Target> targets, boolean succesful) { this.targets = targets; this.succesful = succesful; - this.roots = roots; } ImmutableSet<Target> getTargets() { diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingResult.java b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingResult.java index 80c6fbe4f1..94f597649e 100644 --- a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingResult.java +++ b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadingResult.java @@ -13,11 +13,8 @@ // limitations under the License. package com.google.devtools.build.lib.pkgcache; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.packages.Target; -import com.google.devtools.build.lib.vfs.Path; import java.util.Collection; @@ -30,17 +27,14 @@ public final class LoadingResult { private final boolean hasLoadingError; private final ImmutableSet<Target> targetsToAnalyze; private final ImmutableSet<Target> testsToRun; - private final ImmutableMap<PackageIdentifier, Path> packageRoots; public LoadingResult(boolean hasTargetPatternError, boolean hasLoadingError, - Collection<Target> targetsToAnalyze, Collection<Target> testsToRun, - ImmutableMap<PackageIdentifier, Path> packageRoots) { + Collection<Target> targetsToAnalyze, Collection<Target> testsToRun) { this.hasTargetPatternError = hasTargetPatternError; this.hasLoadingError = hasLoadingError; this.targetsToAnalyze = targetsToAnalyze == null ? null : ImmutableSet.copyOf(targetsToAnalyze); this.testsToRun = testsToRun == null ? null : ImmutableSet.copyOf(testsToRun); - this.packageRoots = packageRoots; } /** Whether there were errors during target pattern evaluation. */ @@ -62,12 +56,4 @@ public final class LoadingResult { public Collection<Target> getTestsToRun() { return testsToRun; } - - /** - * The map from package names to the package root where each package was found; this is used to - * set up the symlink tree. - */ - public ImmutableMap<PackageIdentifier, Path> getPackageRoots() { - return packageRoots; - } }
\ No newline at end of file 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 65582247d1..45c7c931b1 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 @@ -17,7 +17,6 @@ import com.google.common.collect.Multimap; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.events.EventHandler; -import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.Target; import java.util.Set; @@ -55,16 +54,6 @@ public interface TransitivePackageLoader { Set<PackageIdentifier> getVisitedPackageNames(); /** - * Returns a read-only view of the set of the actual packages visited without error since this - * visitor was constructed. - * - * <p>Use {@link #getVisitedPackageNames()} instead when possible. - * - * <p>Not thread-safe; do not call during visitation. - */ - Set<Package> getErrorFreeVisitedPackages(EventHandler eventHandler); - - /** * Return a mapping between the specified top-level targets and root causes. Note that targets in * the input that are transitively error free will not be in the output map. "Top-level" targets * are the targetsToVisit and labelsToVisit specified in the last sync. |