-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve warning message for ILLink runtime pack #33041
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
@@ -884,7 +884,7 @@ You may need to build the project on another operating system or architecture, o | |||
<comment>{StrBegin="NETSDK1194: "}{Locked="--output"}</comment> | |||
</data> | |||
<data name="ILLinkNoValidRuntimePackageError" xml:space="preserve"> | |||
<value>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</value> | |||
<value>NETSDK1195: Trimming, or code compatibility analysis for trimming, single-file deployment, or ahead-of-time compilation is not supported for the target framework.</value> |
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.
Definitely much better than before. But it's not actionable - it doesn't tell me what to do to "fix" this. Can we at least link to some doc (maybe just the trimming doc for now).
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.
The action item is really to do one of the following:
- Target a supported TFM
- Unset IsTrimmable
- Unset PublishTrimmed
- Unset IsAotCompatible
- Unset PublishAot
- Unset PublishSingleFile
- Unset EnableTrimAnalyzer
- Unset EnableAotAnalyzer
- Unset EnableSingleFileAnalyzer
The trimming doc probably shouldn't explain all of those. Maybe we can link to https://learn.microsoft.com/en-us/dotnet/core/deploying/ and add sections to that which mention trimming and AOT deployment? I think that'd be good enough even if it doesn't explicitly list properties like Enable*Analyzer
.
Another option is to produce separate errors depending on which of those properties was set. I think this would be the best option if we want to really commit to actionable errors. Let me know what you think!
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.
I'm adding a dedicated doc page for NETSDK1195 in dotnet/docs#35655 and linking to it here.
This reverts commit 29cd2bd.
The ILLink "runtime pack" is required for any of the ILLink analyzers (trimming, single-file, aot compatibility), as well as for trimming. This message is also only produced when those settings are enabled for an unsupported target framework. Hopefully this makes the error more clear.
Together with #32045, this should address dotnet/linker#3175 by providing an understandable error when someone tries to use the analyzer for netstandard library projects.