diff options
author | 2016-08-15 21:54:55 +0000 | |
---|---|---|
committer | 2016-08-16 15:21:17 +0000 | |
commit | 3c0adb26bac6d756fb97e4bcc6d4e5b2cefa5eeb (patch) | |
tree | c77f6438711f4b23d6c528907a81e23dc9e6dc91 /src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java | |
parent | 89125d5ee83f562c309a792a7c56ce24452e61ea (diff) |
Allow Skyframe graph lookups and value retrievals to throw InterruptedException.
The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer.
--
MOS_MIGRATED_REVID=130327770
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java index 638f2eee8d..6e425e8dd7 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java @@ -47,7 +47,8 @@ public class PackageLookupFunction implements SkyFunction { } @Override - public SkyValue compute(SkyKey skyKey, Environment env) throws PackageLookupFunctionException { + public SkyValue compute(SkyKey skyKey, Environment env) + throws PackageLookupFunctionException, InterruptedException { PathPackageLocator pkgLocator = PrecomputedValue.PATH_PACKAGE_LOCATOR.get(env); PackageIdentifier packageKey = (PackageIdentifier) skyKey.argument(); if (PackageFunction.isDefaultsPackage(packageKey)) { @@ -94,9 +95,9 @@ public class PackageLookupFunction implements SkyFunction { } @Nullable - private FileValue getFileValue( + private static FileValue getFileValue( RootedPath fileRootedPath, Environment env, PackageIdentifier packageIdentifier) - throws PackageLookupFunctionException { + throws PackageLookupFunctionException, InterruptedException { String basename = fileRootedPath.asPath().getBaseName(); SkyKey fileSkyKey = FileValue.key(fileRootedPath); FileValue fileValue = null; @@ -122,12 +123,12 @@ public class PackageLookupFunction implements SkyFunction { return fileValue; } - private PackageLookupValue getPackageLookupValue( + private static PackageLookupValue getPackageLookupValue( Environment env, ImmutableList<Path> packagePathEntries, PackageIdentifier packageIdentifier, BuildFileName buildFileName) - throws PackageLookupFunctionException { + throws PackageLookupFunctionException, InterruptedException { // TODO(bazel-team): The following is O(n^2) on the number of elements on the package path due // to having restart the SkyFunction after every new dependency. However, if we try to batch // the missing value keys, more dependencies than necessary will be declared. This wart can be @@ -147,9 +148,9 @@ public class PackageLookupFunction implements SkyFunction { return PackageLookupValue.NO_BUILD_FILE_VALUE; } - private PackageLookupValue computeWorkspacePackageLookupValue( + private static PackageLookupValue computeWorkspacePackageLookupValue( Environment env, ImmutableList<Path> packagePathEntries) - throws PackageLookupFunctionException { + throws PackageLookupFunctionException, InterruptedException { PackageLookupValue result = getPackageLookupValue( env, packagePathEntries, Label.EXTERNAL_PACKAGE_IDENTIFIER, BuildFileName.WORKSPACE); @@ -182,11 +183,11 @@ public class PackageLookupFunction implements SkyFunction { * Gets a PackageLookupValue from a different Bazel repository. * * <p>To do this, it looks up the "external" package and finds a path mapping for the repository - * name.</p> + * name. */ - private PackageLookupValue computeExternalPackageLookupValue( + private static PackageLookupValue computeExternalPackageLookupValue( SkyKey skyKey, Environment env, PackageIdentifier packageIdentifier) - throws PackageLookupFunctionException { + throws PackageLookupFunctionException, InterruptedException { PackageIdentifier id = (PackageIdentifier) skyKey.argument(); SkyKey repositoryKey = RepositoryValue.key(id.getRepository()); RepositoryValue repositoryValue; |