Update "--subcommands" to also show the execution platform for each action.
PiperOrigin-RevId: 314537921
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
index d98bb54..d47fb64 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
@@ -293,18 +293,21 @@
return;
}
- String reason;
+ StringBuilder reason = new StringBuilder();
ActionOwner owner = spawn.getResourceOwner().getOwner();
if (owner == null) {
- reason = spawn.getResourceOwner().prettyPrint();
+ reason.append(spawn.getResourceOwner().prettyPrint());
} else {
- reason =
- Label.print(owner.getLabel())
- + " ["
- + spawn.getResourceOwner().prettyPrint()
- + ", configuration: "
- + owner.getConfigurationChecksum()
- + "]";
+ reason.append(Label.print(owner.getLabel()));
+ reason.append(" [");
+ reason.append(spawn.getResourceOwner().prettyPrint());
+ reason.append(", configuration: ");
+ reason.append(owner.getConfigurationChecksum());
+ if (owner.getExecutionPlatform() != null) {
+ reason.append(", execution platform: ");
+ reason.append(owner.getExecutionPlatform().label());
+ }
+ reason.append("]");
}
String message = Spawns.asShellCommand(spawn, getExecRoot(), showSubcommands.prettyPrintArgs);
getEventHandler().handle(Event.of(EventKind.SUBCOMMAND, null, "# " + reason + "\n" + message));