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
1 change: 1 addition & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="dotnet10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json" />
<add key="dotnet11" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json" />

<!-- required for Roslyn analyzers -->
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
Expand Down
25 changes: 25 additions & 0 deletions src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public enum RuntimeMoniker
/// </summary>
Net10_0,

/// <summary>
/// .NET 11.0
/// </summary>
Net11_0,

/// <summary>
/// NativeAOT compiled as net6.0
/// </summary>
Expand All @@ -134,6 +139,11 @@ public enum RuntimeMoniker
/// </summary>
NativeAot10_0,

/// <summary>
/// NativeAOT compiled as net11.0
/// </summary>
NativeAot11_0,

/// <summary>
/// WebAssembly with default .Net version
/// </summary>
Expand Down Expand Up @@ -169,6 +179,11 @@ public enum RuntimeMoniker
/// </summary>
WasmNet10_0,

/// <summary>
/// WebAssembly with net11.0
/// </summary>
WasmNet11_0,

/// <summary>
/// Mono with the Ahead of Time LLVM Compiler backend
/// </summary>
Expand Down Expand Up @@ -199,6 +214,11 @@ public enum RuntimeMoniker
/// </summary>
MonoAOTLLVMNet10_0,

/// <summary>
/// Mono with the Ahead of Time LLVM Compiler backend and net11.0
/// </summary>
MonoAOTLLVMNet11_0,

