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

Resolve new ILLink warnings in Microsoft.Extensions.DependencyInjection #49887

Merged
merged 2 commits into from
Mar 21, 2021

Conversation

eerhardt
Copy link
Member

These two new warnings came in because of:

  1. Suppresses the trimmer warning on TypeAnalysis ctor #48823
  2. Resolve ILLink warnings in System.Linq.Expressions (Round 3) #47938

When we address #48488 we will be able to catch these in the future.

@ghost
Copy link

ghost commented Mar 19, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

These two new warnings came in because of:

  1. Suppresses the trimmer warning on TypeAnalysis ctor #48823
  2. Resolve ILLink warnings in System.Linq.Expressions (Round 3) #47938

When we address #48488 we will be able to catch these in the future.

Author: eerhardt
Assignees: -
Labels:

area-Extensions-DependencyInjection

Milestone: -

Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, how did you catch these? via a consuming application or do you locally run the linker against shared fx + oobs?

@eerhardt eerhardt added the linkable-framework Issues associated with delivering a linker friendly framework label Mar 19, 2021
@ghost
Copy link

ghost commented Mar 19, 2021

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @tannergooding, @sbomer
See info in area-owners.md if you want to be subscribed.

Issue Details

These two new warnings came in because of:

  1. Suppresses the trimmer warning on TypeAnalysis ctor #48823
  2. Resolve ILLink warnings in System.Linq.Expressions (Round 3) #47938

When we address #48488 we will be able to catch these in the future.

Author: eerhardt
Assignees: -
Labels:

area-Extensions-DependencyInjection, linkable-framework

Milestone: -

@eerhardt
Copy link
Member Author

Out of curiosity, how did you catch these? via a consuming application or do you locally run the linker against shared fx + oobs?

The short answer is locally run the linker against shared fx + DI assemblies

The whole story is with #49843 I tried removing a suppression in the DI code, and needed to run the linker to ensure the suppression I was removing was valid to remove (it wasn't). When looking at that warning, I noticed these two new warnings.

@joperezr
Copy link
Member

I see, if we wanted, we could theoretically use the trimming tests to catch if any new warnings are introduced even for OOBs. What I'm thinking is we could add a trimming test for DI where we don't suppress linker warnings, and we pass in a Suppressions.xml that has only the warnings that we are expecting, that way the build would break if new ones were introduced. Of course the ideal solution is to run the linker against OOBs as well, but this could be a point in time fix if we wanted.

@eerhardt
Copy link
Member Author

we could theoretically use the trimming tests to catch if any new warnings are introduced even for OOBs

That would only catch warnings in methods called by the trimming tests. It wouldn't catch warnings in other methods of the library.

I guess I'd prefer if we were to spend time, we would spend it on fixing #48488 for real.

@@ -29,6 +30,8 @@ private DependencyInjectionEventSource() : base(EventSourceSettings.EtwSelfDescr
// - A stop event's event id must be next one after its start event.
// - Avoid renaming methods or parameters marked with EventAttribute. EventSource uses these to form the event object.

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @LakshanF as an FYI - otherwise ignore this comment 😉

@stephentoub stephentoub merged commit 928380a into dotnet:main Mar 21, 2021
@eerhardt eerhardt deleted the DILinkWarnings branch March 22, 2021 15:08
@ghost ghost locked as resolved and limited conversation to collaborators Apr 21, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-DependencyInjection linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants