diff options
author | felly <felly@google.com> | 2018-08-09 14:28:14 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-09 14:29:50 -0700 |
commit | 39974a43abdd32e3a1acbc7da945b08da9983e4e (patch) | |
tree | 34ddeab6c7bbe9d129f7c0dbe2c456c6cadab881 /src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java | |
parent | 943a9c792032c75b25a1665e7143409fe3950041 (diff) |
Allow skyframe-aware actions to pass partial results through ActionExecutionContext.
Remove FilesetProvider.
PiperOrigin-RevId: 208111251
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java | 17 |
1 files changed, 11 insertions, 6 deletions
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 7bff8b0193..0905cf1bef 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 @@ -187,8 +187,9 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver return null; } + Object skyframeDepsResult; try { - establishSkyframeDependencies(env, action); + skyframeDepsResult = establishSkyframeDependencies(env, action); } catch (ActionExecutionException e) { throw new ActionExecutionFunctionException(e); } @@ -213,7 +214,8 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver try { result = checkCacheAndExecuteIfNeeded( - action, state, env, clientEnv, actionLookupData, sharedActionAlreadyRan); + action, state, env, clientEnv, actionLookupData, sharedActionAlreadyRan, + skyframeDepsResult); } catch (ActionExecutionException e) { // Remove action from state map in case it's there (won't be unless it discovers inputs). stateMap.remove(action); @@ -363,7 +365,8 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver Environment env, Map<String, String> clientEnv, ActionLookupData actionLookupData, - boolean sharedActionAlreadyRan) + boolean sharedActionAlreadyRan, + Object skyframeDepsResult) throws ActionExecutionException, InterruptedException { // If this is a shared action and the other action is the one that executed, we must use that // other action's value, provided here, since it is populated with metadata for the outputs. @@ -496,7 +499,8 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver metadataHandler, Collections.unmodifiableMap(state.expandedArtifacts), filesets, - state.actionFileSystem)) { + state.actionFileSystem, + skyframeDepsResult)) { if (!state.hasExecutedAction()) { state.value = skyframeActionExecutor.executeAction( @@ -597,7 +601,7 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver } } - private static void establishSkyframeDependencies(Environment env, Action action) + private static Object establishSkyframeDependencies(Environment env, Action action) throws ActionExecutionException, InterruptedException { // Before we may safely establish Skyframe dependencies, we must build all action inputs by // requesting their ArtifactValues. @@ -614,11 +618,12 @@ public class ActionExecutionFunction implements SkyFunction, CompletionReceiver Preconditions.checkState(action.executeUnconditionally(), action); try { - ((SkyframeAwareAction) action).establishSkyframeDependencies(env); + return ((SkyframeAwareAction) action).establishSkyframeDependencies(env); } catch (SkyframeAwareAction.ExceptionBase e) { throw new ActionExecutionException(e, action, false); } } + return null; } private static Iterable<SkyKey> toKeys( |