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

Make it easy to run trimming for diagnostic purposes on libraries #12907

Open
vitek-karas opened this issue Aug 13, 2020 · 1 comment
Open

Make it easy to run trimming for diagnostic purposes on libraries #12907

vitek-karas opened this issue Aug 13, 2020 · 1 comment

Comments

@vitek-karas
Copy link
Member

Currently trimming and the ILLink task are designed to run on applications - and that is very easy (one or two MSBuild properties).
In .NET 5 we're introducing analysis in the linker where it can report potential issues in the app after trimming - can be enabled by setting SuppressTrimAnalysisWarnings=false.

Being able to run this analysis on just libraries would be really beneficial as library author could use it to make the libraries trim-ready. The general idea is to have some MSBuild way (properties and/or items) to:

  • Run ILLink just for analysis purposes - this could be completely without any output, just produce warnings
  • Configure which warnings to see (warning level, disable warnings, warnings as errors, ...)
  • Be able to focus on the library alone - so somehow disable warnings from references
  • Run ILLink on a library project (classlib) - this would mean root all public APIs in the assembly and run analysis from there
  • Run ILLink on a library project with produced output - not necessarily for shipping (although one day maybe even that), but to inspect the output for diagnostic reasons (for example find dead code in the library)
  • Going forward be able to control which types of analysis to run (trim-ready, single-file-ready, AOT-ready, ...)

Filed in SDK as this is mostly SDK experience feature, but I do expect work for this to also happen in the mono/linker repo and potentially also in the dotnet/runtime repo if necessary.

@vitek-karas vitek-karas added this to the 6.0.1xx milestone Aug 13, 2020
@vitek-karas
Copy link
Member Author

/cc @eerhardt @samsp-msft @sbomer @agocke

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

No branches or pull requests

2 participants