dotnet / performance

This repo contains benchmarks used for testing the performance of all .NET Runtimes
MIT License
691 stars 268 forks source link

"MSBUILD : error MSB1008: Only one project can be specified" for local dotnet/runtime builds #1605

Closed EgorBo closed 3 years ago

EgorBo commented 3 years ago

Hi, sorry for a stupid question but I tried to follow the https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md workflow in order to run benchmarks on a locally built dotnet/runtime on Windows (used to work like a charm for me on macOS always)

I did

cd performance\src\benchmarks\micro
dotnet run -c Release -f netcoreapp5.0

but it complained on missing net6.0 TFM (was introduced quite recently) - OK, I've downloaded the latest daily and installed, now when I run:

dotnet run -c Release -f netcoreapp5.0 --coreRun \
C:\prj\runtime\artifacts\bin\testhost\net6.0-windows-Release-x64\shared\Microsoft.NETCore.App\6.0.0\CoreRun.exe

it allows me to pick the benchmark but then all of the temp project fail with:

 Standard error:
 For switch syntax, type "MSBuild -help"
Switch: BuildInParallel=false
MSBUILD : error MSB1008: Only one project can be specified.

// BenchmarkDotNet has failed to build the auto-generated boilerplate code.
// It can be found in C:\prj\performance\artifacts\bin\MicroBenchmarks\Release\netcoreapp5.0\45c5ab52-4516-407e-b334-8375a23bee57
// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html

I've opened this temp project and dotnet restore works there, but not when I provide all of those switches:

dotnet restore /p:DebugType=portable /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true
billwert commented 3 years ago

Which benchmark did you pick? I just tried a couple and it worked, using the release 5.0 package. I didn't install 6.0. (You can get around the error you saw by setting PERFLAB_TARGET_FRAMEWORKS=netcoreapp5.0.

wzchua commented 3 years ago

Having the net6.0 SDK installed seems to break the dotnet restore

However, uninstalling net6.0 SDK and setting PERFLAB_TARGET_FRAMEWORKS=netcoreapp5.0 works

adamsitnik commented 3 years ago

@stephentoub has hit it as well and reported a bug here: https://github.com/dotnet/sdk/issues/14691

adamsitnik commented 3 years ago

@EgorBo @stephentoub a workaround would be to use the python script to download 5.0 SDK and tell BDN to use 6.0 corerun (corerun does not care if the app is compiled for same version of .NET Core):

py .\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter $yourfiler --corerun C:\prj\runtime\artifacts\bin\testhost\net6.0-windows-Release-x64\shared\Microsoft.NETCore.App\6.0.0\CoreRun.exe
billwert commented 3 years ago

This was a point-in-time issue with the command line port.