Skip to content

Commit

Permalink
Use Roslyn Toolchain by default if no build settings are changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell authored and AndreyAkinshin committed Sep 8, 2023
1 parent b035d90 commit e2e888c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/BenchmarkDotNet/Toolchains/ToolchainExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,17 @@ private static IToolchain GetToolchain(Job job, Descriptor descriptor)
: GetToolchain(
job.ResolveValue(EnvironmentMode.RuntimeCharacteristic, EnvironmentResolver.Instance),
descriptor,
job.HasValue(InfrastructureMode.NuGetReferencesCharacteristic) || job.HasValue(InfrastructureMode.BuildConfigurationCharacteristic));
job.HasValue(InfrastructureMode.NuGetReferencesCharacteristic)
|| job.HasValue(InfrastructureMode.BuildConfigurationCharacteristic)
|| job.HasValue(InfrastructureMode.ArgumentsCharacteristic));

internal static IToolchain GetToolchain(this Runtime runtime, Descriptor descriptor = null, bool preferMsBuildToolchains = false)
{
switch (runtime)
{
case ClrRuntime clrRuntime:
if (!preferMsBuildToolchains && RuntimeInformation.IsFullFramework &&
// If dotnet SDK is not installed, we use RoslynToolchain.
(!HostEnvironmentInfo.GetCurrent().IsDotNetCliInstalled()
// Integration tests take too much time, because each benchmark run rebuilds the test suite and BenchmarkDotNet itself.
// To reduce the total duration of the CI workflows, we just use RoslynToolchain.
|| XUnitHelper.IsIntegrationTest.Value))
if (!preferMsBuildToolchains && RuntimeInformation.IsFullFramework
&& RuntimeInformation.GetCurrentRuntime().MsBuildMoniker == runtime.MsBuildMoniker)
{
return RoslynToolchain.Instance;
}
Expand Down

0 comments on commit e2e888c

Please sign in to comment.