aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
diff options
context:
space:
mode:
authorGravatar Nathan Harmata <nharmata@google.com>2016-10-14 22:38:17 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-10-17 11:19:17 +0000
commitb776d6c12e952eb358c1a036cc9d93d8944c4c77 (patch)
tree0f0381870fddf2bae3d63e48af61c1e69592b6e0 /src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
parent29cc0d9c54ec8d4b80d63824783ba3da2abed1a6 (diff)
*** Reason for rollback *** [] *** Original change description *** Slight refactor of ExternalFilesHelper: -Make FileType and ExternalFileAction public. -Have producers use ExternalFileAction, rather than a boolean, to specify the desired behavior. And a big change in semantics (doesn't affect Bazel): -Replace ExternalFileAction.ERROR_OUT with ExternalFileAction.ASSUME_NON_EXISTENT_AND_IMMUTABLE, which does what it sounds like. This new action, like the old ERROR_OUT, is _not_ used in Bazel. -- MOS_MIGRATED_REVID=136206810
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
index 4573a511e9..9db19e5b4e 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
@@ -221,7 +221,8 @@ public class PackageFunction implements SkyFunction {
Iterable<SkyKey> depKeys,
Environment env,
boolean packageWasInError)
- throws InternalInconsistentFilesystemException, InterruptedException {
+ throws InternalInconsistentFilesystemException, FileOutsidePackageRootsException,
+ SymlinkOutsidePackageRootsException, InterruptedException {
Preconditions.checkState(
Iterables.all(depKeys, SkyFunctions.isSkyFunction(SkyFunctions.FILE)), depKeys);
boolean packageShouldBeInError = packageWasInError;
@@ -230,6 +231,8 @@ public class PackageFunction implements SkyFunction {
FileSymlinkException.class, InconsistentFilesystemException.class).entrySet()) {
try {
entry.getValue().get();
+ } catch (FileOutsidePackageRootsException | SymlinkOutsidePackageRootsException e) {
+ throw e;
} catch (IOException e) {
maybeThrowFilesystemInconsistency(packageIdentifier, e, packageWasInError);
} catch (FileSymlinkException e) {
@@ -251,7 +254,8 @@ public class PackageFunction implements SkyFunction {
Iterable<SkyKey> depKeys,
Environment env,
boolean packageWasInError)
- throws InternalInconsistentFilesystemException, InterruptedException {
+ throws InternalInconsistentFilesystemException, FileOutsidePackageRootsException,
+ SymlinkOutsidePackageRootsException, InterruptedException {
Preconditions.checkState(
Iterables.all(depKeys, SkyFunctions.isSkyFunction(SkyFunctions.GLOB)), depKeys);
boolean packageShouldBeInError = packageWasInError;
@@ -261,6 +265,8 @@ public class PackageFunction implements SkyFunction {
FileSymlinkException.class, InconsistentFilesystemException.class).entrySet()) {
try {
entry.getValue().get();
+ } catch (FileOutsidePackageRootsException | SymlinkOutsidePackageRootsException e) {
+ throw e;
} catch (IOException | BuildFileNotFoundException e) {
maybeThrowFilesystemInconsistency(packageIdentifier, e, packageWasInError);
} catch (FileSymlinkException e) {
@@ -288,7 +294,8 @@ public class PackageFunction implements SkyFunction {
Map<Label, Path> subincludes,
PackageIdentifier packageIdentifier,
boolean containsErrors)
- throws InternalInconsistentFilesystemException, InterruptedException {
+ throws InternalInconsistentFilesystemException, FileOutsidePackageRootsException,
+ SymlinkOutsidePackageRootsException, InterruptedException {
boolean packageShouldBeInError = containsErrors;
// TODO(bazel-team): This means that many packages will have to be preprocessed twice. Ouch!
@@ -543,6 +550,11 @@ public class PackageFunction implements SkyFunction {
throw new PackageFunctionException(
e.toNoSuchPackageException(),
e.isTransient() ? Transience.TRANSIENT : Transience.PERSISTENT);
+ } catch (FileOutsidePackageRootsException | SymlinkOutsidePackageRootsException e) {
+ packageFunctionCache.invalidate(packageId);
+ throw new PackageFunctionException(
+ new NoSuchPackageException(packageId, "Encountered file outside package roots", e),
+ Transience.PERSISTENT);
}
if (env.valuesMissing()) {
return null;