aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2017-07-04 09:58:42 -0400
committerGravatar John Cater <jcater@google.com>2017-07-05 10:58:08 -0400
commita8a594323661f915c69f44e3d880a0c503234a74 (patch)
tree67a8fe695d93f8ed95d81ff341811fe0528fee26 /src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
parent7a6ec8e9ab2a0f9c60c9394831619335d9ed5760 (diff)
Update SpawnAction to take an ActionEnvironment
Some of the callers are not using the proper one from the configuration, and are thus ignoring --action_env. Some are only using part of the configuration's action environment. I tried to carefully not change the semantics in any case. Semantic-changing changes come later. PiperOrigin-RevId: 160891204
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
index 26a68a5c7e..a7e1033a22 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
@@ -102,7 +102,7 @@ public abstract class AbstractAction implements Action, SkylarkValue {
@GuardedBy("this")
private Iterable<Artifact> inputs;
- private final Iterable<String> clientEnvironmentVariables;
+ protected final ActionEnvironment env;
private final RunfilesSupplier runfilesSupplier;
private final ImmutableSet<Artifact> outputs;
@@ -142,22 +142,22 @@ public abstract class AbstractAction implements Action, SkylarkValue {
Iterable<Artifact> inputs,
RunfilesSupplier runfilesSupplier,
Iterable<Artifact> outputs) {
- this(owner, tools, inputs, ImmutableList.<String>of(), runfilesSupplier, outputs);
+ this(owner, tools, inputs, runfilesSupplier, outputs, ActionEnvironment.EMPTY);
}
protected AbstractAction(
ActionOwner owner,
Iterable<Artifact> tools,
Iterable<Artifact> inputs,
- Iterable<String> clientEnvironmentVariables,
RunfilesSupplier runfilesSupplier,
- Iterable<Artifact> outputs) {
+ Iterable<Artifact> outputs,
+ ActionEnvironment env) {
Preconditions.checkNotNull(owner);
// TODO(bazel-team): Use RuleContext.actionOwner here instead
this.owner = owner;
this.tools = CollectionUtils.makeImmutable(tools);
this.inputs = CollectionUtils.makeImmutable(inputs);
- this.clientEnvironmentVariables = clientEnvironmentVariables;
+ this.env = env;
this.outputs = ImmutableSet.copyOf(outputs);
this.runfilesSupplier = Preconditions.checkNotNull(runfilesSupplier,
"runfilesSupplier may not be null");
@@ -251,7 +251,7 @@ public abstract class AbstractAction implements Action, SkylarkValue {
@Override
public Iterable<String> getClientEnvironmentVariables() {
- return clientEnvironmentVariables;
+ return env.getInheritedEnv();
}
@Override
@@ -540,6 +540,7 @@ public abstract class AbstractAction implements Action, SkylarkValue {
* throws that exception.
* @throws InterruptedException if interrupted
*/
+ @Override
public Iterable<Artifact> getInputFilesForExtraAction(
ActionExecutionContext actionExecutionContext)
throws ActionExecutionException, InterruptedException {