diff --git a/NuGet.Config b/NuGet.Config index 2b6eda7434..c27c48f9e6 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -14,6 +14,7 @@ + diff --git a/src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs b/src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs index 93d64e2b3f..81a2431629 100644 --- a/src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs +++ b/src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs @@ -109,6 +109,11 @@ public enum RuntimeMoniker /// Net10_0, + /// + /// .NET 11.0 + /// + Net11_0, + /// /// NativeAOT compiled as net6.0 /// @@ -134,6 +139,11 @@ public enum RuntimeMoniker /// NativeAot10_0, + /// + /// NativeAOT compiled as net11.0 + /// + NativeAot11_0, + /// /// WebAssembly with default .Net version /// @@ -169,6 +179,11 @@ public enum RuntimeMoniker /// WasmNet10_0, + /// + /// WebAssembly with net11.0 + /// + WasmNet11_0, + /// /// Mono with the Ahead of Time LLVM Compiler backend /// @@ -199,6 +214,11 @@ public enum RuntimeMoniker /// MonoAOTLLVMNet10_0, + /// + /// Mono with the Ahead of Time LLVM Compiler backend and net11.0 + /// + MonoAOTLLVMNet11_0, + /// /// .NET 6 using MonoVM (not CLR which is the default) /// @@ -223,5 +243,10 @@ public enum RuntimeMoniker /// .NET 10 using MonoVM (not CLR which is the default) /// Mono10_0, + + /// + /// .NET 11 using MonoVM (not CLR which is the default) + /// + Mono11_0, } } diff --git a/src/BenchmarkDotNet.Diagnostics.dotMemory/DotMemoryDiagnoser.cs b/src/BenchmarkDotNet.Diagnostics.dotMemory/DotMemoryDiagnoser.cs index 01bb2ac15a..8430b907b6 100644 --- a/src/BenchmarkDotNet.Diagnostics.dotMemory/DotMemoryDiagnoser.cs +++ b/src/BenchmarkDotNet.Diagnostics.dotMemory/DotMemoryDiagnoser.cs @@ -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: @@ -90,6 +91,7 @@ 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: @@ -97,17 +99,20 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker) 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: diff --git a/src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs b/src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs index 30bb9435d1..bea8894868 100644 --- a/src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs +++ b/src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs @@ -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: @@ -93,6 +94,7 @@ 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: @@ -100,17 +102,20 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker) 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: diff --git a/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs b/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs index 1dc8137c62..4a0fa84a34 100644 --- a/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs +++ b/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs @@ -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 @@ -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); @@ -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); @@ -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); @@ -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"); } diff --git a/src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs b/src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs index ed6ce08bba..d2538cf055 100644 --- a/src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs +++ b/src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs @@ -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) @@ -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}"), }; diff --git a/src/BenchmarkDotNet/Environments/Runtimes/MonoRuntime.cs b/src/BenchmarkDotNet/Environments/Runtimes/MonoRuntime.cs index c1c37db2cd..dcd4ed6f49 100644 --- a/src/BenchmarkDotNet/Environments/Runtimes/MonoRuntime.cs +++ b/src/BenchmarkDotNet/Environments/Runtimes/MonoRuntime.cs @@ -11,6 +11,7 @@ public class MonoRuntime : Runtime, IEquatable 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; } diff --git a/src/BenchmarkDotNet/Environments/Runtimes/NativeAotRuntime.cs b/src/BenchmarkDotNet/Environments/Runtimes/NativeAotRuntime.cs index bff018558e..dd85c3bb1b 100644 --- a/src/BenchmarkDotNet/Environments/Runtimes/NativeAotRuntime.cs +++ b/src/BenchmarkDotNet/Environments/Runtimes/NativeAotRuntime.cs @@ -26,6 +26,10 @@ public class NativeAotRuntime : Runtime /// NativeAOT compiled as net10.0 /// public static readonly NativeAotRuntime Net10_0 = new NativeAotRuntime(RuntimeMoniker.NativeAot10_0, "net10.0", "NativeAOT 10.0"); + /// + /// NativeAOT compiled as net11.0 + /// + public static readonly NativeAotRuntime Net11_0 = new NativeAotRuntime(RuntimeMoniker.NativeAot11_0, "net11.0", "NativeAOT 11.0"); public override bool IsAOT => true; @@ -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}"); } diff --git a/src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs b/src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs index a133233e76..1dad83d690 100644 --- a/src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs +++ b/src/BenchmarkDotNet/Extensions/RuntimeMonikerExtensions.cs @@ -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: @@ -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: @@ -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"); } @@ -93,16 +99,19 @@ 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), @@ -110,12 +119,14 @@ internal static Runtime GetRuntime(this RuntimeMoniker runtimeMoniker) 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}") }; } diff --git a/src/BenchmarkDotNet/Toolchains/CsProj/CsProjCoreToolchain.cs b/src/BenchmarkDotNet/Toolchains/CsProj/CsProjCoreToolchain.cs index 4aea1327f8..3930a1ac9e 100644 --- a/src/BenchmarkDotNet/Toolchains/CsProj/CsProjCoreToolchain.cs +++ b/src/BenchmarkDotNet/Toolchains/CsProj/CsProjCoreToolchain.cs @@ -26,6 +26,7 @@ public class CsProjCoreToolchain : Toolchain, IEquatable [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) diff --git a/src/BenchmarkDotNet/Toolchains/DotNetCli/MsBuildErrorMapper.cs b/src/BenchmarkDotNet/Toolchains/DotNetCli/MsBuildErrorMapper.cs index e6e7d58af7..bfd803084c 100644 --- a/src/BenchmarkDotNet/Toolchains/DotNetCli/MsBuildErrorMapper.cs +++ b/src/BenchmarkDotNet/Toolchains/DotNetCli/MsBuildErrorMapper.cs @@ -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 } diff --git a/src/BenchmarkDotNet/Toolchains/DotNetCli/NetCoreAppSettings.cs b/src/BenchmarkDotNet/Toolchains/DotNetCli/NetCoreAppSettings.cs index 807e394682..c21642b055 100644 --- a/src/BenchmarkDotNet/Toolchains/DotNetCli/NetCoreAppSettings.cs +++ b/src/BenchmarkDotNet/Toolchains/DotNetCli/NetCoreAppSettings.cs @@ -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"); /// /// diff --git a/src/BenchmarkDotNet/Toolchains/Mono/MonoToolchain.cs b/src/BenchmarkDotNet/Toolchains/Mono/MonoToolchain.cs index a705034463..e56ceab8f3 100644 --- a/src/BenchmarkDotNet/Toolchains/Mono/MonoToolchain.cs +++ b/src/BenchmarkDotNet/Toolchains/Mono/MonoToolchain.cs @@ -13,6 +13,7 @@ public class MonoToolchain : CsProjCoreToolchain, IEquatable [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) diff --git a/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchain.cs b/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchain.cs index 33da4613ed..26ef06a1a7 100644 --- a/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchain.cs +++ b/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchain.cs @@ -48,6 +48,14 @@ public class NativeAotToolchain : Toolchain .TargetFrameworkMoniker("net10.0") .ToToolchain(); + /// + /// 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 + /// + 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, diff --git a/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchainBuilder.cs b/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchainBuilder.cs index 656e5a646a..e50673eb34 100644 --- a/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchainBuilder.cs +++ b/src/BenchmarkDotNet/Toolchains/NativeAot/NativeAotToolchainBuilder.cs @@ -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"); diff --git a/src/BenchmarkDotNet/Toolchains/ToolchainExtensions.cs b/src/BenchmarkDotNet/Toolchains/ToolchainExtensions.cs index ea17b69841..41216a16a7 100644 --- a/src/BenchmarkDotNet/Toolchains/ToolchainExtensions.cs +++ b/src/BenchmarkDotNet/Toolchains/ToolchainExtensions.cs @@ -77,6 +77,7 @@ bool UseRoslyn() 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, null, mono.Name)) }; } @@ -166,6 +167,9 @@ private static IToolchain GetToolchain(RuntimeMoniker runtimeMoniker) case RuntimeMoniker.Net10_0: return CsProjCoreToolchain.NetCoreApp10_0; + case RuntimeMoniker.Net11_0: + return CsProjCoreToolchain.NetCoreApp11_0; + case RuntimeMoniker.NativeAot60: return NativeAotToolchain.Net60; @@ -181,6 +185,9 @@ private static IToolchain GetToolchain(RuntimeMoniker runtimeMoniker) case RuntimeMoniker.NativeAot10_0: return NativeAotToolchain.Net10_0; + case RuntimeMoniker.NativeAot11_0: + return NativeAotToolchain.Net11_0; + case RuntimeMoniker.Mono60: return MonoToolchain.Mono60; @@ -196,6 +203,9 @@ private static IToolchain GetToolchain(RuntimeMoniker runtimeMoniker) case RuntimeMoniker.Mono10_0: return MonoToolchain.Mono10_0; + case RuntimeMoniker.Mono11_0: + return MonoToolchain.Mono11_0; + default: throw new ArgumentOutOfRangeException(nameof(runtimeMoniker), runtimeMoniker, "RuntimeMoniker not supported"); } diff --git a/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json b/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json index c5c8748d1d..14e6a20eac 100644 --- a/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json +++ b/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json @@ -34,6 +34,10 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ + { + "choice": "net11.0", + "description": ".NET 11" + }, { "choice": "net10.0", "description": ".NET 10" diff --git a/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/.template.config/template.json b/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/.template.config/template.json index 030fa16345..2f22459e41 100644 --- a/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/.template.config/template.json +++ b/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/.template.config/template.json @@ -34,6 +34,10 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ + { + "choice": "net11.0", + "description": ".NET 11" + }, { "choice": "net10.0", "description": ".NET 10" diff --git a/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.VB/.template.config/template.json b/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.VB/.template.config/template.json index 92eb0a3561..857f13fcaa 100644 --- a/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.VB/.template.config/template.json +++ b/templates/templates/BenchmarkDotNet.BenchmarkProjectTemplate.VB/.template.config/template.json @@ -34,6 +34,10 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ + { + "choice": "net11.0", + "description": ".NET 11" + }, { "choice": "net10.0", "description": ".NET 10" diff --git a/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs b/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs index dd25527e8a..76393cc631 100644 --- a/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs +++ b/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs @@ -162,7 +162,7 @@ public void SpecifyingCoreRunWithFullFrameworkTargetsMostRecentTfm() CoreRunToolchain coreRunToolchain = (CoreRunToolchain)coreRunJob.GetToolchain(); DotNetCliGenerator generator = (DotNetCliGenerator)coreRunToolchain.Generator; - Assert.Equal("net10.0", generator.TargetFrameworkMoniker); + Assert.Equal("net11.0", generator.TargetFrameworkMoniker); } [FactEnvSpecific("It's impossible to determine TFM for CoreRunToolchain if host process is not .NET (Core) process", EnvRequirement.DotNetCoreOnly)] @@ -417,6 +417,8 @@ public void NetFrameworkMonikerParsedCorrectly(string tfm) [InlineData("net9.0")] [InlineData("net10_0")] [InlineData("net10.0")] + [InlineData("net11_0")] + [InlineData("net11.0")] public void NetMonikersAreRecognizedAsNetCoreMonikers(string tfm) { var config = ConfigParser.Parse(new[] { "-r", tfm }, new OutputLogger(Output)).config; diff --git a/tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs b/tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs index b52030b0cc..d376cc726b 100644 --- a/tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs +++ b/tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs @@ -22,6 +22,8 @@ public class RuntimeVersionDetectionTests [InlineData(".NETCoreApp,Version=v7.0", RuntimeMoniker.Net70, "net7.0")] [InlineData(".NETCoreApp,Version=v8.0", RuntimeMoniker.Net80, "net8.0")] [InlineData(".NETCoreApp,Version=v9.0", RuntimeMoniker.Net90, "net9.0")] + [InlineData(".NETCoreApp,Version=v10.0", RuntimeMoniker.Net10_0, "net10.0")] + [InlineData(".NETCoreApp,Version=v11.0", RuntimeMoniker.Net11_0, "net11.0")] [InlineData(".NETCoreApp,Version=v123.0", RuntimeMoniker.NotRecognized, "net123.0")] public void TryGetVersionFromFrameworkNameHandlesValidInput(string frameworkName, RuntimeMoniker expectedTfm, string expectedMsBuildMoniker) { diff --git a/tests/BenchmarkDotNet.Tests/Validators/RuntimeValidatorTests.cs b/tests/BenchmarkDotNet.Tests/Validators/RuntimeValidatorTests.cs index 9eac2dd6f2..a89333ea31 100644 --- a/tests/BenchmarkDotNet.Tests/Validators/RuntimeValidatorTests.cs +++ b/tests/BenchmarkDotNet.Tests/Validators/RuntimeValidatorTests.cs @@ -44,7 +44,7 @@ public void NullRuntimeMixed_Should_Failed() Assert.Contains(expectedMessage, errors); } { - var expectedMessage = "Job(Toolchain=.NET 10.0) doesn't have a Runtime characteristic. It's recommended to specify runtime by using WithRuntime explicitly."; + var expectedMessage = "Job(Toolchain=.NET 11.0) doesn't have a Runtime characteristic. It's recommended to specify runtime by using WithRuntime explicitly."; Assert.Contains(expectedMessage, errors); } } @@ -102,7 +102,7 @@ public TestConfig2() .WithRuntime(CoreRuntime.Core90)); // Validate error message for auto generated jobid. - AddJob(Job.Default.WithToolchain(CsProjCoreToolchain.NetCoreApp10_0)); + AddJob(Job.Default.WithToolchain(CsProjCoreToolchain.NetCoreApp11_0)); } }