-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix ILLink warnings for removed attributes when Debugger.IsSupported is false #40048
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
Conversation
|
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. |
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/Statics.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackTrace.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackTrace.cs
Outdated
Show resolved
Hide resolved
…is false When Debugger.IsSupported feature switch is false, we trim unnecessary attributes in the code - specifically attributes like CompilerGeneratedAttribute and StackTraceHiddenAttribute. However, we still have code accessing these attributes, which causes the ILLinker to warn that it is removing the attributes, but code still uses them. To fix this, remove these attributes from being trimmed when Debugger.IsSupported is false. Instead these attributes will be preserved always so things like "is anonymous type" checks and stack trace tostring will behave correctly. Fix dotnet#39707
dd9809a to
751e24a
Compare
|
Thanks everyone for the feedback. I am now removing fyi - @marek-safar |
|
@eerhardt what is the negative size impact of this change for Blazor and how are we going to mitigate it? |
I am not sure it is necessary to mitigate it. 3 KB compressed is a pretty minimal change when the total compressed app size is around 2.2 MB. |
|
Test failures are #40178. I believe this is ready to merge. Any other feedback? |
…is false (dotnet#40048) When Debugger.IsSupported feature switch is false, we trim unnecessary attributes in the code - specifically attributes like CompilerGeneratedAttribute and StackTraceHiddenAttribute. However, we still have code accessing these attributes, which causes the ILLinker to warn that it is removing the attributes, but code still uses them. To fix this, remove these attributes from being trimmed when Debugger.IsSupported is false. Instead these attributes will be preserved always so things like "is anonymous type" checks and stack trace tostring will behave correctly. Fix dotnet#39707
When
Debugger.IsSupportedfeature switch is false, we trim unnecessary attributes in the code - specifically attributes likeCompilerGeneratedAttributeandStackTraceHiddenAttribute. However, we still have code accessing these attributes, which causes the ILLinker to warn that it is removing the attributes, but code still uses them.To fix this, remove these attributes from being trimmed when Debugger.IsSupported is false. Instead these attributes will be preserved always so things like "is anonymous type" checks and stack trace tostring will behave correctly.
Fix #39707