From 002250a99fee65354567898269dedca5cfe316e2 Mon Sep 17 00:00:00 2001 From: Eric Fellheimer Date: Wed, 22 Jun 2016 17:51:05 +0000 Subject: Add some logging when Packages are not found in GraphBackedRPP. -- MOS_MIGRATED_REVID=125582928 --- .../lib/skyframe/GraphBackedRecursivePackageProvider.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java b/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java index a306f4fe94..c65bc088b8 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java @@ -19,6 +19,7 @@ import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; @@ -51,6 +52,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.logging.Logger; /** * A {@link RecursivePackageProvider} backed by a {@link WalkableGraph}, used by {@code @@ -64,6 +66,9 @@ public final class GraphBackedRecursivePackageProvider implements RecursivePacka private final PathPackageLocator pkgPath; private final ImmutableList universeTargetPatternKeys; + private static final Logger LOGGER = Logger + .getLogger(GraphBackedRecursivePackageProvider.class.getName()); + public GraphBackedRecursivePackageProvider(WalkableGraph graph, ImmutableList universeTargetPatternKeys, PathPackageLocator pkgPath) { @@ -106,6 +111,9 @@ public final class GraphBackedRecursivePackageProvider implements RecursivePacka } SetView unknownKeys = Sets.difference(pkgKeys, packages.keySet()); + if (!Iterables.isEmpty(unknownKeys)) { + LOGGER.warning("Unable to find " + unknownKeys + " in the batch lookup of " + pkgKeys); + } for (Map.Entry missingOrExceptionEntry : graph.getMissingAndExceptions(unknownKeys).entrySet()) { PackageIdentifier pkgIdentifier = @@ -114,7 +122,7 @@ public final class GraphBackedRecursivePackageProvider implements RecursivePacka if (exception == null) { // If the package key does not exist in the graph, then it must not correspond to any // package, because the SkyQuery environment has already loaded the universe. - throw new BuildFileNotFoundException(pkgIdentifier, "BUILD file not found on package path"); + throw new BuildFileNotFoundException(pkgIdentifier, "Package not found"); } Throwables.propagateIfInstanceOf(exception, NoSuchPackageException.class); Throwables.propagate(exception); -- cgit v1.2.3