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

Backport #51237 to release/6.0-preview4 #51672

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

agocke
Copy link
Member

@agocke agocke commented Apr 22, 2021

Description

This fixes the last trimming warning in HelloWorld. The last remaining trim warningis from EventSource – it’s warning about reflection on implementors. The first fix is just a backport of #51237 to add the appropriate annotation to preserve members on types inheriting from EventSource. The fix also requires the linker to understand how to keep types through inheritance, which we implemented shortly before the snap. A bug was found and fixed (dotnet/linker#1972) in that feature just after the snap. That fix is the sole change in the new version of the linker included here.

Customer Impact

There is an unactionable EventSource warning produced by almost all trimming on .NET 6.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

The change in runtime is just attributes. The change in the linker fixes a bug that would still exist without the fix.

Verification

  • [] Manual
  • Automated

Packaging changes reviewed?

  • Yes
  • [] No
  • [X ] N/A

This fix is necessary for dotnet#51237 to
work properly. Otherwise, the linker may crash when analyzing certain patterns.
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@agocke agocke changed the title Include linker fix from mono/linker#1972 Backport #51237 to release/6.0-preview4 Apr 22, 2021
* eh fix

* test change that inadvertently got checked in earlier

* Suppresses the trimmer warning on TypeAnalysis ctor

* Incorporating FB

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>

* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>

* Fix DynamicDependency as per PR feedback

* an earlier change got reverted

* fixed proj file netcore app condition check

* fixed NETCORE_ENGINEERING_TELEMETRY build failures

* fixeing another NETCORE_ENGINEERING_TELEMETRY build failures

* Adding RequiresUnreferencedCode to TypeAnalysis ctor instead of suppressing the warning to get FB, not fully fixed

* PR FB and suppressing warnings for safe calls

* propagated the warning all the way up

* CI build break fix for one file

* excluding NativeRTEventSrc from being build in a project

* Missed couple of supppressions on NativeRTEventSrc

* build break fixes

* Trimmer warning fix related to EventSource manifest creation

* incorporate fb

* fix build break in some configs

* comment feedback

* build break

Co-authored-by: Eric Erhardt <[email protected]>
(cherry picked from commit ddaa1c3)
@agocke
Copy link
Member Author

agocke commented Apr 22, 2021

Approved by Tactics over email.

@agocke agocke added the linkable-framework Issues associated with delivering a linker friendly framework label Apr 22, 2021
@ghost
Copy link

ghost commented Apr 22, 2021

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

Issue Details

Description

This fixes the last trimming warning in HelloWorld. The last remaining trim warningis from EventSource – it’s warning about reflection on implementors. The first fix is just a backport of #51237 to add the appropriate annotation to preserve members on types inheriting from EventSource. The fix also requires the linker to understand how to keep types through inheritance, which we implemented shortly before the snap. A bug was found and fixed (dotnet/linker#1972) in that feature just after the snap. That fix is the sole change in the new version of the linker included here.

Customer Impact

There is an unactionable EventSource warning produced by almost all trimming on .NET 6.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

The change in runtime is just attributes. The change in the linker fixes a bug that would still exist without the fix.

Verification

  • [] Manual
  • Automated

Packaging changes reviewed?

  • Yes
  • [] No
  • [X ] N/A
Author: agocke
Assignees: -
Labels:

ask-mode, linkable-framework

Milestone: -

@ghost
Copy link

ghost commented Apr 22, 2021

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

Issue Details

Description

This fixes the last trimming warning in HelloWorld. The last remaining trim warningis from EventSource – it’s warning about reflection on implementors. The first fix is just a backport of #51237 to add the appropriate annotation to preserve members on types inheriting from EventSource. The fix also requires the linker to understand how to keep types through inheritance, which we implemented shortly before the snap. A bug was found and fixed (dotnet/linker#1972) in that feature just after the snap. That fix is the sole change in the new version of the linker included here.

Customer Impact

There is an unactionable EventSource warning produced by almost all trimming on .NET 6.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

The change in runtime is just attributes. The change in the linker fixes a bug that would still exist without the fix.

Verification

  • [] Manual
  • Automated

Packaging changes reviewed?

  • Yes
  • [] No
  • [X ] N/A
Author: agocke
Assignees: -
Labels:

area-System.Runtime, ask-mode, linkable-framework

Milestone: -

@ghost
Copy link

ghost commented Apr 22, 2021

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

Issue Details

Description

This fixes the last trimming warning in HelloWorld. The last remaining trim warningis from EventSource – it’s warning about reflection on implementors. The first fix is just a backport of #51237 to add the appropriate annotation to preserve members on types inheriting from EventSource. The fix also requires the linker to understand how to keep types through inheritance, which we implemented shortly before the snap. A bug was found and fixed (dotnet/linker#1972) in that feature just after the snap. That fix is the sole change in the new version of the linker included here.

Customer Impact

There is an unactionable EventSource warning produced by almost all trimming on .NET 6.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

The change in runtime is just attributes. The change in the linker fixes a bug that would still exist without the fix.

Verification

  • [] Manual
  • Automated

Packaging changes reviewed?

  • Yes
  • [] No
  • [X ] N/A
Author: agocke
Assignees: -
Labels:

area-System.Diagnostics.Tracing, ask-mode, linkable-framework

Milestone: -

@eerhardt
Copy link
Member

The fix also requires the linker to understand how to keep types through inheritance, which we implemented shortly before the snap. A bug was found and fixed (dotnet/linker#1972) in that feature just after the snap. That fix is the sole change in the new version of the linker included here.

Will this version of the linker also get backported into the preview4 SDK?

@sbomer
Copy link
Member

sbomer commented Apr 22, 2021

Looks like the preview4 SDK already has a later version (they snapped a couple days later than runtime) https://github.com/dotnet/sdk/blob/c95bbcc2cb86abe93d83782c9812c87655e1c4d2/eng/Versions.props#L77

@agocke
Copy link
Member Author

agocke commented Apr 22, 2021

Ah, well, even better. I'll revert the props change actually it's probably right to keep this in here, just in case we hit the crash in the runtime repo itself.

@eerhardt
Copy link
Member

actually it's probably right to keep this in here, just in case we hit the crash in the runtime repo itself.

I would expect it is needed because CI was failing for @LakshanF without the linker bug fix. So I think what you have now is correct.

@mmitche mmitche merged commit 96999bc into dotnet:release/6.0-preview4 Apr 22, 2021
@agocke agocke deleted the backport-linker-1972 branch April 22, 2021 21:03
@ghost ghost locked as resolved and limited conversation to collaborators May 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Diagnostics.Tracing linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants