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 ILLink warnings in Microsoft.Extensions.Hosting #55048

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Jul 1, 2021

I tried a couple different approaches here, but settled on the current iteration. The drawback of the current iteration is that if new code is added to this class, we are suppressing IL2091 even for the new code.

Alternative 1: Manually write the closures

eerhardt@f8e1199

I didn't like this approach because it is way too much manual code for one line, and the compiler has features to do this for us. It is replacing 1 line of code with 40.

Alternative 2: Use assembly level suppression with Scope/Target and only suppressing the individual warnings

This doesn't work - it suppresses the warnings for the whole assembly. I logged dotnet/linker#2127.

When that issue is fixed in the linker, we can convert this suppression over to that approach.

@eerhardt eerhardt added linkable-framework Issues associated with delivering a linker friendly framework area-Extensions-Hosting labels Jul 1, 2021
@ghost
Copy link

ghost commented Jul 1, 2021

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

Issue Details

I tried a couple different approaches here, but settled on the current iteration. The drawback of the current iteration is that if new code is added to this class, we are suppressing IL2091 even for the new code.

Alternative 1: Manually write the closures

eerhardt@f8e1199

I didn't like this approach because it is way too much manual code for one line, and the compiler has features to do this for us. It is replacing 1 line of code with 40.

Alternative 2: Use assembly level suppression with Scope/Target and only suppressing the individual warnings

This doesn't work - it suppresses the warnings for the whole assembly. I logged dotnet/linker#2127.

When that issue is fixed in the linker, we can convert this suppression over to that approach.

Author: eerhardt
Assignees: -
Labels:

area-Extensions-Hosting, linkable-framework

Milestone: -

@eerhardt eerhardt merged commit c1e5fcc into dotnet:main Jul 2, 2021
@eerhardt eerhardt deleted the HostingILLink branch July 2, 2021 14:34
@ghost ghost locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Hosting linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants