Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,21 @@ public enum RuntimeMoniker
/// </summary>
Mono80,

/// <summary>
/// .NET 9 using MonoVM (not CLR which is the default)
/// </summary>
Mono90,

/// <summary>
/// .NET 10 using MonoVM (not CLR which is the default)
/// </summary>
Mono10_0,

/// <summary>
/// .NET 11 using MonoVM (not CLR which is the default)
/// </summary>
Mono11_0,

/// <summary>
/// .NET 8 CLR with composite ReadyToRun compilation
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.Mono60:
case RuntimeMoniker.Mono70:
case RuntimeMoniker.Mono80:
case RuntimeMoniker.Mono90:
case RuntimeMoniker.Mono10_0:
case RuntimeMoniker.Mono11_0:
return false;
case RuntimeMoniker.NetCoreApp20:
case RuntimeMoniker.NetCoreApp21:
Expand Down
3 changes: 3 additions & 0 deletions src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.Mono60:
case RuntimeMoniker.Mono70:
case RuntimeMoniker.Mono80:
case RuntimeMoniker.Mono90:
case RuntimeMoniker.Mono10_0:
case RuntimeMoniker.Mono11_0:
return false;
case RuntimeMoniker.NetCoreApp20:
case RuntimeMoniker.NetCoreApp21:
Expand Down
9 changes: 9 additions & 0 deletions src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,15 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
case RuntimeMoniker.Mono80:
return MakeMonoJob(baseJob, options, MonoRuntime.Mono80);

case RuntimeMoniker.Mono90:
return MakeMonoJob(baseJob, options, MonoRuntime.Mono90);

case RuntimeMoniker.Mono10_0:
return MakeMonoJob(baseJob, options, MonoRuntime.Mono10_0);

case RuntimeMoniker.Mono11_0:
return MakeMonoJob(baseJob, options, MonoRuntime.Mono11_0);

case RuntimeMoniker.R2R80:
case RuntimeMoniker.R2R90:
case RuntimeMoniker.R2R10_0:
Expand Down
3 changes: 3 additions & 0 deletions src/BenchmarkDotNet/Environments/Runtimes/MonoRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public class MonoRuntime : Runtime, IEquatable<MonoRuntime>
public static readonly MonoRuntime Mono60 = new("Mono with .NET 6.0", RuntimeMoniker.Mono60, "net6.0", isDotNetBuiltIn: true);
public static readonly MonoRuntime Mono70 = new("Mono with .NET 7.0", RuntimeMoniker.Mono70, "net7.0", isDotNetBuiltIn: true);
public static readonly MonoRuntime Mono80 = new("Mono with .NET 8.0", RuntimeMoniker.Mono80, "net8.0", isDotNetBuiltIn: true);
public static readonly MonoRuntime Mono90 = new("Mono with .NET 9.0", RuntimeMoniker.Mono90, "net9.0", isDotNetBuiltIn: true);
Comment thread
timcassell marked this conversation as resolved.
public static readonly MonoRuntime Mono10_0 = new("Mono with .NET 10.0", RuntimeMoniker.Mono10_0, "net10.0", isDotNetBuiltIn: true);
public static readonly MonoRuntime Mono11_0 = new("Mono with .NET 11.0", RuntimeMoniker.Mono11_0, "net11.0", isDotNetBuiltIn: true);

public string CustomPath { get; } = "";

Expand Down
9 changes: 9 additions & 0 deletions src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker)
return MonoRuntime.Mono70;
case RuntimeMoniker.Mono80:
return MonoRuntime.Mono80;
case RuntimeMoniker.Mono90:
return MonoRuntime.Mono90;
case RuntimeMoniker.Mono10_0:
return MonoRuntime.Mono10_0;
case RuntimeMoniker.Mono11_0:
return MonoRuntime.Mono11_0;
case RuntimeMoniker.R2R80:
return R2RRuntime.Net80;
case RuntimeMoniker.R2R90:
Expand Down Expand Up @@ -110,6 +116,9 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker)
RuntimeMoniker.Mono60 => new Version(6, 0),
RuntimeMoniker.Mono70 => new Version(7, 0),
RuntimeMoniker.Mono80 => new Version(8, 0),
RuntimeMoniker.Mono90 => new Version(9, 0),
RuntimeMoniker.Mono10_0 => new Version(10, 0),
RuntimeMoniker.Mono11_0 => new Version(11, 0),
RuntimeMoniker.WasmNet80 => new Version(8, 0),
RuntimeMoniker.WasmNet90 => new Version(9, 0),
RuntimeMoniker.WasmNet10_0 => new Version(10, 0),
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Toolchains/CsProj/CsProjGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,4 +505,4 @@ private static IEnumerable<DirectoryInfo> GetSubDirectories(DirectoryInfo curren
=> currentDir.EnumerateDirectories("*", DirectoryEnumerationOptions);
#endif
}
}
}
4 changes: 1 addition & 3 deletions src/BenchmarkDotNet/Toolchains/Mono/MonoGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ protected override string GetRuntimeSettings(GcMode gcMode, IResolver resolver)
{
// Workaround for following issues.
// 1. 'Found multiple publish output files with the same relative path' error
// 2. NU1102 error occurs when running 'dotnet publish' on projects that contain .NET 9.0 or higher. https://github.com/dotnet/BenchmarkDotNet/issues/3000
// 2. NU1102 error occurs when passing /p:UseMonoRuntime=true to the dotnet cli with projects containing .NET 9.0 or higher. #3000
return base.GetRuntimeSettings(gcMode, resolver) +
"""
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
<UseMonoRuntime>true</UseMonoRuntime>
</PropertyGroup>
""";
Expand Down
3 changes: 3 additions & 0 deletions src/BenchmarkDotNet/Toolchains/Mono/MonoToolchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class MonoToolchain : CsProjCoreToolchain, IEquatable<MonoToolchain>
[PublicAPI] public static readonly IToolchain Mono60 = From(new NetCoreAppSettings("net6.0", "mono60"));
[PublicAPI] public static readonly IToolchain Mono70 = From(new NetCoreAppSettings("net7.0", "mono70"));
[PublicAPI] public static readonly IToolchain Mono80 = From(new NetCoreAppSettings("net8.0", "mono80"));
[PublicAPI] public static readonly IToolchain Mono90 = From(new NetCoreAppSettings("net9.0", "mono90"));
[PublicAPI] public static readonly IToolchain Mono10_0 = From(new NetCoreAppSettings("net10.0", "mono10_0"));
[PublicAPI] public static readonly IToolchain Mono11_0 = From(new NetCoreAppSettings("net11.0", "mono11_0"));

private MonoToolchain(string name, IGenerator generator, IBuilder builder, IExecutor executor, string customDotNetCliPath)
: base(name, generator, builder, executor, customDotNetCliPath)
Expand Down
14 changes: 13 additions & 1 deletion src/BenchmarkDotNet/Toolchains/ToolchainExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ bool UseRoslyn()
RuntimeMoniker.Mono60 => GetToolchain(RuntimeMoniker.Net60),
RuntimeMoniker.Mono70 => GetToolchain(RuntimeMoniker.Net70),
RuntimeMoniker.Mono80 => GetToolchain(RuntimeMoniker.Net80),
RuntimeMoniker.Mono90 => GetToolchain(RuntimeMoniker.Net90),
RuntimeMoniker.Mono10_0 => GetToolchain(RuntimeMoniker.Net10_0),
RuntimeMoniker.Mono11_0 => GetToolchain(RuntimeMoniker.Net11_0),
_ => CsProjCoreToolchain.From(new NetCoreAppSettings(mono.MsBuildMoniker, mono.Name))
};
}
Expand Down Expand Up @@ -198,6 +201,15 @@ private static IToolchain GetToolchain(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.Mono80:
return MonoToolchain.Mono80;

case RuntimeMoniker.Mono90:
return MonoToolchain.Mono90;

case RuntimeMoniker.Mono10_0:
return MonoToolchain.Mono10_0;

case RuntimeMoniker.Mono11_0:
return MonoToolchain.Mono11_0;

case RuntimeMoniker.R2R80:
return R2RToolchain.R2R80;

Expand All @@ -215,4 +227,4 @@ private static IToolchain GetToolchain(RuntimeMoniker runtimeMoniker)
}
}
}
}
}
Loading