aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/pkgcache/LoadedPackageProvider.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunner.java9
2 files changed, 4 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadedPackageProvider.java b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadedPackageProvider.java
index fb03ddd189..8691ade149 100644
--- a/src/main/java/com/google/devtools/build/lib/pkgcache/LoadedPackageProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/pkgcache/LoadedPackageProvider.java
@@ -31,14 +31,16 @@ public interface LoadedPackageProvider {
/**
* Returns a package if it was recently loaded, i.e., since the most recent cache sync. This
- * throws an exception if the package was not loaded, even if it exists on disk.
+ * throws an exception if the package was not loaded, even if it exists on disk. Returns the
+ * package even if it is in error.
*/
Package getLoadedPackage(PackageIdentifier packageIdentifier) throws NoSuchPackageException;
/**
* Returns a target if it was recently loaded, i.e., since the most recent cache sync. This
* throws an exception if the target was not loaded or not validated, even if it exists in the
- * surrounding package.
+ * surrounding package. If the surrounding package is in error, still attempts to retrieve the
+ * target.
*/
Target getLoadedTarget(Label label) throws NoSuchPackageException, NoSuchTargetException;
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 77227c646b..97f336f09d 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
@@ -28,8 +28,6 @@ import com.google.devtools.build.lib.cmdline.TargetParsingException;
import com.google.devtools.build.lib.events.DelegatingEventHandler;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.events.EventHandler;
-import com.google.devtools.build.lib.packages.NoSuchPackageException;
-import com.google.devtools.build.lib.packages.NoSuchTargetException;
import com.google.devtools.build.lib.packages.NoSuchThingException;
import com.google.devtools.build.lib.packages.NonconfigurableAttributeMapper;
import com.google.devtools.build.lib.packages.Package;
@@ -509,13 +507,6 @@ public class LoadingPhaseRunner {
for (Label label : labels) {
try {
result.add(packageManager.getLoadedTarget(label));
- } catch (NoSuchPackageException e) {
- Package pkg = Preconditions.checkNotNull(e.getPackage());
- try {
- result.add(pkg.getTarget(label.getName()));
- } catch (NoSuchTargetException ex) {
- throw new IllegalStateException(ex);
- }
} catch (NoSuchThingException e) {
throw new IllegalStateException(e); // The target should have been loaded
}