-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Stop using LocalizationResources within framework #86430
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
Fixes dotnet#81459. I moved the messages to `EventAttribute.Message` which I believe should be equivalent, but I would appreciate if someone could double-check. I also removed all the now-unused resource strings. I believe they all need to be prefixed by one of well-known prefixes. I would appreciate if someone could double-check.
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas Issue DetailsFixes #81459. I moved the messages to Cc @noahfalk @brianrob @eerhardt @dotnet/ilc-contrib
|
Name = "System.Threading.Tasks.TplEventSource", | ||
Guid = "2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5", | ||
LocalizationResources = | ||
#if CORECLR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was set up in dotnet/coreclr#22120. I don't think we really want to keep it this way, so I fixed that by adding Message unconditionally.
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
} | ||
} | ||
} | ||
// End of workaround for https://github.com/dotnet/runtime/issues/81459 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't still want this for cases where a 3rd-party uses LocalizationResources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't remove resources in user assemblies so this should not be needed for those unless the user does the same gestures to get them removed.
@MichalStrehovsky, if I understand correctly, the motivation for this change is that NativeAOT strips localized resources from framework assemblies, and so these strings aren't usable anyway within NativeAOT. Do I have that right? If so, the non-localized messages seem fine for NativeAOT, but AOT is also affected here. How should I think about this change in the context of non-AOT? |
This also affects non-aot - we have a documented non-aot trimming option to strip framework resources when trimming. The assumption for that was that resource strings are only used for exception messages, so we replace them with resource keys. Aot can sometimes do this more aggressively so I found this in aot testing, but this problem is reachable with normal trimming too. The issue has more context. |
Thanks @MichalStrehovsky for pointing me to the issue. It turns out that I already had the exact same thoughts and we discussed them already. The change looks good to me. From your notes at the beginning of the PR, yes, Message should be equivalent, it just won't be localized: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs#L4805-L4826. |
Fixes #81459.
I moved the messages to
EventAttribute.Message
which I believe should be equivalent, but I would appreciate if someone could double-check. I also removed all the now-unused resource strings. I believe they all need to be prefixed by one of well-known prefixes. I would appreciate if someone could double-check.Cc @noahfalk @brianrob @eerhardt @dotnet/ilc-contrib