Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MichalStrehovsky
Copy link
Member

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

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.
@ghost ghost added the area-Tools-ILLink .NET linker development as well as trimming analyzers label May 18, 2023
@ghost
Copy link

ghost commented May 18, 2023

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: MichalStrehovsky
Assignees: -
Labels:

area-Tools-ILLink

Milestone: -

Name = "System.Threading.Tasks.TplEventSource",
Guid = "2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5",
LocalizationResources =
#if CORECLR
Copy link
Member Author

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.

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

}
}
}
// End of workaround for https://github.com/dotnet/runtime/issues/81459
Copy link
Member

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?

Copy link
Member Author

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.

@brianrob
Copy link
Member

@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?

@MichalStrehovsky
Copy link
Member Author

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.

@brianrob
Copy link
Member

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.

@MichalStrehovsky MichalStrehovsky merged commit 6fd4019 into dotnet:main May 21, 2023
@MichalStrehovsky MichalStrehovsky deleted the fix81459 branch May 21, 2023 03:58
@ghost ghost locked as resolved and limited conversation to collaborators Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource message stripping not compatible with our event sources
3 participants