* Attempt at fixing Mono AOT LLVM

* Ensure runtime moniker is preserved

* Missed to update one spot
This commit is contained in:
Cameron Aavik 2024-03-08 12:01:05 +10:00 коммит произвёл GitHub
Родитель 63626bb357
Коммит 9a9d7e7290
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -571,19 +571,19 @@ namespace BenchmarkDotNet.ConsoleArguments
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 @@ namespace BenchmarkDotNet.ConsoleArguments
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(

Просмотреть файл

@ -20,7 +20,7 @@ namespace BenchmarkDotNet.Environments
/// <summary>
/// creates new instance of MonoAotLLVMRuntime
/// </summary>
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));

Просмотреть файл

@ -146,7 +146,7 @@ namespace BenchmarkDotNet.Toolchains
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;

Просмотреть файл

@ -55,10 +55,10 @@ namespace BenchmarkDotNet.Toolchains.MonoAotLLVM
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());
}
}