-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Resolve ILLink warnings for System.Resources.ResourceManager #47778
Conversation
Tagging subscribers to this area: @tarekgh, @buyaa-n, @krwq Issue Detailscc: @eerhardt @marek-safar @vitek-karas @ericstj Resolving remaining ILLinker warnings on System.Resources.ResourceManager. This will introduce a feature switch
|
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Resources.Extensions/src/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @tannergooding, @sbomer Issue Detailscc: @eerhardt @marek-safar @vitek-karas @ericstj Resolving remaining ILLinker warnings on System.Resources.ResourceManager. This will introduce a feature switch
|
src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj
Outdated
Show resolved
Hide resolved
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.
Thanks for tackling this @joperezr!
src/libraries/System.Resources.ResourceManager/tests/TrimCompatibilityTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Resources.ResourceManager/System.Resources.ResourceManager.sln
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
...tem.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnreferencedCodeAttribute.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Suppressions.LibraryBuild.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
Show resolved
Hide resolved
CustomType.resources is a binary file. Is it possible to use a |
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Resources.ResourceManager/tests/TrimCompatibilityTests.cs
Outdated
Show resolved
Hide resolved
...braries/System.Resources.ResourceManager/tests/System.Resources.ResourceManager.Tests.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs
Outdated
Show resolved
Hide resolved
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.
Looks great to me. Thanks for the great work here, @joperezr.
I just had one minor nit about the ordering to allow a tiny more bit of code to be trimmed. But I believe this is ready to be merged.
Hello @joperezr! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@joperezr how is the "The sdk PR setting this switch as default will come after this PR gets merged." coming along? |
It’s merged: dotnet/sdk#15702 sorry that I didn’t link it here before. |
cc: @eerhardt @marek-safar @vitek-karas @ericstj
fixes #45272
fixes #32862
Resolving remaining ILLinker warnings on System.Resources.ResourceManager.
This will introduce a feature switch
System.Resources.AllowReflectionForNonPrimitiveObjects
that can be set via AppContext which will control whether or not you can use ResourceManager to read/write non primitive types. By default, we are thinking of setting this switch tofalse
when publishing a trimmed app, as it won't be safe as the trimmer won't be able to tell which types are present on the resources stream and need to be preserved. For published apps that manually specify this switch totrue
They should get a warning saying that some code paths might require unreferenced code, so that they make sure to keep the types they expect to use and then disable the warning if appropriate. The sdk PR setting this switch as default will come after this PR gets merged.