Skip to content

Commit

Permalink
Store Starlark action's inputs in action cache if it shadows an actio…
Browse files Browse the repository at this point in the history
…n that discovers inputs.

The Starlark action inputs' execPaths should also be stored in the action cache if it shadows another action that discovers its inputs to avoid re-running input discovery after a shutdown.

PiperOrigin-RevId: 361101021
  • Loading branch information
mai93 authored and copybara-github committed Mar 5, 2021
1 parent 7b0ff0a commit 2adf7d1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,14 @@ private static NestedSet<Artifact> createInputs(NestedSet<Artifact>... inputsLis
/**
* StarlarkAction can contain `unused_input_list`, which rely on the action cache entry's file
* list to determine the list of inputs for a subsequent run, taking into account
* unused_input_list. Hence we need to store the inputs' execPaths in the action cache.
* unused_input_list. Hence we need to store the inputs' execPaths in the action cache. The
* StarlarkAction inputs' execPaths should also be stored in the action cache if it shadows
* another action that discovers its inputs to avoid re-running input discovery after a shutdown.
*/
@Override
public boolean storeInputsExecPathsInActionCache() {
return unusedInputsList.isPresent();
return unusedInputsList.isPresent()
|| (shadowedAction.isPresent() && shadowedAction.get().discoversInputs());
}

/** Builder class to construct {@link StarlarkAction} instances. */
Expand Down

0 comments on commit 2adf7d1

Please sign in to comment.