Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to RoslynToolchain #2409

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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