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 EventSource trimmer warning #51237

Merged
merged 63 commits into from
Apr 20, 2021
Merged

Fix EventSource trimmer warning #51237

merged 63 commits into from
Apr 20, 2021

Conversation

LakshanF
Copy link
Member

Now that the trimmer has capability to preserve derived type members, fixed the warning related to manifest generation by preserving all members of EventSource and its derived types

LakshanF and others added 30 commits October 29, 2020 05:18
…iagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>
…iagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>
@benaadams
Copy link
Member

Net change is 0?
image

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM - This is great!

@@ -145,6 +145,7 @@ public enum EventOpcode
Send = 9,
Receive = 240,
}
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need All - is that because of the NestedTypes issue?
(we should fix that then - it's been agreed that we should change the behavior of that already).

@LakshanF
Copy link
Member Author

Opened dotnet/linker#1969 for the likely linker bug. Will not merge until this is understood

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

👍 : )

@LakshanF LakshanF merged commit ddaa1c3 into dotnet:main Apr 20, 2021
@LakshanF LakshanF deleted the EventSrcwrn3 branch April 20, 2021 12:07
agocke added a commit to agocke/runtime that referenced this pull request Apr 22, 2021
This fix is necessary for dotnet#51237 to
work properly. Otherwise, the linker may crash when analyzing certain patterns.
agocke pushed a commit to agocke/runtime that referenced this pull request 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)
mmitche pushed a commit that referenced this pull request Apr 22, 2021
* Include linker fix from dotnet/linker#1972

This fix is necessary for #51237 to
work properly. Otherwise, the linker may crash when analyzing certain patterns.

* Fix EventSource trimmer warning (#51237)

* 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)

Co-authored-by: Lakshan Fernando <[email protected]>
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants