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

Fix ILLink warnings in .NET Libraries #45623

Closed
eerhardt opened this issue Dec 5, 2020 · 0 comments · Fixed by #55856
Closed

Fix ILLink warnings in .NET Libraries #45623

eerhardt opened this issue Dec 5, 2020 · 0 comments · Fixed by #55856
Assignees
Labels
area-Meta Cost:XL Work that requires one engineer more than 4 weeks linkable-framework Issues associated with delivering a linker friendly framework Team:Libraries Team:Runtime tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented Dec 5, 2020

In .NET 6, we plan on addressing the ILLink warnings in the .NET shared framework. This issue is to track the overall progress, and list ownership of the areas that needs work.

The work needs to happen from the "bottom up", similar to nullable annotations. This is because addressing linker warnings in a lower-level library can cause new warnings in a higher-level library calling that API. I've grouped the assemblies in the same order as #2339.

The assumption is that each assembly/area can have multiple PRs addressing it. The PRs will be split up as makes sense for ease of reviewing and making progress.

Group Assembly Team Assignee Done
0 System.Private.CoreLib - COM CoreCLR LakshanF
0 System.Private.CoreLib - EventSource CoreCLR LakshanF
0 System.Private.CoreLib - StartupHook CoreCLR mateoatr
0 System.Private.CoreLib - Mono Mono eerhardt
0 System.Private.CoreLib - Resources Libraries joperezr
0 System.Private.CoreLib - Reflection Libraries eerhardt
0 System.Private.CoreLib - Other Libraries eerhardt
0 System.Runtime.InteropServices Libraries eerhardt
1 System.ObjectModel Libraries eerhardt
1 System.Text.RegularExpressions Libraries eerhardt
1 System.Text.Json Libraries eerhardt/steveharter
1 System.Runtime.Serialization.Formatters Libraries eerhardt
1 System.Reflection.DispatchProxy Libraries eerhardt
1 System.Reflection.TypeExtensions Libraries eerhardt
1 System.Diagnostics.DiagnosticSource Libraries eerhardt
1 System.Drawing.Primitives Libraries eerhardt
2 System.Linq.Expressions Libraries eerhardt
3 System.Security.Cryptography.Algorithms Libraries eerhardt
3 System.Linq.Queryable Libraries eerhardt
4 System.Security.Cryptography.X509Certificates Libraries eerhardt
4 System.Diagnostics.TraceSource Libraries eerhardt
5 System.Security.Cryptography.Csp Libraries eerhardt
5 Microsoft.VisualBasic.Core Libraries joperezr
6 System.Net.Http.Json Libraries eerhardt
7 Microsoft.CSharp Libraries kwicher
7 System.Private.Xml Libraries joperezr/angocke
7 System.Net.Http Libraries joperezr
8 System.ComponentModel.TypeConverter Libraries eerhardt
8 System.Data.Common Libraries kwicher
8 System.Private.DataContractSerialization Libraries joperezr
9 System.ComponentModel.Annotations Libraries eerhardt

See #44035 (comment) for the initial categorization, count, and rough cost estimate of ILLink warnings.

cc @agocke @LakshanF @vitek-karas @marek-safar

@eerhardt eerhardt added area-Meta linkable-framework Issues associated with delivering a linker friendly framework Team:Libraries Team:Runtime labels Dec 5, 2020
@eerhardt eerhardt added this to the 6.0.0 milestone Dec 5, 2020
@eerhardt eerhardt added this to Uncommitted in Linker optimization work via automation Dec 5, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Dec 5, 2020
@eerhardt eerhardt removed the untriaged New issue has not been triaged by the area owner label Dec 5, 2020
@marek-safar marek-safar added the tracking This issue is tracking the completion of other related issues. label Dec 7, 2020
eerhardt added a commit to eerhardt/runtime that referenced this issue Dec 7, 2020
eerhardt added a commit to eerhardt/runtime that referenced this issue Dec 7, 2020
In order to make the code trimming-compatible, a slight behavior change was made. The SetupJSContinuation method will only get the Result of Task<TResult> objects. If an object derives from the base Task class, and defines its own Result property, SetupJSContinuation will no longer respect that property.

This was done so the behavior remains consistent between trimmed and untrimmed applications.

Contributes to dotnet#45623
eerhardt added a commit that referenced this issue Dec 8, 2020
* Address remaining Ref.Emit ILLink warnings in Mono.

Contributes to #45623

* Remove mono suppressions file from illink-sharedframework.targets
eerhardt added a commit to eerhardt/runtime that referenced this issue Dec 9, 2020
Also clean up some previously addressed warnings in the suppressions xml file.

Contributes to dotnet#45623
eerhardt added a commit that referenced this issue Dec 9, 2020
* Address ILLink warning in InteropServices.JavaScript

In order to make the code trimming-compatible, a slight behavior change was made. The SetupJSContinuation method will only get the Result of Task<TResult> objects. If an object derives from the base Task class, and defines its own Result property, SetupJSContinuation will no longer respect that property.

This was done so the behavior remains consistent between trimmed and untrimmed applications.

Contributes to #45623
eerhardt added a commit that referenced this issue Dec 11, 2020
* Remove ILLink warnings from empty console app

Also clean up some previously addressed warnings in the suppressions xml file.

Contributes to #45623

* Add trimming test for inherited attributes.
eerhardt added a commit to eerhardt/runtime that referenced this issue Dec 15, 2020
eerhardt added a commit that referenced this issue Dec 16, 2020
* Add RequiresUnreferencedCode to Delegate constructors

Contributes to #45623

* Add RequiresUnreferencedCode to some internal Reflection methods to address ILLink warnings.

* Address remaining ILLink warnings in Reflection.Emit.

* Respond to PR feedback

Annotate Delegate.BindToMethod with DynamicallyAccessedMembers

Fix up requires unreferenced code comments

* Update API Compat txt for Delegate.CreateDelegate attribute removal

* Fix Mono ILLink warnings
eerhardt added a commit to eerhardt/runtime that referenced this issue Apr 15, 2021
eerhardt added a commit that referenced this issue Apr 16, 2021
#51344)

* Resolve ILLink warnings in System.ComponentModel.TypeConvert (Final)

Contributes to #45623
eerhardt added a commit to eerhardt/runtime that referenced this issue Apr 28, 2021
Also resolve ILLink warnings in System.Net.Http.Json.

Contributes to dotnet#45623
ghost pushed a commit that referenced this issue Apr 28, 2021
* Resolve ILLink warnings in System.Text.Json (Round 1)

Also resolve ILLink warnings in System.Net.Http.Json.

Contributes to #45623

* PR feedback
eerhardt added a commit to eerhardt/runtime that referenced this issue Jun 1, 2021
Follow up to dotnet#52934.

- Using JsonNode in dynamic statements is not trim compatible. Add a LibraryBuild warning since there isn't a direct API to put the warning on.
- Mark JsonValueNotTrimmable's ctor as unsafe
- Fix up a few warning messages
- minor doc fixup

Contributes to dotnet#45623
eerhardt added a commit that referenced this issue Jun 2, 2021
Follow up to #52934.

- Using JsonNode in dynamic statements is not trim compatible. Add a LibraryBuild warning since there isn't a direct API to put the warning on.
- Mark JsonValueNotTrimmable's ctor as unsafe
- Fix up a few warning messages
- minor doc fixup

Contributes to #45623
eerhardt added a commit to eerhardt/runtime that referenced this issue Jul 16, 2021
Suppress ILLink warnings for operator methods now that dotnet/linker#1821 is resolved.

Add TrimmingTests for Linq.Expressions operators.

Fix dotnet#45623
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 16, 2021
Linker optimization work automation moved this from Uncommitted to Done Jul 21, 2021
AppModel NET 6.0 automation moved this from In Progress to Done Jul 21, 2021
eerhardt added a commit that referenced this issue Jul 21, 2021
* Resolve ILLink warnings in System.Linq.Expressions (Final)

Suppress ILLink warnings for operator methods now that dotnet/linker#1821 is resolved.

Add TrimmingTests for Linq.Expressions operators.

Fix #45623
Triage POD for Meta, Reflection, etc automation moved this from 6.0 to Done Jul 21, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 21, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta Cost:XL Work that requires one engineer more than 4 weeks linkable-framework Issues associated with delivering a linker friendly framework Team:Libraries Team:Runtime tracking This issue is tracking the completion of other related issues.
Development

Successfully merging a pull request may close this issue.

5 participants