Skip to content
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

Linker doesn't support WinRT #1151

Closed
MichalStrehovsky opened this issue Apr 28, 2020 · 3 comments
Closed

Linker doesn't support WinRT #1151

MichalStrehovsky opened this issue Apr 28, 2020 · 3 comments

Comments

@MichalStrehovsky
Copy link
Member

Trying to scan System.Runtime.WindowsRuntime hits problems because linker doesn't seem to handle the projections well. It's possible we'll need features on the cecil side - see jbevain/cecil#394 that has Unity's WinRT support.

It's possible we can just close this as Won't fix when dotnet/runtime#35318 lands, but I think we should track this here for now (so that there's an issue to refer to).

@MichalStrehovsky MichalStrehovsky added this to the .NET5.0 milestone Apr 28, 2020
@marek-safar marek-safar removed this from the .NET5.0 milestone Apr 28, 2020
@eerhardt
Copy link
Member

Note we also have this in dotnet/runtime today:

https://github.com/dotnet/runtime/blob/19cc81be8e31a0d005d860952cf70f6b4ce2b0ae/eng/illink.targets#L65-L67

    <PropertyGroup>
      <!-- Currently ILLink cannot handle type projections from Windows.winmd, disable if the project references it -->
      <ILLinkTrimAssembly Condition="'%(ReferencePath.FileName)%(ReferencePath.Extension)' == 'Windows.winmd'">false</ILLinkTrimAssembly>
    </PropertyGroup>

If this gets fixed, we should be able to fix that. However, we might also need to worry about COM interfaces at that point. See #378 and dotnet/corefx#32491 (comment).

@mrvoorhe
Copy link
Contributor

In case it's ever of help, here is the logic we have in our UnityLinker to deal with com https://gist.github.com/mrvoorhe/ee5c2d8506e8f7489e683b0ab299e197

We probably have tests somewhere. Ping me if someone ever wants them.

@MichalStrehovsky
Copy link
Member Author

WinRT support won't be needed because .NET 5 WinRT support is moving out of the runtime to external tools that will run before linker.

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

No branches or pull requests

4 participants