dotnet / BenchmarkDotNet

Powerful .NET library for benchmarking
https://benchmarkdotnet.org
MIT License
10.47k stars 962 forks source link

Unable to use `wasm` or `monoaotllvm` as runtime #2540

Closed caaavik-msft closed 7 months ago

caaavik-msft commented 7 months ago

With the recent change from https://github.com/dotnet/BenchmarkDotNet/pull/2523, we are unable to use wasm or monoaotllvm in the --runtimes argument like we could previously because the DotNetSdkValidator does not support it. Instead we have to use one which has the .NET version in it such as wasmnet9.0 or monoaotllvmnet9.0. I am not sure what the correct fix for this should be, but the dotnet/performance repo uses these two values for our WASM and Mono AOT LLVM runs, so this is blocking our ability to merge in the latest BDN.

timcassell commented 7 months ago

It looks like those monikers use the current runtime version if Core, or defaults to the earliest available version if Framework. https://github.com/dotnet/BenchmarkDotNet/blob/9a9d7e729059ea3a942f1b5347cecb0eeb7d1776/src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs#L573-L574

I guess the sdk validator just needs to be updated to use the same logic in GetSdkVersionFromMoniker function.

LoopedBard3 commented 7 months ago

Put up a PR that should fix the issue for both wasm and monoaotllvm: https://github.com/dotnet/BenchmarkDotNet/pull/2541