File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed
src/main/java/com/google/devtools/build/lib Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ java_library(
123123 "//src/main/java/com/google/devtools/build/lib/util/io" ,
124124 "//src/main/java/com/google/devtools/build/lib/vfs" ,
125125 "//src/main/protobuf:failure_details_java_proto" ,
126+ "//src/main/protobuf:spawn_java_proto" ,
126127 ],
127128)
128129
Original file line number Diff line number Diff line change 1919import com .google .devtools .build .lib .exec .ExecutionOptions ;
2020import com .google .devtools .build .lib .exec .ExecutorBuilder ;
2121import com .google .devtools .build .lib .exec .ModuleActionContextRegistry ;
22+ import com .google .devtools .build .lib .exec .Protos .SpawnExec ;
2223import com .google .devtools .build .lib .exec .SpawnLogContext ;
2324import com .google .devtools .build .lib .remote .options .RemoteOptions ;
2425import com .google .devtools .build .lib .runtime .BlazeModule ;
@@ -162,7 +163,14 @@ public void afterCommand() throws AbruptExitException {
162163 spawnLogContext .close ();
163164 if (!outputStreams .isEmpty ()) {
164165 InputStream in = rawOutput .getInputStream ();
165- StableSort .stableSort (in , outputStreams );
166+ if (spawnLogContext .shouldSort ()) {
167+ StableSort .stableSort (in , outputStreams );
168+ } else {
169+ while (in .available () > 0 ) {
170+ SpawnExec ex = SpawnExec .parseDelimitedFrom (in );
171+ outputStreams .write (ex );
172+ }
173+ }
166174 outputStreams .close ();
167175 }
168176 done = true ;
Original file line number Diff line number Diff line change @@ -472,6 +472,17 @@ public boolean usingLocalTestJobs() {
472472 + " --subcommands (for displaying subcommands in terminal output)." )
473473 public PathFragment executionLogJsonFile ;
474474
475+ @ Option (
476+ name = "execution_log_sort" ,
477+ defaultValue = "true" ,
478+ documentationCategory = OptionDocumentationCategory .UNCATEGORIZED ,
479+ effectTags = {OptionEffectTag .UNKNOWN },
480+ help =
481+ "Whether to sort the execution log. Set to false to improve memory"
482+ + " performance, at the cost of producing the log in nondeterministic"
483+ + " order." )
484+ public boolean executionLogSort ;
485+
475486 @ Option (
476487 name = "experimental_split_xml_generation" ,
477488 defaultValue = "true" ,
Original file line number Diff line number Diff line change @@ -332,4 +332,8 @@ private Digest computeDigest(
332332 .setSizeBytes (fileSize )
333333 .build ();
334334 }
335+
336+ public boolean shouldSort () {
337+ return executionOptions .executionLogSort ;
338+ }
335339}
You can’t perform that action at this time.
0 commit comments