Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the dotnet global tool #1572

Merged
merged 5 commits into from
Oct 26, 2020
Merged

Remove the dotnet global tool #1572

merged 5 commits into from
Oct 26, 2020

Conversation

adamsitnik
Copy link
Member

In #1006 (0.11.4) we have introduced a new dotnet global tool.

By looking at the number of reported bugs I believe that the tool has not passed the test of time.

Why is that? Because it's based entirely on dynamic assembly loading which is very hard to get right in .NET and the fact that we support all existing .NET Runtimes (.NET, .NET Core, Mono, CoreRT) makes it even harder (if not impossible).

First of all, the .NET Runtime version of the assembly with benchmarks and the tool should match which in reality means that we should target:

  • netcoreapp2.0
  • netcoreapp2.1
  • netcoreapp2.2
  • netcoreapp3.0
  • netcoreapp3.1
  • net5.0

If there is no match, the users get errors: #1347, #1249

As of today, the tool targets only netcoreapp2.1:

<TargetFramework>netcoreapp2.1</TargetFramework>

Because this is what our CI targets. We could add all the TFMs to our CI (like in #1254), but it would increase the time it takes to run our test suite (we used to get a lot of timeout in the past and I am sure that they would come back). Moreover, it would raise the bar for contributing to the project because the new contributors would have to install all the mentioned SDKs.

Second of all, despite having a custom assembly resolver, our users very often run into issues with dynamic assembly loading and missing dependencies: #1355, #1371, #1435, #1444, #1460

I am sure that we could extend the custom assembly resolver and solve some of this bugs, but in my opinion it would never be working in all possible scenarios (due to the complexity of dependency resolving and dynamic loading).

Last but not least, the tool does not solve the most important problem: the need of having the source code of the benchmarks and .NET SDK installed on the machine. It's using the same logic that BenchmarkRunner does: it generates a new project file and references the project with benchmarks and builds it. If we ever want to tackle this problem, I believe that we should rather go with an option that publishes a self-contained .NET app that can be copied to other machine and executed without having .NET SDK installed.

I believe that we won't have time to fix all these issues and the design based on dynamic assembly loading would never be futureproof and the tool should just be removed.

Our users who started with the tool and then switched to old good BenchmarkSwitcher confirm this:
#1460 (comment)

obraz

@AndreyAkinshin let's discuss it on Monday during our call. I know that you don't like removing things from BenchmarkDotNet, but I believe that this is the best solution.

Fixes #1254
Fixes #1347 Fixes #1249
Fixes #1355 Fixes #1371 Fixes #1435, Fixes #1444, Fixes #1460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment