Add a mechanism to SpawnResult to return an in-memory output
@@ -17,6 +17,7 @@ import com.google.common.base.Preconditions;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.shell.TerminationStatus;
+import java.io.InputStream;
import java.time.Duration;
import java.util.Locale;
import java.util.Optional;
@@ -183,6 +184,17 @@ public interface SpawnResult {
return "";
}
+ /**
+ * SpawnResults can optionally support returning outputs in-memory. Such outputs can be obtained
+ * from this method if so.
+ *
+ * @param output
+ */
+ @Nullable
+ default InputStream getInMemoryOutput(ActionInput output) {
+ return null;
+ }
+
String getDetailMessage(
String messagePrefix, String message, boolean catastrophe, boolean forciblyRunRemotely);
