Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

fix grpc link issue #6959

Closed
wants to merge 1 commit into from
Closed

Conversation

szhaomsft
Copy link

this is a fix to #6375

with that, one can link using dotnet core

@@ -73,6 +73,11 @@ public static bool UseLazyResolution(MethodDesc method, string importModule, PIn
}
}

internal static bool IsRunningOnMono()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CoreRT compiler always runs on .NET Core today, so this condition is going to be always false.

This needs to be a new command line option. Something like --direct-pinvoke-calls:<regex to match>. And __Internal to be the default value of the option specified in the target file that you can override.

You can look for AutoInitializedAssemblies and initassembly for an existing command line option that follows similar pattern.

@MichalStrehovsky Anything you would add?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if so, I can just remove this check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have added this check for __Internal to make libraries written for Mono work (#5247 (comment)). There is no default that will make everybody happy - it is why it needs to be a command line option.

Copy link
Member

@MichalStrehovsky MichalStrehovsky Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I jotted down the structure here: 2a4cac8 but I ran out of time I allocated for myself to finish this.

@szhaomsft Can you apply this commit locally and help me finish it?

What we are going for is to allow specifying the list of pinvokes that should be bound directly as a command line option. One should be able to specify e.g. --directpinvoke:"\*" --directpinvoke:"api-ms-win.*" to specify these p/invokes should be hard bound.

The MSBuild targets file will make this flexible, so that once you finish this and we merge it, you'll be able to disable resolution of __Internal by adding an Exclude item for the __Internal entry in your CSPROJ file to disable the default rule.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted as #6980.

@jkotas jkotas closed this Feb 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants