Commit 1a6ffe6 1 parent 72f0045 commit 1a6ffe6 Copy full SHA for 1a6ffe6
File tree 4 files changed +25
-1
lines changed
src/main/java/com/google/devtools/build/lib
4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ java_library(
123
123
"//src/main/java/com/google/devtools/build/lib/util/io" ,
124
124
"//src/main/java/com/google/devtools/build/lib/vfs" ,
125
125
"//src/main/protobuf:failure_details_java_proto" ,
126
+ "//src/main/protobuf:spawn_java_proto" ,
126
127
],
127
128
)
128
129
Original file line number Diff line number Diff line change 19
19
import com .google .devtools .build .lib .exec .ExecutionOptions ;
20
20
import com .google .devtools .build .lib .exec .ExecutorBuilder ;
21
21
import com .google .devtools .build .lib .exec .ModuleActionContextRegistry ;
22
+ import com .google .devtools .build .lib .exec .Protos .SpawnExec ;
22
23
import com .google .devtools .build .lib .exec .SpawnLogContext ;
23
24
import com .google .devtools .build .lib .remote .options .RemoteOptions ;
24
25
import com .google .devtools .build .lib .runtime .BlazeModule ;
@@ -162,7 +163,14 @@ public void afterCommand() throws AbruptExitException {
162
163
spawnLogContext .close ();
163
164
if (!outputStreams .isEmpty ()) {
164
165
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
+ }
166
174
outputStreams .close ();
167
175
}
168
176
done = true ;
Original file line number Diff line number Diff line change @@ -472,6 +472,17 @@ public boolean usingLocalTestJobs() {
472
472
+ " --subcommands (for displaying subcommands in terminal output)." )
473
473
public PathFragment executionLogJsonFile ;
474
474
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
+
475
486
@ Option (
476
487
name = "experimental_split_xml_generation" ,
477
488
defaultValue = "true" ,
Original file line number Diff line number Diff line change @@ -332,4 +332,8 @@ private Digest computeDigest(
332
332
.setSizeBytes (fileSize )
333
333
.build ();
334
334
}
335
+
336
+ public boolean shouldSort () {
337
+ return executionOptions .executionLogSort ;
338
+ }
335
339
}
You can’t perform that action at this time.
0 commit comments