Fix Mono AOT LLVM (#2539)
* Attempt at fixing Mono AOT LLVM * Ensure runtime moniker is preserved * Missed to update one spot
This commit is contained in:
Родитель
63626bb357
Коммит
9a9d7e7290
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче