Skip to content

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Jul 13, 2019

This will skip linking of C++/CLI assemblies. See #651 for context.

There are potentially some issues with skipping the C++/CLI assembly entirely - any calls that the assembly makes to .NET dlls will no longer be analyzed. This may result in some required dependencies being dropped, though I don't know how likely that is in practice. The ideal fix would be to address #639 (or to preserve the ordering of the relevant C++/CLI data when linking as mentioned in #651 (comment)), which would still result in the assembly being analyzed.

I marked this do not merge until we have some more confidence that this is the right fix.

@sbomer
Copy link
Member Author

sbomer commented Jul 15, 2019

@vatsan-madhavan I'm going to try to push this change into the SDK seeing as we are late in the release and don't have much time to wait. If later we determine a better way to check for C++/CLI assemblies, I'll make the update then.

@marek-safar PTAL.

@marek-safar marek-safar merged commit a134e7f into dotnet:master Jul 15, 2019
@vatsan-madhavan
Copy link
Member

@sbomer , lgtm. We should get confirmation from @tgani-msft when he is back that the C++/CLI detection being used here will remain a reliable contract/pattern over time, and if necessary, change the detection logic based on his feedback.

vatsan-madhavan added a commit to dotnet/wpf that referenced this pull request Jul 25, 2019
…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.
ghost pushed a commit to dotnet/wpf that referenced this pull request Jul 26, 2019
* 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.

* Add netstandard and mscorlib to the list of dependencies
@ericstj
Copy link
Member

ericstj commented Jul 26, 2019

Why skip entirely? Just don't rewrite it, but still analyze its dependencies.

@sbomer
Copy link
Member Author

sbomer commented Jul 26, 2019

I'd like to do that in the future, but the fix will take some more discussion: #639. The linker supposedly is able to do this, but in reality rewrites more often than you might expect.

@vatsan-madhavan
Copy link
Member

I'd like to do that in the future, but the fix will take some more discussion: #639. The linker supposedly is able to do this, but in reality rewrites more often than you might expect.

Asking for my edification: Does inspecting an assembly using Mono.Cecil API's rewrite the assembly - or is the rewriting specific to the linker implementation?

@sbomer
Copy link
Member Author

sbomer commented Jul 26, 2019

@vatsan-madhavan I answered your question in #639 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants