-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Warnings by default when PublishTrimmed=true TrimMode=link #41654
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Dotnet-GitSync-Bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Sep 1, 2020
Tagging subscribers to this area: @vitek-karas, @agocke |
jeffschwMSFT
removed
the
untriaged
New issue has not been triaged by the area owner
label
Sep 1, 2020
eerhardt
added a commit
to eerhardt/runtime
that referenced
this issue
Sep 1, 2020
The CreateRuntimeRootILLinkDescriptorFile task, which generates most of S.P.CoreLib's ILLink.Descriptor file for coreclr, doesn't respect #ifdefs. So even though FEATURE_UTF8STRING is disabled in the release/5.0 branch, it is still generating entries for Char8 and Utf8String. But since these managed types do not exist, the ILLinker is raising warnings. To fix this, comment the DEFINE_CLASS entries out of the header file. Fix dotnet#41654
eerhardt
added a commit
that referenced
this issue
Sep 1, 2020
The CreateRuntimeRootILLinkDescriptorFile task, which generates most of S.P.CoreLib's ILLink.Descriptor file for coreclr, doesn't respect #ifdefs. So even though FEATURE_UTF8STRING is disabled in the release/5.0 branch, it is still generating entries for Char8 and Utf8String. But since these managed types do not exist, the ILLinker is raising warnings. To fix this, comment the DEFINE_CLASS entries out of the header file. Fix #41654
Resolved by #41680. |
ghost
locked as resolved and limited conversation to collaborators
Dec 7, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
dotnet new console
dotnet publish -r win-x64 /p:PublishTrimmed=true /p:TrimMode=link
This emits 2 warnings:
Configuration
Regression?
This is a regression from previous .NET 5 builds. Previously there were no warnings by default.
Other information
We've removed the
System.Char8
andSystem.Utf8String
managed types in the 5.0 RC1 builds. This is causing the ILLinker to emit warnings by default because we generate an ILLink.Descriptor file based off the headers in coreclr:If we are removing
System.Char8
andSystem.Utf8String
managed types, we need to also remove the code from coreclr's header files so the target in https://github.com/dotnet/runtime/blob/master/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets doesn't generate these entries in the ILLink.Descriptors file. See:runtime/src/coreclr/src/vm/corelib.h
Lines 321 to 323 in e94dc2f
and
runtime/src/coreclr/src/vm/corelib.h
Lines 852 to 861 in e94dc2f
cc @vitek-karas @sbomer @GrabYourPitchforks
The text was updated successfully, but these errors were encountered: