Skip to content

Commit 5feb748

Browse files
committed
Use DotNetSdkValidator.GetSdkVersionFromMoniker.
1 parent 861cd2f commit 5feb748

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static bool ShouldBuildSequential(BuildPartition partition)
8888
=> partition.RepresentativeBenchmarkCase.Config.Options.IsSet(ConfigOptions.DisableParallelBuild)
8989
// .Net SDK 8+ supports ArtifactsPath for proper parallel builds.
9090
// Older SDKs may produce builds with incorrect bindings if more than 1 partition is built in parallel.
91-
|| (partition.RepresentativeBenchmarkCase.GetToolchain().Generator is DotNetCliGenerator && partition.RepresentativeBenchmarkCase.GetRuntime().RuntimeMoniker < RuntimeMoniker.Net80);
91+
|| (partition.RepresentativeBenchmarkCase.GetToolchain().Generator is DotNetCliGenerator
92+
&& DotNetSdkValidator.GetSdkVersionFromMoniker(partition.RepresentativeBenchmarkCase.GetRuntime().RuntimeMoniker).Major < 8);
9293

9394
var parallelBuildPartitions = buildPartitions.Where(x => !ShouldBuildSequential(x)).ToArray();
9495
var sequentialBuildPartitions = buildPartitions.Where(ShouldBuildSequential).ToArray();

src/BenchmarkDotNet/Validators/DotNetSdkVersionValidator.cs renamed to src/BenchmarkDotNet/Validators/DotNetSdkValidator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private static string CheckFor45PlusVersion(int releaseKey)
199199
return "";
200200
}
201201

202-
private static Version GetSdkVersionFromMoniker(RuntimeMoniker runtimeMoniker)
202+
internal static Version GetSdkVersionFromMoniker(RuntimeMoniker runtimeMoniker)
203203
{
204204
return runtimeMoniker switch
205205
{

0 commit comments

Comments
 (0)