-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Linker hints for C++/CLI dependencies #1387
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
…C++/CLI images. See dotnet/linker#651 and dotnet/linker#658. In turn, this results in a failure of dependencies of such assemblies (like System.Diagnostics.Debug.dll, which is required by DirectWriteForwarder.dll) from being identified and included in the ReadyToRun images. These linker hints tell ILLinker to include certain dependencies, which we know to be required by DirectWriteForwarder and System.Printing respectively.
|
/cc @sbomer |
|
/cc @fadimounir I don't see this fixing the orignal problem @sbomer. The xml files get embedded into PresentationCore & ReachFramework respectively. The published apps continue to fail as before - This is a screenshot of assemblies from within the temporary unzipped location, while running the published app under the debugger. |
|
I confirmed that the linker fix in dotnet/linker#675 keeps Otherwise the change LGTM. |
I believe these are bad type-refs. There are no such types in |
|
/cc @ericstj, do you have thoughts on whether we should include mscorlib and netstandard as well? |
|
Are the netstandard refs also bad? I'm seeing the following in MS.Internal.TrueTypeSubsetter.ComputeSubset: |
That looks fine to me. I see a |
3598ae8 to
78be6d0
Compare
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.
LGTM. Thank you for taking care of this!
|
Hello @vatsan-madhavan! 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 (
|
|
I'm not a fan of this hack. What keeps this list up to date? The linker should be able to traverse the C++/CLI assembly without rewriting it. |
|
Not a fan either, and I definitely hope to analyze them in the future and remove the roots. The alternative that I see to adding these roots now, short of fixing dotnet/linker#639, is to document a requirement for pretty much every linked WPF app to include these roots. Thoughts? Also, @vatsan-madhavan, based on discussion with @marek-safar it probably makes sense to make these embedded roots more specific, to only root the types that are needed by these assemblies. I need to check the behavior of type forwards, but I think we'll want to update them. |
|
Another alternative would be to include roots for System.Diagnostics.Debug but not netstandard/mscorlib. System.Diagnostics.Debug was being loaded for every app that renders text (see dotnet/linker#675 (comment)), but I wasn't seeing any failures for the mscorlib/netstandard dependencies, so they may be less common. |

Fixes #1385
When producing ReadyToRun images, the ILLinker is configured to skip C++/CLI images. See dotnet/linker#651 and dotnet/linker#658.
In turn, this results in a failure of dependencies of such assemblies (like System.Diagnostics.Debug.dll, which is required by DirectWriteForwarder.dll) from being identified and included in the ReadyToRun images.
These linker hints tell ILLinker to include certain dependencies, which we know to be required by DirectWriteForwarder and System.Printing respectively.
Also related: dotnet/linker#675