Change action failure description to be action.describe(), rather than its primary output.
Remove longstanding kludges to work around the absence of this information. In some cases, we now print the action's description instead of its owning label. I think that's ok.
Main changes: for C++ compilation and file write actions, we print the usual description instead of their bespoke one which had the label. For errors around output file failures, we print action.describe() instead of the rule label. For errors in include scanning, we print the action, then the subtask ("include scanning"), then the failure.
I've left a little kludge, for old times' sake: because ActionExecutionException's message is used both in SkyframeActionExecutor and in SkyframeBuilder when constructing a BuildFailedException, but there are lots of places that construct an ActionExecutionException, it is left to the ActionExecutionException consumer to prepend action.describe() + " failed: ". We could have ActionExecutionException itself do that in its constructor when it is constructed, but there are subtleties involving its message being null that I didn't want to untangle.
RELNOTES: Error messages emitted when an action fails are reworked to be more informative about the failing action. Some tooling may have to be updated as a result.
Closes #11151
PiperOrigin-RevId: 337305888
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionAnalysisMetadata.java b/src/main/java/com/google/devtools/build/lib/actions/ActionAnalysisMetadata.java
index b670969..c442a22 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionAnalysisMetadata.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionAnalysisMetadata.java
@@ -103,6 +103,9 @@
*/
String prettyPrint();
+ /** Returns a description of this action. */
+ String describe();
+
/**
* Returns the tool Artifacts that this Action depends upon. May be empty. This is a subset of
* getInputs().
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionMetadata.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionMetadata.java
index cc89a8b..338fb06 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionMetadata.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionMetadata.java
@@ -64,9 +64,6 @@
@Nullable
String describeKey();
- /** Returns a description of this action. */
- String describe();
-
/**
* Get the {@link RunfilesSupplier} providing runfiles needed by this action.
*/
diff --git a/src/main/java/com/google/devtools/build/lib/actions/EnvironmentalExecException.java b/src/main/java/com/google/devtools/build/lib/actions/EnvironmentalExecException.java
index d91302a..bb87bcf 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/EnvironmentalExecException.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/EnvironmentalExecException.java
@@ -24,11 +24,6 @@
* An ExecException which reports an issue executing an action due to an external problem on the
* local system.
*
- * <p>This exception will result in an exit code regarded as a system error; avoid using this for
- * problems which should be attributed to the user, e.g., a misconfigured BUILD file (use {@link
- * UserExecException}) or an action returning a non-zero exit code (use {@link *
- * com.google.devtools.build.lib.exec.SpawnExecException}.
- *
* <p>The most common use of this exception is to wrap an "unexpected" {@link IOException} thrown by
* an lower-level file system access or local process execution, e.g., failure to create a temporary
* directory or denied file system access.
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ExecException.java b/src/main/java/com/google/devtools/build/lib/actions/ExecException.java
index fb63b60..d674cff 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ExecException.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ExecException.java
@@ -14,10 +14,10 @@
package com.google.devtools.build.lib.actions;
-import com.google.common.base.Strings;
import com.google.devtools.build.lib.server.FailureDetails.FailureDetail;
import com.google.devtools.build.lib.util.DetailedExitCode;
import com.google.errorprone.annotations.ForOverride;
+import javax.annotation.Nullable;
/**
* An exception indication that the execution of an action has failed OR could not be attempted OR
@@ -87,27 +87,32 @@
* @return ActionExecutionException object describing the action failure
*/
public final ActionExecutionException toActionExecutionException(Action action) {
- return toActionExecutionException("", action);
+ return toActionExecutionException(null, action);
}
/**
- * Returns a new ActionExecutionException given a message prefix describing the action type as a
- * noun. When appropriate (we use some heuristics to decide), produces an abbreviated message
- * incorporating just the termination status if available.
+ * Returns a new ActionExecutionException given an optional action subtask describing which part
+ * of the action failed (should be null for standard action failures). When appropriate (we use
+ * some heuristics to decide), produces an abbreviated message incorporating just the termination
+ * status if available.
*
- * @param messagePrefix describes the action type as noun
+ * @param actionSubtask additional information about the action
* @param action failed action
* @return ActionExecutionException object describing the action failure
*/
public final ActionExecutionException toActionExecutionException(
- String messagePrefix, Action action) {
+ @Nullable String actionSubtask, Action action) {
+ // Message from ActionExecutionException will be prepended with action.describe() where
+ // necessary: because not all ActionExecutionExceptions come from this codepath, it is safer
+ // for consumers to manually prepend. We still put action.describe() in the failure detail
+ // message argument.
String message =
- String.format(
- "%s failed: %s",
- Strings.isNullOrEmpty(messagePrefix) ? action.describe() : messagePrefix,
- getMessageForActionExecutionException());
+ (actionSubtask == null ? "" : actionSubtask + ": ")
+ + getMessageForActionExecutionException();
return toActionExecutionException(
- message, action, DetailedExitCode.of(getFailureDetail(message)));
+ message,
+ action,
+ DetailedExitCode.of(getFailureDetail(action.describe() + " failed: " + message)));
}
@ForOverride
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/AbstractFileWriteAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/AbstractFileWriteAction.java
index 226be64..170f97c 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/actions/AbstractFileWriteAction.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/AbstractFileWriteAction.java
@@ -26,7 +26,6 @@
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ExecException;
import com.google.devtools.build.lib.actions.SpawnContinuation;
-import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import javax.annotation.Nullable;
@@ -91,7 +90,6 @@
}
} catch (ExecException e) {
throw e.toActionExecutionException(
- "Writing file for rule '" + Label.print(getOwner().getLabel()) + "'",
AbstractFileWriteAction.this);
}
afterWrite(actionExecutionContext);
@@ -100,7 +98,6 @@
};
} catch (ExecException e) {
throw e.toActionExecutionException(
- "Writing file for rule '" + Label.print(getOwner().getLabel()) + "'",
this);
}
}
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 a3f9205..0f1bbbf 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
@@ -343,28 +343,27 @@
}
private ActionExecutionException toActionExecutionException(ExecException e) {
+ if (!isShellCommand()) {
+ return e.toActionExecutionException(this);
+ }
String failMessage;
- if (isShellCommand()) {
- // The possible reasons it could fail are: shell executable not found, shell
- // exited non-zero, or shell died from signal. The first is impossible
- // and the second two aren't very interesting, so in the interests of
- // keeping the noise-level down, we don't print a reason why, just the
- // command that failed.
- //
- // 0=shell executable, 1=shell command switch, 2=command
- try {
- failMessage =
- "error executing shell command: "
- + "'"
- + truncate(Joiner.on(" ").join(getArguments()), 200)
- + "'";
- } catch (CommandLineExpansionException commandLineExpansionException) {
- failMessage =
- "error executing shell command, and error expanding command line: "
- + commandLineExpansionException;
- }
- } else {
- failMessage = getRawProgressMessage();
+ // The possible reasons it could fail are: shell executable not found, shell
+ // exited non-zero, or shell died from signal. The first is impossible
+ // and the second two aren't very interesting, so in the interests of
+ // keeping the noise-level down, we don't print a reason why, just the
+ // command that failed.
+ //
+ // 0=shell executable, 1=shell command switch, 2=command
+ try {
+ failMessage =
+ "error executing shell command: "
+ + "'"
+ + truncate(Joiner.on(" ").join(getArguments()), 200)
+ + "'";
+ } catch (CommandLineExpansionException commandLineExpansionException) {
+ failMessage =
+ "error executing shell command, and error expanding command line: "
+ + commandLineExpansionException;
}
return e.toActionExecutionException(failMessage, this);
}
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTemplate.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTemplate.java
index a8c7471..c16d7cc 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTemplate.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTemplate.java
@@ -238,6 +238,11 @@
}
@Override
+ public String describe() {
+ return "Executing " + mnemonic + " action on all files in " + inputTreeArtifact.prettyPrint();
+ }
+
+ @Override
public String toString() {
return prettyPrint();
}
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionAction.java
index d2f2f94..b92079b 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionAction.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionAction.java
@@ -32,7 +32,6 @@
import com.google.devtools.build.lib.actions.ArtifactPathResolver;
import com.google.devtools.build.lib.actions.ExecException;
import com.google.devtools.build.lib.actions.SpawnContinuation;
-import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
@@ -171,7 +170,6 @@
}
} catch (ExecException e) {
throw e.toActionExecutionException(
- "Error expanding template '" + Label.print(getOwner().getLabel()) + "'",
TemplateExpansionAction.this);
}
return ActionContinuationOrResult.of(ActionResult.create(nextContinuation.get()));
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java b/src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java
index 247ff7a..f1b3520 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java
@@ -344,11 +344,14 @@
}
if (cause instanceof ActionExecutionException) {
ActionExecutionException actionExecutionCause = (ActionExecutionException) cause;
+ String message = cause.getMessage();
+ if (actionExecutionCause.getAction() != null) {
+ message = actionExecutionCause.getAction().describe() + " failed: " + message;
+ }
// Sometimes ActionExecutionExceptions are caused by Actions with no owner.
- String message =
- (actionExecutionCause.getLocation() != null)
- ? (actionExecutionCause.getLocation() + " " + cause.getMessage())
- : cause.getMessage();
+ if (actionExecutionCause.getLocation() != null) {
+ message = actionExecutionCause.getLocation() + " " + message;
+ }
throw new BuildFailedException(
message,
actionExecutionCause.isCatastrophe(),
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
index 8a4ccf5..4690bdf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
@@ -423,9 +423,7 @@
throw new IllegalStateException(e.getCause());
}
} catch (ExecException e) {
- throw e.toActionExecutionException(
- "Include scanning of rule '" + getOwner().getLabel() + "'",
- this);
+ throw e.toActionExecutionException("include scanning", this);
}
}
@@ -1847,7 +1845,6 @@
} catch (ExecException e) {
copyTempOutErrToActionOutErr();
throw e.toActionExecutionException(
- "C++ compilation of rule '" + getOwner().getLabel() + "'",
CppCompileAction.this);
} catch (InterruptedException e) {
copyTempOutErrToActionOutErr();
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionTemplate.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionTemplate.java
index 37f55a5..b6c3dcd 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionTemplate.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionTemplate.java
@@ -325,6 +325,11 @@
}
@Override
+ public String describe() {
+ return "Compiling all C++ files in " + sourceTreeArtifact.prettyPrint();
+ }
+
+ @Override
public String toString() {
return prettyPrint();
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
index 6a68280..4328f03 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
@@ -472,7 +472,6 @@
return ActionContinuationOrResult.of(ActionResult.create(nextContinuation.get()));
} catch (ExecException e) {
throw e.toActionExecutionException(
- "Linking of rule '" + getOwner().getLabel() + "'",
CppLinkAction.this);
}
}
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 e14f459..0f1564c 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
@@ -949,12 +949,7 @@
}
skyframeActionExecutor.printError(
- String.format(
- "%s: %s",
- actionForError.getOwner().getLabel(),
- ArtifactFunction.makeIOExceptionInputFileMessage(input, e)),
- actionForError,
- null);
+ ArtifactFunction.makeIOExceptionInputFileMessage(input, e), actionForError, null);
// We don't create a specific cause for the artifact as we do in #handleMissingFile because
// it likely has no label, so we'd have to use the Action's label anyway. Just use the
// default ActionFailed event constructed by ActionExecutionException.
@@ -1260,10 +1255,7 @@
if (!missingArtifactCauses.isEmpty()) {
for (LabelCause missingInput : missingArtifactCauses) {
- skyframeActionExecutor.printError(
- String.format("%s: %s", action.getOwner().getLabel(), missingInput.getMessage()),
- action,
- null);
+ skyframeActionExecutor.printError(missingInput.getMessage(), action, null);
}
}
// We need to rethrow first exception because it can contain useful error message
@@ -1661,10 +1653,7 @@
if (!missingArtifactCauses.isEmpty()) {
for (LabelCause missingInput : missingArtifactCauses) {
- skyframeActionExecutor.printError(
- String.format("%s: %s", action.getOwner().getLabel(), missingInput.getMessage()),
- action,
- null);
+ skyframeActionExecutor.printError(missingInput.getMessage(), action, null);
}
throw createMissingInputsException(action, missingArtifactCauses);
}
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
index 1b3f6c2..0e71c17 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -1252,12 +1252,12 @@
}
}
} catch (IOException e) {
- String message = "failed to create output directory: " + e.getMessage();
- DetailedExitCode code =
- createDetailedExitCode(message, Code.ACTION_FS_OUTPUT_DIRECTORY_CREATION_FAILURE);
- ActionExecutionException ex = new ActionExecutionException(message, e, action, false, code);
- printError(ex.getMessage(), action, null);
- throw ex;
+ throw toActionExecutionException(
+ "failed to create output directory",
+ e,
+ action,
+ null,
+ Code.ACTION_FS_OUTPUT_DIRECTORY_CREATION_FAILURE);
}
}
@@ -1539,8 +1539,8 @@
/**
* Convenience function for creating an ActionExecutionException reporting that the action failed
- * due to a the exception cause, if there is an additional explanatory message that clarifies the
- * message of the exception. Combines the user-provided message and the exceptions' message and
+ * due to the exception cause, if there is an additional explanatory message that clarifies the
+ * message of the exception. Combines the user-provided message and the exception's message and
* reports the combination as error.
*
* @param message A small text that explains why the action failed
@@ -1591,27 +1591,14 @@
*/
@SuppressWarnings("SynchronizeOnNonFinalField")
void printError(String message, ActionAnalysisMetadata action, FileOutErr actionOutput) {
+ message = action.describe() + " failed: " + message;
+ Event event = Event.error(action.getOwner().getLocation(), message);
synchronized (reporter) {
- if (options.getOptions(KeepGoingOption.class).keepGoing) {
- message = "Couldn't " + describeAction(action) + ": " + message;
- }
- Event event = Event.error(action.getOwner().getLocation(), message);
dumpRecordedOutErr(reporter, event, actionOutput);
recordExecutionError();
}
}
- /** Describe an action, for use in error messages. */
- private static String describeAction(ActionAnalysisMetadata action) {
- if (action.getOutputs().isEmpty()) {
- return "run " + action.prettyPrint();
- } else if (action.getActionType().isMiddleman()) {
- return "build " + action.prettyPrint();
- } else {
- return "build file " + action.getPrimaryOutput().prettyPrint();
- }
- }
-
/**
* Dump the output from the action.
*
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/CustomRealFilesystemBuildIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/CustomRealFilesystemBuildIntegrationTest.java
index f2ece1b..1fbbb83 100644
--- a/src/test/java/com/google/devtools/build/lib/buildtool/CustomRealFilesystemBuildIntegrationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildtool/CustomRealFilesystemBuildIntegrationTest.java
@@ -84,7 +84,8 @@
customFileSystem.alwaysError(fooShFile);
assertThrows(BuildFailedException.class, () -> buildTarget("//foo:top"));
- events.assertContainsError("//foo:top: missing input file '//foo:foo.sh': nope");
+ events.assertContainsError(
+ "Executing genrule //foo:top failed: missing input file '//foo:foo.sh': nope");
}
/**
@@ -104,7 +105,8 @@
assertThat(rootCauses).hasSize(1);
assertThat(rootCauses.get(0).getLabel()).isEqualTo(Label.parseAbsoluteUnchecked("//foo:foo"));
assertThat(e.getDetailedExitCode().getExitCode()).isEqualTo(ExitCode.BUILD_FAILURE);
- events.assertContainsError("foo/BUILD:1:11: //foo:foo: missing input file 'foo/foo.h': nope");
+ events.assertContainsError(
+ "foo/BUILD:1:11: Compiling foo/foo.cc failed: missing input file 'foo/foo.h': nope");
}
/** Tests that IOExceptions encountered when not all discovered deps are done are handled. */
@@ -142,7 +144,8 @@
assertThat(rootCauses).hasSize(1);
assertThat(rootCauses.get(0).getLabel()).isEqualTo(Label.parseAbsoluteUnchecked("//foo:foo"));
assertThat(e.getDetailedExitCode().getExitCode()).isEqualTo(ExitCode.BUILD_FAILURE);
- events.assertContainsError("foo/BUILD:1:11: //foo:foo: missing input file 'foo/error.h': nope");
+ events.assertContainsError(
+ "foo/BUILD:1:11: Compiling foo/foo.cc failed: missing input file 'foo/error.h': nope");
}
/**
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/DanglingSymlinkTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/DanglingSymlinkTest.java
index 0e2e98b..0483939 100644
--- a/src/test/java/com/google/devtools/build/lib/buildtool/DanglingSymlinkTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildtool/DanglingSymlinkTest.java
@@ -53,7 +53,8 @@
assertThat(e).hasMessageThat().isNull();
events.assertContainsError("output 'test/test.out' is a dangling symbolic link");
- events.assertContainsError("Couldn't build file test/test.out: not all outputs were created");
+ events.assertContainsError(
+ "Executing genrule //test:test_ln failed: not all outputs were created");
}
/**
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/MissingInputActionTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/MissingInputActionTest.java
index e9477f2..5a45980 100644
--- a/src/test/java/com/google/devtools/build/lib/buildtool/MissingInputActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildtool/MissingInputActionTest.java
@@ -79,7 +79,9 @@
addOptions("--workspace_status_command=" + sleepPath.getPathString());
for (int i = 0; i < 2; i++) {
assertMissingInputOnBuild("//dummy", 1);
- events.assertContainsError("dummy/BUILD:1:8: //dummy:dummy: missing input file '//dummy:in'");
+ events.assertContainsError(
+ "dummy/BUILD:1:8: Executing genrule //dummy:dummy failed: missing input file"
+ + " '//dummy:in'");
events.assertContainsEventWithFrequency("missing input file", 1);
events.assertDoesNotContainEvent("Failed to determine build info");
events.clear();
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/NoOutputActionTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/NoOutputActionTest.java
index ca66e1b..ec69335 100644
--- a/src/test/java/com/google/devtools/build/lib/buildtool/NoOutputActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/buildtool/NoOutputActionTest.java
@@ -46,7 +46,9 @@
assertThrows(BuildFailedException.class, () -> buildTarget("//nooutput"));
assertThat(e)
.hasMessageThat()
- .contains("nooutput/BUILD:1:8 not all outputs were created or valid");
+ .contains(
+ "nooutput/BUILD:1:8 Executing genrule //nooutput:nooutput failed: not all outputs were"
+ + " created or valid");
events.assertContainsError("declared output 'nooutput/out1' was not created by genrule");
events.assertContainsError("declared output 'nooutput/out2' was not created by genrule");
}
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java
index ad8fed7..e0264f8 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java
@@ -467,6 +467,11 @@
}
@Override
+ public String describe() {
+ return prettyPrint();
+ }
+
+ @Override
public NestedSet<Artifact> getTools() {
return NestedSetBuilder.emptySet(Order.STABLE_ORDER);
}
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorTest.java
index 5c41342..d004581 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorTest.java
@@ -1196,6 +1196,11 @@
@Override
public String prettyPrint() {
+ return describe();
+ }
+
+ @Override
+ public String describe() {
return "DummyTemplate";
}
diff --git a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
index bd11f56..88bb1b5 100644
--- a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
@@ -36,6 +36,7 @@
import com.google.devtools.build.lib.actions.Spawn;
import com.google.devtools.build.lib.actions.SpawnResult;
import com.google.devtools.build.lib.actions.util.ActionsTestUtil;
+import com.google.devtools.build.lib.actions.util.ActionsTestUtil.NullAction;
import com.google.devtools.build.lib.analysis.BlazeDirectories;
import com.google.devtools.build.lib.analysis.ServerDirectories;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
@@ -316,7 +317,7 @@
public void testVerboseFailures() {
ExecException e = assertThrows(ExecException.class, () -> run(createSpawn(getFalseCommand())));
ActionExecutionException actionExecutionException =
- e.toActionExecutionException("messagePrefix", null);
+ e.toActionExecutionException(new NullAction());
assertWithMessage("got: " + actionExecutionException.getMessage())
.that(actionExecutionException.getMessage().contains("failed: error executing command"))
.isTrue();
diff --git a/src/test/shell/integration/ui_test.sh b/src/test/shell/integration/ui_test.sh
index 2f8670e..7185411 100755
--- a/src/test/shell/integration/ui_test.sh
+++ b/src/test/shell/integration/ui_test.sh
@@ -457,11 +457,11 @@
bazel build --attempt_to_print_relative_paths=false \
error:failwitherror > "${TEST_log}" 2>&1 && fail "expected failure"
- expect_log "^ERROR: $(pwd)/error/BUILD:1:8: Executing genrule"
+ expect_log "^ERROR: $(pwd)/error/BUILD:1:8: Executing genrule //error:failwitherror failed: "
bazel build --attempt_to_print_relative_paths=true \
error:failwitherror > "${TEST_log}" 2>&1 && fail "expected failure"
- expect_log "^ERROR: error/BUILD:1:8: Executing genrule"
+ expect_log "^ERROR: error/BUILD:1:8: Executing genrule //error:failwitherror failed: "
expect_not_log "$(pwd)/error/BUILD"
}