/// <summary>
/// .NET 6 using MonoVM (not CLR which is the default)
/// </summary>
Expand All @@ -223,5 +243,10 @@ public enum RuntimeMoniker
/// .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,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.Net80:
case RuntimeMoniker.Net90:
case RuntimeMoniker.Net10_0:
case RuntimeMoniker.Net11_0:
return true;
case RuntimeMoniker.NotRecognized:
case RuntimeMoniker.Mono:
Expand All @@ -90,24 +91,28 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.NativeAot80:
case RuntimeMoniker.NativeAot90:
case RuntimeMoniker.NativeAot10_0:
case RuntimeMoniker.NativeAot11_0:
case RuntimeMoniker.Wasm:
case RuntimeMoniker.WasmNet50:
case RuntimeMoniker.WasmNet60:
case RuntimeMoniker.WasmNet70:
case RuntimeMoniker.WasmNet80:
case RuntimeMoniker.WasmNet90:
case RuntimeMoniker.WasmNet10_0:
case RuntimeMoniker.WasmNet11_0:
case RuntimeMoniker.MonoAOTLLVM:
case RuntimeMoniker.MonoAOTLLVMNet60:
case RuntimeMoniker.MonoAOTLLVMNet70:
case RuntimeMoniker.MonoAOTLLVMNet80:
case RuntimeMoniker.MonoAOTLLVMNet90:
case RuntimeMoniker.MonoAOTLLVMNet10_0:
case RuntimeMoniker.MonoAOTLLVMNet11_0:
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
5 changes: 5 additions & 0 deletions src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.Net80:
case RuntimeMoniker.Net90:
case RuntimeMoniker.Net10_0:
case RuntimeMoniker.Net11_0:
return true;
case RuntimeMoniker.NotRecognized:
case RuntimeMoniker.Mono:
Expand All @@ -93,24 +94,28 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
case RuntimeMoniker.NativeAot80:
case RuntimeMoniker.NativeAot90:
case RuntimeMoniker.NativeAot10_0:
case RuntimeMoniker.NativeAot11_0:
case RuntimeMoniker.Wasm:
case RuntimeMoniker.WasmNet50:
case RuntimeMoniker.WasmNet60:
case RuntimeMoniker.WasmNet70:
case RuntimeMoniker.WasmNet80:
case RuntimeMoniker.WasmNet90:
case RuntimeMoniker.WasmNet10_0:
case RuntimeMoniker.WasmNet11_0:
case RuntimeMoniker.MonoAOTLLVM:
case RuntimeMoniker.MonoAOTLLVMNet60:
case RuntimeMoniker.MonoAOTLLVMNet70:
case RuntimeMoniker.MonoAOTLLVMNet80:
case RuntimeMoniker.MonoAOTLLVMNet90:
case RuntimeMoniker.MonoAOTLLVMNet10_0:
case RuntimeMoniker.MonoAOTLLVMNet11_0:
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
13 changes: 13 additions & 0 deletions src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
case RuntimeMoniker.Net80:
case RuntimeMoniker.Net90:
case RuntimeMoniker.Net10_0:
case RuntimeMoniker.Net11_0:
{
var runtime = runtimeMoniker.GetRuntime();
return baseJob
Expand Down Expand Up @@ -567,6 +568,9 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
case RuntimeMoniker.NativeAot10_0:
return CreateAotJob(baseJob, options, runtimeMoniker, "", "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json");

case RuntimeMoniker.NativeAot11_0:
return CreateAotJob(baseJob, options, runtimeMoniker, "", "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json");

case RuntimeMoniker.Wasm:
return MakeWasmJob(baseJob, options, RuntimeInformation.IsNetCore ? CoreRuntime.GetCurrentVersion().MsBuildMoniker : "net5.0", runtimeMoniker);

Expand All @@ -588,6 +592,9 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
case RuntimeMoniker.WasmNet10_0:
return MakeWasmJob(baseJob, options, "net10.0", runtimeMoniker);

case RuntimeMoniker.WasmNet11_0:
return MakeWasmJob(baseJob, options, "net11.0", runtimeMoniker);

case RuntimeMoniker.MonoAOTLLVM:
return MakeMonoAOTLLVMJob(baseJob, options, RuntimeInformation.IsNetCore ? CoreRuntime.GetCurrentVersion().MsBuildMoniker : "net6.0", runtimeMoniker);

Expand All @@ -606,6 +613,9 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
case RuntimeMoniker.MonoAOTLLVMNet10_0:
return MakeMonoAOTLLVMJob(baseJob, options, "net10.0", runtimeMoniker);

case RuntimeMoniker.MonoAOTLLVMNet11_0:
return MakeMonoAOTLLVMJob(baseJob, options, "net11.0", runtimeMoniker);

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

Expand All @@ -621,6 +631,9 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
case RuntimeMoniker.Mono10_0:
return MakeMonoJob(baseJob, options, MonoRuntime.Mono10_0);

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

default:
throw new NotSupportedException($"Runtime {runtimeId} is not supported");
}
Expand Down
4 changes: 3 additions & 1 deletion src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public class CoreRuntime : Runtime
public static readonly CoreRuntime Core80 = new(RuntimeMoniker.Net80, "net8.0", ".NET 8.0");
public static readonly CoreRuntime Core90 = new(RuntimeMoniker.Net90, "net9.0", ".NET 9.0");
public static readonly CoreRuntime Core10_0 = new(RuntimeMoniker.Net10_0, "net10.0", ".NET 10.0");
public static readonly CoreRuntime Core11_0 = new(RuntimeMoniker.Net11_0, "net11.0", ".NET 11.0");

public static CoreRuntime Latest => Core10_0; // when dotnet/runtime branches for 11.0, this will need to get updated
public static CoreRuntime Latest => Core11_0; // when dotnet/runtime branches for 12.0, this will need to get updated

private CoreRuntime(RuntimeMoniker runtimeMoniker, string msBuildMoniker, string displayName)
: base(runtimeMoniker, msBuildMoniker, displayName)
Expand Down Expand Up @@ -84,6 +85,7 @@ internal static CoreRuntime GetCurrentVersion()
{ Major: 8 } => GetPlatformSpecific(Core80, assembly),
{ Major: 9 } => GetPlatformSpecific(Core90, assembly),
{ Major: 10 } => GetPlatformSpecific(Core10_0, assembly),
{ Major: 11 } => GetPlatformSpecific(Core11_0, assembly),
_ => CreateForNewVersion($"net{version.Major}.{version.Minor}", $".NET {version.Major}.{version.Minor}"),
};

