diff options
author | ulfjack <ulfjack@google.com> | 2017-04-20 13:45:25 +0200 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2017-04-20 15:39:11 +0200 |
commit | 8989e19ab957a18f4937531dd55b5c30b207e6df (patch) | |
tree | aa9c24c56059ae4b33fb484b7499b68d16127eaa /src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java | |
parent | de48d7d8cf0fe3d87e348e74e10506d160495428 (diff) |
Rewrite repository lookup to return a failed value rather than throw
We need to lookup repositories as part of converting exec paths to artifacts,
which in turn is needed for action cache lookups. These lookups should not
cause a Skyframe exit, so we must not throw an exception here, unless the
error makes it impossible to continue. Instead, we need to leave the decision
whether to error out or not to the caller.
Note that we may unnecessarily fetch a remote repository in order to do the
action cache lookup, even if the action no longer depends on the input file,
although this should only be possible for C++ compile actions. It's possible
that there's another bug in the C++ compile action key computation that also
contributes.
This change also makes it so that the post-resolution action cache code
ignores any errors wrt. repository lookup rather than throwing. If any of the
paths could not be found, then the action cache lookup fails and we re-execute
the corresponding action, which is exactly what should happen.
Fixes #2759.
PiperOrigin-RevId: 153696243
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java b/src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java index 0a41135581..9a9eee3af8 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/SkyframePackageRootResolver.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.analysis; -import com.google.devtools.build.lib.actions.PackageRootResolutionException; import com.google.devtools.build.lib.actions.PackageRootResolver; import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.events.ExtendedEventHandler; @@ -39,14 +38,14 @@ public final class SkyframePackageRootResolver implements PackageRootResolver { @Override public Map<PathFragment, Root> findPackageRootsForFiles(Iterable<PathFragment> execPaths) - throws PackageRootResolutionException, InterruptedException { + throws InterruptedException { return executor.getArtifactRootsForFiles(eventHandler, execPaths); } @Override @Nullable public Map<PathFragment, Root> findPackageRoots(Iterable<PathFragment> execPaths) - throws PackageRootResolutionException, InterruptedException { + throws InterruptedException { return executor.getArtifactRoots(eventHandler, execPaths); } } |