-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add ILVerify from the corert repo #35038
Conversation
No significant source modifications were made, only moving the code and any missing dependencies.
src/coreclr/src/build.proj
Outdated
@@ -10,6 +10,7 @@ | |||
<ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/runincontext/runincontext.csproj" /> | |||
<ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/r2rdump/R2RDump.csproj" /> | |||
<ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/ReadyToRun.SuperIlc/ReadyToRun.SuperIlc.csproj" /> | |||
<ProjectReference Condition="'$(BuildManagedTools)' == 'true'" Include="tools/ILVerification/ILVerification.csproj" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really have to land in coreclr. I'd love to use this even with coreclr build disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
90+% of sources for ILVerify are shared with the CoreCLR AOT compiler. It gets unnatural to have the sources in one place and the project including the sources in different place, just to make it fit better with top level build script.
Do any of these options look reasonable to you?
- Use it from package if you do not want to build CoreCLR?
- Invoke the build of this .csproj file from Mono build by default?
- Add a new subset for this so that you can build just the tool, without the rest of CoreCLR?
This is touching on larger problem that the current coreclr/mono directory structure is unfriendly to sharing. It is reasonable expect that we will want to share more and more in future. What should the directory structure friendly to sharing between coreclr/mono look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any of these options look reasonable to you?
I'd like to use dotnet tool ilverifier
regardless of what runtime I'm building.
This is touching on larger problem that the current coreclr/mono directory structure is unfriendly to sharing.
I think this is not necessarily about runtime sharing but about having a way to build shared tools for dotnet/runtime but I'm not opposed to solving both of these at once.
src/coreclr/src/tools/Common/TypeSystem/Common/ArrayOfTRuntimeInterfacesAlgorithm.cs
Outdated
Show resolved
Hide resolved
Thanks all! I created this PR because I'd really like to use ILVerify in Roslyn, but I admit I don't really understand how the layout or build for CoreCLR works. I made this a draft mostly so I could see how CI works, because it's not clear to me how things necessarily build or how the tests run. My overall goal would be to get this published as a NuGet package that Roslyn could pull in. Any advice on that front? Is CoreCLR still the right place to put this? Or should it go under libraries? Those shared files would be the main sticking point to moving it. Also, I can't figure out how to get the tests set up. It looks like XUnit isn't commonly used and I can't figure out where a good entry point would be for the tests. |
If this is build under CoreCLR:
If we were to decide that it is better to build this under libraries (see the other comment):
|
@jkotas Thanks! I haven't had time to look into the issues here. If you want to take over, that's fine by me. |
Happy to help. This should be running tests and publishing ILVerification library package now. The .pkgproj project to build the package is heavy-handed, but I could not find a better to do that under src/coreclr. The remaining part is to add ilverify global tool package. It may be better done as a separate follow up change. |
@jkoritzinsky @ViktorHofer Could you please take a look at Microsoft.ILVerification.pkgproj in this change? Is there a way to do it in a better way in the current build structure? |
It was not that hard to do, so I have done that as well.
|
LGTM |
/cc @dotnet/runtime-infrastructure |
https://dev.azure.com/dnceng/public/_build?definitionId=655&_a=summary for a list of jobs. First failure of this type is after the merge :( |
I will take a look |
Thanks @jashook! |
After a quick look I do not believe we support referencing managed tools projects currently like this from our test build: https://github.com/dotnet/runtime/pull/35038/files?file-filters%5B%5D=.csproj&file-filters%5B%5D=.ilproj#diff-f7c5c72ccd9aaf2be3cf9840805daccdR23. It seems to require us to have restored the managed tools which may have not have happened during the test build. |
In CI we would not have done this for example. |
/cc @jkoritzinsky |
Also just a build of clr+libs would not build our managed tools I believe @jkoritzinsky to correct me if I am wrong. |
For a quick repro |
Trying to verify if this is correct with:
|
This is failing for me with |
Still failing |
A lot of other coreclr tests will fail like this if you try to build without restore. |
Instead of doing
You can run:
That will restore and build. |
This should be fixed by #37388 |
@jkotas Was this tool actually published? I can't seem to find the package on nuget.org.
|
@nattthebear you'll need to add the dotnet tool install --global dotnet-ilverify --version "5.0.0-*" --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" |
@akoeplinger Thank you very much! Working here now 👍 |
No significant source modifications were made, only moving the code and any missing
dependencies.
Contributes to #13827