@@ -76,7 +76,7 @@ internal static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
7676 var globalChronometer = Chronometer . Start ( ) ;
7777
7878 var buildPartitions = BenchmarkPartitioner . CreateForBuild ( supportedBenchmarks , resolver ) ;
79- var buildResults = BuildInParallel ( compositeLogger , rootArtifactsFolderPath , buildPartitions , in globalChronometer ) ;
79+ var buildResults = Build ( compositeLogger , rootArtifactsFolderPath , buildPartitions , in globalChronometer ) ;
8080 var allBuildsHaveFailed = buildResults . Values . All ( buildResult => ! buildResult . IsBuildSuccess ) ;
8181
8282 try
@@ -347,35 +347,19 @@ private static ImmutableArray<ValidationError> Validate(params BenchmarkRunInfo[
347347 return validationErrors . ToImmutableArray ( ) ;
348348 }
349349
350- private static Dictionary < BuildPartition , BuildResult > BuildInParallel ( ILogger logger , string rootArtifactsFolderPath , BuildPartition [ ] buildPartitions , in StartedClock globalChronometer )
350+ private static Dictionary < BuildPartition , BuildResult > Build ( ILogger logger , string rootArtifactsFolderPath , BuildPartition [ ] buildPartitions , in StartedClock globalChronometer )
351351 {
352- logger . WriteLineHeader ( $ "// ***** Building { buildPartitions . Length } exe(s) in Parallel : Start *****") ;
352+ logger . WriteLineHeader ( $ "// ***** Building { buildPartitions . Length } exe(s): Start *****") ;
353353
354- var buildLogger = buildPartitions . Length == 1 ? logger : NullLogger . Instance ; // when we have just one partition we can print to std out
355-
356- var beforeParallelBuild = globalChronometer . GetElapsed ( ) ;
354+ var beforeBuild = globalChronometer . GetElapsed ( ) ;
357355
358356 var buildResults = buildPartitions
359- . AsParallel ( )
360- . Select ( buildPartition => ( buildPartition , buildResult : Build ( buildPartition , rootArtifactsFolderPath , buildLogger ) ) )
357+ . Select ( buildPartition => ( buildPartition , buildResult : Build ( buildPartition , rootArtifactsFolderPath , logger ) ) )
361358 . ToDictionary ( result => result . buildPartition , result => result . buildResult ) ;
362359
363- var afterParallelBuild = globalChronometer . GetElapsed ( ) ;
364-
365- logger . WriteLineHeader ( $ "// ***** Done, took { GetFormattedDifference ( beforeParallelBuild , afterParallelBuild ) } *****") ;
366-
367- if ( buildPartitions . Length <= 1 || ! buildResults . Values . Any ( result => result . IsGenerateSuccess && ! result . IsBuildSuccess ) )
368- return buildResults ;
369-
370- logger . WriteLineHeader ( "// ***** Failed to build in Parallel, switching to sequential build *****" ) ;
371-
372- foreach ( var buildPartition in buildPartitions )
373- if ( buildResults [ buildPartition ] . IsGenerateSuccess && ! buildResults [ buildPartition ] . IsBuildSuccess && ! buildResults [ buildPartition ] . TryToExplainFailureReason ( out string _ ) )
374- buildResults [ buildPartition ] = Build ( buildPartition , rootArtifactsFolderPath , buildLogger ) ;
375-
376- var afterSequentialBuild = globalChronometer . GetElapsed ( ) ;
360+ var afterBuild = globalChronometer . GetElapsed ( ) ;
377361
378- logger . WriteLineHeader ( $ "// ***** Done, took { GetFormattedDifference ( afterParallelBuild , afterSequentialBuild ) } *****") ;
362+ logger . WriteLineHeader ( $ "// ***** Done, took { GetFormattedDifference ( beforeBuild , afterBuild ) } *****") ;
379363
380364 return buildResults ;
381365
0 commit comments