Expand Down
1 change: 1 addition & 0 deletions src/BenchmarkDotNet/Environments/Runtimes/MonoRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class MonoRuntime : Runtime, IEquatable<MonoRuntime>
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);
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
5 changes: 5 additions & 0 deletions src/BenchmarkDotNet/Environments/Runtimes/NativeAotRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public class NativeAotRuntime : Runtime
/// NativeAOT compiled as net10.0
/// </summary>
public static readonly NativeAotRuntime Net10_0 = new NativeAotRuntime(RuntimeMoniker.NativeAot10_0, "net10.0", "NativeAOT 10.0");
/// <summary>
/// NativeAOT compiled as net11.0
/// </summary>
public static readonly NativeAotRuntime Net11_0 = new NativeAotRuntime(RuntimeMoniker.NativeAot11_0, "net11.0", "NativeAOT 11.0");

public override bool IsAOT => true;

Expand Down Expand Up @@ -53,6 +57,7 @@ public static NativeAotRuntime GetCurrentVersion()
case Version v when v.Major == 8 && v.Minor == 0: return Net80;
case Version v when v.Major == 9 && v.Minor == 0: return Net90;
case Version v when v.Major == 10 && v.Minor == 0: return Net10_0;
case Version v when v.Major == 11 && v.Minor == 0: return Net11_0;
default:
return new NativeAotRuntime(RuntimeMoniker.NotRecognized, $"net{version.Major}.{version.Minor}", $"NativeAOT {version.Major}.{version.Minor}");
}
Expand Down
11 changes: 11 additions & 0 deletions src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker)
return CoreRuntime.Core90;
case RuntimeMoniker.Net10_0:
return CoreRuntime.Core10_0;
case RuntimeMoniker.Net11_0:
return CoreRuntime.Core11_0;
case RuntimeMoniker.Mono:
return MonoRuntime.Default;
case RuntimeMoniker.NativeAot60:
Expand All @@ -58,6 +60,8 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker)
return NativeAotRuntime.Net90;
case RuntimeMoniker.NativeAot10_0:
return NativeAotRuntime.Net10_0;
case RuntimeMoniker.NativeAot11_0:
return NativeAotRuntime.Net11_0;
case RuntimeMoniker.Mono60:
return MonoRuntime.Mono60;
case RuntimeMoniker.Mono70:
Expand All @@ -68,6 +72,8 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker)
return MonoRuntime.Mono90;
case RuntimeMoniker.Mono10_0:
return MonoRuntime.Mono10_0;
case RuntimeMoniker.Mono11_0:
return MonoRuntime.Mono11_0;
default:
throw new ArgumentOutOfRangeException(nameof(runtimeMoniker), runtimeMoniker, "Runtime Moniker not supported");
}
Expand All @@ -93,29 +99,34 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker)
RuntimeMoniker.Net80 => new Version(8, 0),
RuntimeMoniker.Net90 => new Version(9, 0),
RuntimeMoniker.Net10_0 => new Version(10, 0),
RuntimeMoniker.Net11_0 => new Version(11, 0),
RuntimeMoniker.NativeAot60 => new Version(6, 0),
RuntimeMoniker.NativeAot70 => new Version(7, 0),
RuntimeMoniker.NativeAot80 => new Version(8, 0),
RuntimeMoniker.NativeAot90 => new Version(9, 0),
RuntimeMoniker.NativeAot10_0 => new Version(10, 0),
RuntimeMoniker.NativeAot11_0 => new Version(11, 0),
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.Wasm => Portability.RuntimeInformation.IsNetCore && CoreRuntime.TryGetVersion(out var version) ? version : new Version(5, 0),
RuntimeMoniker.WasmNet50 => new Version(5, 0),
RuntimeMoniker.WasmNet60 => new Version(6, 0),
RuntimeMoniker.WasmNet70 => new Version(7, 0),
RuntimeMoniker.WasmNet80 => new Version(8, 0),
RuntimeMoniker.WasmNet90 => new Version(9, 0),
RuntimeMoniker.WasmNet10_0 => new Version(10, 0),
RuntimeMoniker.WasmNet11_0 => new Version(11, 0),
RuntimeMoniker.MonoAOTLLVM => Portability.RuntimeInformation.IsNetCore && CoreRuntime.TryGetVersion(out var version) ? version : new Version(6, 0),
RuntimeMoniker.MonoAOTLLVMNet60 => new Version(6, 0),
RuntimeMoniker.MonoAOTLLVMNet70 => new Version(7, 0),
RuntimeMoniker.MonoAOTLLVMNet80 => new Version(8, 0),
RuntimeMoniker.MonoAOTLLVMNet90 => new Version(9, 0),
RuntimeMoniker.MonoAOTLLVMNet10_0 => new Version(10, 0),
RuntimeMoniker.MonoAOTLLVMNet11_0 => new Version(11, 0),
_ => throw new NotImplementedException($"{nameof(GetRuntimeVersion)} not implemented for {runtimeMoniker}")
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class CsProjCoreToolchain : Toolchain, IEquatable<CsProjCoreToolchain>
[PublicAPI] public static readonly IToolchain NetCoreApp80 = From(NetCoreAppSettings.NetCoreApp80);
[PublicAPI] public static readonly IToolchain NetCoreApp90 = From(NetCoreAppSettings.NetCoreApp90);
[PublicAPI] public static readonly IToolchain NetCoreApp10_0 = From(NetCoreAppSettings.NetCoreApp10_0);
[PublicAPI] public static readonly IToolchain NetCoreApp11_0 = From(NetCoreAppSettings.NetCoreApp11_0);

