aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java12
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java14
2 files changed, 17 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
index 307544f11e..a727decee6 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
@@ -1384,14 +1384,18 @@ public final class BlazeRuntime {
new Handler() {
@Override
public void publish(LogRecord record) {
- throw new IllegalStateException(
+ Throwable e = record.getThrown();
+ String message =
record.getSourceClassName()
+ "#"
+ record.getSourceMethodName()
+ ": "
- + record.getMessage()
- + "\n"
- + record.getThrown());
+ + record.getMessage();
+ if (e == null) {
+ throw new IllegalStateException(message);
+ } else {
+ throw new IllegalStateException(message, e);
+ }
}
@Override
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
index 4be1436aa3..df1f92a3be 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
@@ -276,10 +276,8 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver
ValueOrException2<NoSuchPackageException, InconsistentFilesystemException>> values =
env.getValuesOrThrow(depKeys.values(), NoSuchPackageException.class,
InconsistentFilesystemException.class);
- if (env.valuesMissing()) {
- // Some values are not computed yet.
- return null;
- }
+ // Check values even if some are missing so that we can throw an appropriate exception if
+ // needed.
Map<PathFragment, Root> result = new HashMap<>();
for (PathFragment path : execPaths) {
@@ -291,6 +289,10 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver
+ path, e);
}
+ if (value == null) {
+ Preconditions.checkState(env.valuesMissing(), path);
+ continue;
+ }
if (value.hasContainingPackage()) {
// We have found corresponding root for current execPath.
result.put(path, Root.asSourceRoot(value.getContainingPackageRoot()));
@@ -299,7 +301,9 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver
result.put(path, null);
}
}
- return result;
+
+ // If some values are missing, return null.
+ return env.valuesMissing() ? null : result;
}
}