aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar Cal Peyser <cpeyser@google.com>2016-02-05 17:58:46 +0000
committerGravatar David Chen <dzc@google.com>2016-02-05 20:53:04 +0000
commit8378cd840122509fb88efdc49eb5663cad9c7fc4 (patch)
treeba6d5c010d5dd274ab394ac4f675ea35897f3ade /src/main/java/com/google/devtools/build/lib
parentfbb8a0af26c7968eaac2a26094bc5867a1bc076f (diff)
*** Reason for rollback *** Mutability violates the Action contract: this change breaks incremental builds. *** Original change description *** Propogate BAZEL_VERBOSE_FAILURES and BAZEL_SUBCOMMANDS to the execution environments of runtime tools. -- MOS_MIGRATED_REVID=113958481
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java55
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleAction.java3
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/extra/ExtraAction.java3
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java5
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java1
5 files changed, 6 insertions, 61 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java
index d648662538..8d88c6f90a 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java
@@ -83,9 +83,6 @@ public class SpawnAction extends AbstractAction {
private static final String GUID = "ebd6fce3-093e-45ee-adb6-bf513b602f0d";
- private static final String VERBOSE_FAILURES_KEY = "BAZEL_VERBOSE_FAILURES";
- private static final String SUBCOMMANDS_KEY = "BAZEL_SUBCOMMANDS";
-
private final CommandLine argv;
private final boolean executeUnconditionally;
@@ -95,13 +92,11 @@ public class SpawnAction extends AbstractAction {
private final ImmutableMap<PathFragment, Artifact> inputManifests;
private final ResourceSet resourceSet;
- private ImmutableMap<String, String> environment;
+ private final ImmutableMap<String, String> environment;
private final ImmutableMap<String, String> executionInfo;
private final ExtraActionInfoSupplier<?> extraActionInfoSupplier;
- private final boolean verboseFailuresAndSubcommandsInEnv;
-
/**
* Constructs a SpawnAction using direct initialization arguments.
* <p>
@@ -145,8 +140,7 @@ public class SpawnAction extends AbstractAction {
ImmutableMap.<PathFragment, Artifact>of(),
mnemonic,
false,
- null,
- false);
+ null);
}
/**
@@ -171,9 +165,6 @@ public class SpawnAction extends AbstractAction {
* @param inputManifests entries in inputs that are symlink manifest files.
* These are passed to remote execution in the environment rather than as inputs.
* @param mnemonic the mnemonic that is reported in the master log.
- * @param verboseFailuresAndSubcommandsInEnv if the presense of "--verbose_failures" and/or
- * "--subcommands" in the execution should be propogated to the environment of the
- * action.
*/
public SpawnAction(
ActionOwner owner,
@@ -188,8 +179,7 @@ public class SpawnAction extends AbstractAction {
ImmutableMap<PathFragment, Artifact> inputManifests,
String mnemonic,
boolean executeUnconditionally,
- ExtraActionInfoSupplier<?> extraActionInfoSupplier,
- boolean verboseFailuresAndSubcommandsInEnv) {
+ ExtraActionInfoSupplier<?> extraActionInfoSupplier) {
super(owner, tools, inputs, outputs);
this.resourceSet = resourceSet;
this.executionInfo = executionInfo;
@@ -200,7 +190,6 @@ public class SpawnAction extends AbstractAction {
this.mnemonic = mnemonic;
this.executeUnconditionally = executeUnconditionally;
this.extraActionInfoSupplier = extraActionInfoSupplier;
- this.verboseFailuresAndSubcommandsInEnv = verboseFailuresAndSubcommandsInEnv;
}
/**
@@ -257,22 +246,6 @@ public class SpawnAction extends AbstractAction {
public void execute(ActionExecutionContext actionExecutionContext)
throws ActionExecutionException, InterruptedException {
Executor executor = actionExecutionContext.getExecutor();
-
- // Reconstruct environment to communicate if verbose_failures and/or subcommands is set.
- if (verboseFailuresAndSubcommandsInEnv) {
- ImmutableMap.Builder<String, String> environmentBuilder =
- new ImmutableMap.Builder<String, String>().putAll(environment);
-
- if (executor.getVerboseFailures()) {
- environmentBuilder.put(VERBOSE_FAILURES_KEY, "true");
- }
- if (executor.reportsSubcommands()) {
- environmentBuilder.put(SUBCOMMANDS_KEY, "true");
- }
-
- this.environment = environmentBuilder.build();
- }
-
try {
internalExecute(actionExecutionContext);
} catch (ExecException e) {
@@ -383,11 +356,6 @@ public class SpawnAction extends AbstractAction {
/**
* Returns the environment in which to run this action.
- *
- * <p>Note that if setVerboseFailuresAndSubcommandsInEnv() is called on the builder, and either
- * verbose_failures or subcommands is specified in the execution context, corresponding variables
- * will be added to the environment. These variables will not be known until execution time,
- * however, and so are not returned by getEnvironment().
*/
public Map<String, String> getEnvironment() {
return environment;
@@ -491,8 +459,6 @@ public class SpawnAction extends AbstractAction {
private String mnemonic = "Unknown";
private ExtraActionInfoSupplier<?> extraActionInfoSupplier = null;
- private boolean verboseFailuresAndSubcommandsInEnv = false;
-
/**
* Creates a SpawnAction builder.
*/
@@ -521,7 +487,6 @@ public class SpawnAction extends AbstractAction {
this.progressMessage = other.progressMessage;
this.paramFileInfo = other.paramFileInfo;
this.mnemonic = other.mnemonic;
- this.verboseFailuresAndSubcommandsInEnv = other.verboseFailuresAndSubcommandsInEnv;
}
/**
@@ -608,8 +573,7 @@ public class SpawnAction extends AbstractAction {
ImmutableMap.copyOf(inputAndToolManifests),
mnemonic,
executeUnconditionally,
- extraActionInfoSupplier,
- verboseFailuresAndSubcommandsInEnv));
+ extraActionInfoSupplier));
return actions.toArray(new Action[actions.size()]);
}
@@ -709,17 +673,6 @@ public class SpawnAction extends AbstractAction {
}
/**
- * Sets the environment variable "BAZEL_VERBOSE_FAILURES" to "true" if --verbose_failures is
- * set in the execution context. Sets the environment variable "BAZEL_SUBCOMMANDS" to "true"
- * if --subcommands is set in the execution context.
- *
- */
- public Builder setVerboseFailuresAndSubcommandsInEnv() {
- this.verboseFailuresAndSubcommandsInEnv = true;
- return this;
- }
-
- /**
* Makes the action always execute, even if none of its inputs have changed.
*
* <p>Only use this when absolutely necessary, since this is a performance hit and we'd like to
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleAction.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleAction.java
index 6d4d63492e..7481cdcadc 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleAction.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleAction.java
@@ -60,8 +60,7 @@ public final class GenRuleAction extends SpawnAction {
runfilesManifests,
"Genrule",
false,
- null,
- false);
+ null);
}
@Override
diff --git a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraAction.java b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraAction.java
index 2e0f25bf6d..88c967ae72 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraAction.java
@@ -97,8 +97,7 @@ public final class ExtraAction extends SpawnAction {
getManifests(shadowedAction),
mnemonic,
false,
- null,
- false);
+ null);
this.shadowedAction = shadowedAction;
this.runfilesManifests = ImmutableMap.copyOf(runfilesManifests);
this.createDummyOutput = createDummyOutput;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
index 05ab0a528c..afbfb93c0b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
@@ -238,7 +238,6 @@ final class BundleSupport {
.setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, storyboardInput))
.addOutput(zipOutput)
.addInput(storyboardInput)
- .setVerboseFailuresAndSubcommandsInEnv()
.build(ruleContext));
}
}
@@ -278,7 +277,6 @@ final class BundleSupport {
.setExecutable(attributes.momcWrapper())
.addOutput(outputZip)
.addInputs(datamodel.getInputs())
- .setVerboseFailuresAndSubcommandsInEnv()
.setCommandLine(CustomCommandLine.builder()
.addPath(outputZip.getExecPath())
.add(datamodel.archiveRootForMomczip())
@@ -308,7 +306,6 @@ final class BundleSupport {
.setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, original))
.addOutput(zipOutput)
.addInput(original)
- .setVerboseFailuresAndSubcommandsInEnv()
.build(ruleContext));
}
}
@@ -363,7 +360,6 @@ final class BundleSupport {
.addInputArgument(plMergeControlArtifact)
.addTransitiveInputs(mergingContentArtifacts)
.addOutput(ObjcRuleClasses.intermediateArtifacts(ruleContext).mergedInfoplist())
- .setVerboseFailuresAndSubcommandsInEnv()
.build(ruleContext));
}
@@ -388,7 +384,6 @@ final class BundleSupport {
.addTransitiveInputs(objcProvider.get(ASSET_CATALOG))
.addOutput(zipOutput)
.addOutput(actoolPartialInfoplist)
- .setVerboseFailuresAndSubcommandsInEnv()
.setCommandLine(actoolzipCommandLine(
objcProvider,
zipOutput,
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
index d534cdd385..1bfed353b3 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
@@ -749,7 +749,6 @@ public final class ReleaseBundlingSupport {
.addInputArgument(bundleMergeControlArtifact)
.addTransitiveInputs(bundleContentArtifacts)
.addOutput(ipaUnsigned)
- .setVerboseFailuresAndSubcommandsInEnv()
.build(ruleContext));
}