internal CsProjCoreToolchain(string name, IGenerator generator, IBuilder builder, IExecutor executor, string customDotNetCliPath)
: base(name, generator, builder, executor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ private static string Map(Capture capture)
return "net9.0";
case ".NETCoreApp,Version=v10.0":
return "net10.0";
case ".NETCoreApp,Version=v11.0":
return "net11.0";
default:
return capture.Value; // we don't want to throw for future versions of .NET
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class NetCoreAppSettings
[PublicAPI] public static readonly NetCoreAppSettings NetCoreApp80 = new("net8.0", null, ".NET 8.0");
[PublicAPI] public static readonly NetCoreAppSettings NetCoreApp90 = new("net9.0", null, ".NET 9.0");
[PublicAPI] public static readonly NetCoreAppSettings NetCoreApp10_0 = new("net10.0", null, ".NET 10.0");
[PublicAPI] public static readonly NetCoreAppSettings NetCoreApp11_0 = new("net11.0", null, ".NET 11.0");

/// <summary>
/// <param name="targetFrameworkMoniker">
Expand Down
1 change: 1 addition & 0 deletions src/BenchmarkDotNet/Toolchains/Mono/MonoToolchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class MonoToolchain : CsProjCoreToolchain, IEquatable<MonoToolchain>
[PublicAPI] public static readonly IToolchain Mono80 = From(new NetCoreAppSettings("net8.0", null, "mono80"));
[PublicAPI] public static readonly IToolchain Mono90 = From(new NetCoreAppSettings("net9.0", null, "mono90"));
[PublicAPI] public static readonly IToolchain Mono10_0 = From(new NetCoreAppSettings("net10.0", null, "mono10_0"));
[PublicAPI] public static readonly IToolchain Mono11_0 = From(new NetCoreAppSettings("net11.0", null, "mono11_0"));

private MonoToolchain(string name, IGenerator generator, IBuilder builder, IExecutor executor, string customDotNetCliPath)
: base(name, generator, builder, executor, customDotNetCliPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public class NativeAotToolchain : Toolchain
.TargetFrameworkMoniker("net10.0")
.ToToolchain();

/// <summary>
/// compiled as net11.0, targets latest NativeAOT build from the .NET 11 feed: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json
/// </summary>
public static readonly IToolchain Net11_0 = CreateBuilder()
.UseNuGet("", "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json")
.TargetFrameworkMoniker("net11.0")
.ToToolchain();

internal NativeAotToolchain(string displayName,
string ilCompilerVersion,
string runtimeFrameworkVersion, string targetFrameworkMoniker, string runtimeIdentifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public NativeAotToolchainBuilder UseLocalBuild(DirectoryInfo ilcPackages)
if (!ilcPackages.Exists) throw new DirectoryNotFoundException($"{ilcPackages} provided as {nameof(ilcPackages)} does NOT exist");

Feeds["local"] = ilcPackages.FullName;
ilCompilerVersion = "10.0.0-dev";
Feeds["dotnet10"] = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json";
ilCompilerVersion = "11.0.0-dev";
Feeds["dotnet11"] = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json";
useTempFolderForRestore = true;
DisplayName("local ILCompiler build");

Expand Down
Loading