Skip to content

Remove Microbenchmarks .NET 6 hard-coded toolchain #2680

@AndreReise

Description

@AndreReise

I've tried to run the microbenchmarks locally and ran into the following error while generating the BDN boilerplate code:

 Standard error:
   Determining projects to restore...
C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\bin\Release\net10.0\Grpc.AspNetCore.Microbenchmarks-1\BenchmarkDotNet.Autogenerated.csproj : error NU1201: Project Grpc.AspNetCore.Microbenchmarks is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Project Grpc.AspNetCore.Microbenchmarks supports: net10.0 (.NETCoreApp,Version=v10.0)
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Core.Api\Grpc.Core.Api.csproj (in 173 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Net.Common\Grpc.Net.Common.csproj (in 173 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Net.Client\Grpc.Net.Client.csproj (in 177 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj (in 167 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.AspNetCore.Server.ClientFactory\Grpc.AspNetCore.Server.ClientFactory.csproj (in 167 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.AspNetCore\Grpc.AspNetCore.csproj (in 182 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Net.ClientFactory\Grpc.Net.ClientFactory.csproj (in 184 ms).
  Failed to restore C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\bin\Release\net10.0\Grpc.AspNetCore.Microbenchmarks-1\BenchmarkDotNet.Autogenerated.csproj (in 148 ms).
  Restored C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\Grpc.AspNetCore.Microbenchmarks.csproj (in 200 ms).

// BenchmarkDotNet has failed to build the auto-generated boilerplate code.
// It can be found in C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\bin\Release\net10.0\Grpc.AspNetCore.Microbenchmarks-1
// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html

For the context, I don't have .NET6 runtime/sdk installed.

The issue is that the .NET 6 toolchain is hard-coded here, which was introduced in da6dcc5. I suppose it was done because at that time BDN didn’t support .NET 6 targets.

This issue can be worked around by running benchmarks specifying a concrete runtime, e.g.: dotnet run -c Release -- --runtimes net10.0

However, it still outputs broken .NET 6 target results:

Image

How about removing that hard-coded toolchain target?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions