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/actions/PackageRootResolutionException.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/actions/PackageRootResolutionException.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/PackageRootResolutionException.java | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/PackageRootResolutionException.java b/src/main/java/com/google/devtools/build/lib/actions/PackageRootResolutionException.java deleted file mode 100644 index d93b7b9f33..0000000000 --- a/src/main/java/com/google/devtools/build/lib/actions/PackageRootResolutionException.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.actions; - -/** - * Exception signaling an error occurred determining package roots. See - * {@link PackageRootResolver#findPackageRootsForFiles(Iterable)} for further details. - */ -public class PackageRootResolutionException extends Exception { - - public PackageRootResolutionException(String msg, Throwable cause) { - super(msg, cause); - } -} |