-
Notifications
You must be signed in to change notification settings - Fork 44
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
Api check tool is slow and cannot handle some projects #201
Comments
Thoughts on Roslyn. Disadvantage: requires source code. We lose ability to run api check on binaries. Advantage: VS integration (squiggles in txt editor) and CodeFixes. Thoughts in s.r.m. Disadvantage: API is really low level. I dont know anyone besides the clr team that knows how to use it. Advantage: its fast. |
We need to use the fast thing. Hard to use is really a bad excuse. We can also look at mono cecil (it's much friendlier and fast), if it has a .NET Core version (this tool should be .NET Core only since it doesn't need to load anything). Roslyn would be epic! CODEFIXES for all the things! |
I'm sure we can figure out s.r.m. Its not a reason to not do it but its something to be aware of. Cecil might be a good alternative. We ran into some issues with it in NugetPackageVerifier. #202 Haven't checked lately if newer versions of cecil resolved the errors. This is also something to be aware of, and could be a reason not to use it. |
@natemcmaster are the specific Cecil bugs tracked somewhere? Might be a good time to see which have and haven't been fixed. |
For sure this one #202. I'm not aware of the details on others issues we hit in cecil. I vaguely remember hearing it was still buggy but that was about a year ago. |
Which ones? |
…
With a fix I made last night, just one project attempts to load an assembly it can't: Microsoft.Extensions.Caching.SqlServer in the Caching repo. That project targets .NET Standard 1.2 but System.Data.SqlClient runtime assemblies are available only for .NET Standard 1.3 and up. So, this issue should focus on performance and usability, not fragility, at least for now. I'll update the description… |
- hits a `FileNotFoundException` because System.Data.SqlClient package lacks runtime assemblies for .NET Standard 1.2 - see aspnet/BuildTools#201
Before embarking on exploring any other implementation alternative I would make sure we weight what benefits that would have.
What repository, how many projects are in it, what percentage of the total build time that represents and what the delta is of the build time with the tool vs without it. As for running the tool within Visual Studio we decided at the time that this was not a goal for the tool #205 (comment) I personally think that it would be really annoying if the tool is in my face when I'm doing a breaking change (or preventing my build from succeeding in VS) and if I do a breaking change without noticing its not usually a big issue to revert it and work around it. So the questions that I would us to solve before doing any of this are:
/cc @Eilon in case he wants to chime in. |
Currently there are no plans to make any of these changes because the value isn't clear. |
Do we have existing numbers?
It would be super easy to validate this if we want numbers. |
Closing because there are no plans to do this. It's not clear what the value is, the cost for the proposed fixes is huge, and the problems it's causing are extremely limited (just one repo, which almost never gets changed). |
Meant to file aspnet/KoreBuild#207 here:
In the old world, API checks took 40 seconds for a single repo. Haven't measured it yet, but I suspect performance is worse now. (Improvements I imagined did not materialize.)
.NET Framework checks are a bit faster than .NET Core checks because it isn't necessary to parse the .deps.json file or calculate the entire package graph. But, that is not to say these checks are fast. The API check still loads assemblies for all referenced types.
Should investigate
twothree alternative approaches for loading information about the exposed APIs:System.Reflection.Metadata
exposes the metadata without needing information from referenced assemblies. The downside is this namespace offers a relatively low-level / hard-to-use surface. See ApiCheck: use System.Reflection.Metadata #198 for some upsides.dotnet Microsoft.AspNetCore.BuildTools.ApiCheck.dll
also crashes when analyzing some projects, usually withFileNotFoundException
orBadImageFormatException
. These problems will remain after addressing aspnet/KoreBuild#143 due to inherent limitations of using .deps.json files andSystem.Reflection
. Fortunately, these issues affect just one project across our Universe repos: Microsoft.Extensions.Caching.SqlServer in the Caching repo.The narrow set of the front fell off problems is somewhat minor compared to the speed of the tool.
The text was updated successfully, but these errors were encountered: