diff --git a/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs b/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs index ab3552e22d..bd739028ad 100644 --- a/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs +++ b/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs @@ -571,19 +571,19 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma return MakeWasmJob(baseJob, options, "net9.0", runtimeMoniker); case RuntimeMoniker.MonoAOTLLVM: - return MakeMonoAOTLLVMJob(baseJob, options, RuntimeInformation.IsNetCore ? CoreRuntime.GetCurrentVersion().MsBuildMoniker : "net6.0"); + return MakeMonoAOTLLVMJob(baseJob, options, RuntimeInformation.IsNetCore ? CoreRuntime.GetCurrentVersion().MsBuildMoniker : "net6.0", runtimeMoniker); case RuntimeMoniker.MonoAOTLLVMNet60: - return MakeMonoAOTLLVMJob(baseJob, options, "net6.0"); + return MakeMonoAOTLLVMJob(baseJob, options, "net6.0", runtimeMoniker); case RuntimeMoniker.MonoAOTLLVMNet70: - return MakeMonoAOTLLVMJob(baseJob, options, "net7.0"); + return MakeMonoAOTLLVMJob(baseJob, options, "net7.0", runtimeMoniker); case RuntimeMoniker.MonoAOTLLVMNet80: - return MakeMonoAOTLLVMJob(baseJob, options, "net8.0"); + return MakeMonoAOTLLVMJob(baseJob, options, "net8.0", runtimeMoniker); case RuntimeMoniker.MonoAOTLLVMNet90: - return MakeMonoAOTLLVMJob(baseJob, options, "net9.0"); + return MakeMonoAOTLLVMJob(baseJob, options, "net9.0", runtimeMoniker); case RuntimeMoniker.Mono60: return MakeMonoJob(baseJob, options, MonoRuntime.Mono60); @@ -637,9 +637,9 @@ private static Job MakeMonoJob(Job baseJob, CommandLineOptions options, MonoRunt packagesPath: options.RestorePath?.FullName))); } - private static Job MakeMonoAOTLLVMJob(Job baseJob, CommandLineOptions options, string msBuildMoniker) + private static Job MakeMonoAOTLLVMJob(Job baseJob, CommandLineOptions options, string msBuildMoniker, RuntimeMoniker moniker) { - var monoAotLLVMRuntime = new MonoAotLLVMRuntime(aotCompilerPath: options.AOTCompilerPath, aotCompilerMode: options.AOTCompilerMode, msBuildMoniker: msBuildMoniker); + var monoAotLLVMRuntime = new MonoAotLLVMRuntime(aotCompilerPath: options.AOTCompilerPath, aotCompilerMode: options.AOTCompilerMode, msBuildMoniker: msBuildMoniker, moniker: moniker); var toolChain = MonoAotLLVMToolChain.From( new NetCoreAppSettings( diff --git a/src/BenchmarkDotNet/Environments/Runtimes/MonoAotLLVMRuntime.cs b/src/BenchmarkDotNet/Environments/Runtimes/MonoAotLLVMRuntime.cs index e81e64f6c6..0b5d2c159b 100644 --- a/src/BenchmarkDotNet/Environments/Runtimes/MonoAotLLVMRuntime.cs +++ b/src/BenchmarkDotNet/Environments/Runtimes/MonoAotLLVMRuntime.cs @@ -20,7 +20,7 @@ public class MonoAotLLVMRuntime : Runtime, IEquatable /// /// creates new instance of MonoAotLLVMRuntime /// - public MonoAotLLVMRuntime(FileInfo aotCompilerPath, MonoAotCompilerMode aotCompilerMode, string msBuildMoniker = "net6.0", string displayName = "MonoAOTLLVM") : base(RuntimeMoniker.MonoAOTLLVM, msBuildMoniker, displayName) + public MonoAotLLVMRuntime(FileInfo aotCompilerPath, MonoAotCompilerMode aotCompilerMode, string msBuildMoniker = "net6.0", string displayName = "MonoAOTLLVM", RuntimeMoniker moniker = RuntimeMoniker.MonoAOTLLVM) : base(moniker, msBuildMoniker, displayName) { if (aotCompilerPath == null) throw new ArgumentNullException(paramName: nameof(aotCompilerPath)); diff --git a/src/BenchmarkDotNet/Toolchains/Executor.cs b/src/BenchmarkDotNet/Toolchains/Executor.cs index 735c6f7437..145e527439 100644 --- a/src/BenchmarkDotNet/Toolchains/Executor.cs +++ b/src/BenchmarkDotNet/Toolchains/Executor.cs @@ -146,7 +146,7 @@ private static ProcessStartInfo CreateStartInfo(BenchmarkCase benchmarkCase, Art case MonoAotLLVMRuntime _: start.FileName = exePath; start.Arguments = args; - start.WorkingDirectory = artifactsPaths.BinariesDirectoryPath; + start.WorkingDirectory = Path.Combine(artifactsPaths.BinariesDirectoryPath, "publish"); break; case CustomRuntime _: start.FileName = exePath; diff --git a/src/BenchmarkDotNet/Toolchains/MonoAotLLVM/MonoAotLLVMGenerator.cs b/src/BenchmarkDotNet/Toolchains/MonoAotLLVM/MonoAotLLVMGenerator.cs index cd64739ba9..833c113d84 100644 --- a/src/BenchmarkDotNet/Toolchains/MonoAotLLVM/MonoAotLLVMGenerator.cs +++ b/src/BenchmarkDotNet/Toolchains/MonoAotLLVM/MonoAotLLVMGenerator.cs @@ -55,10 +55,10 @@ protected override void GenerateProject(BuildPartition buildPartition, Artifacts protected override string GetExecutablePath(string binariesDirectoryPath, string programName) => Portability.RuntimeInformation.IsWindows() - ? Path.Combine(binariesDirectoryPath, $"{programName}.exe") - : Path.Combine(binariesDirectoryPath, programName); + ? Path.Combine(binariesDirectoryPath, "publish", $"{programName}.exe") + : Path.Combine(binariesDirectoryPath, "publish", programName); protected override string GetBinariesDirectoryPath(string buildArtifactsDirectoryPath, string configuration) - => Path.Combine(buildArtifactsDirectoryPath, "bin", configuration, TargetFrameworkMoniker, CustomDotNetCliToolchainBuilder.GetPortableRuntimeIdentifier(), "publish"); + => Path.Combine(buildArtifactsDirectoryPath, "bin", configuration, TargetFrameworkMoniker, CustomDotNetCliToolchainBuilder.GetPortableRuntimeIdentifier()); } }