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

Updating Xamarin sample with proper linker settings #2702

Merged
merged 3 commits into from
Oct 7, 2020

Conversation

codemillmatt
Copy link
Contributor

Xamarin.iOS requires the linker behavior to be set to Don't Link. Updating the sample to have the linker set to that value for all build configurations and updating the readme to note that as well.

@codemillmatt
Copy link
Contributor Author

@JeremyLikness for review.

@JeremyLikness
Copy link
Member

@codemillmatt few questions for this PR:

  1. Is --interpreter still needed or not? If yes, can we update the doc to explain why?

  2. When I follow the link for the linker options, I see this:

Disabling linking will make sure that no assemblies are modified. For performance reasons this is the default setting when your IDE targets for the iOS simulator. For devices builds this should only be used as a workaround whenever the linker contains a bug that prevents your application to run. If your application only works with -nolink, please submit a bug report.

(Emphasis added my own). Is it possible to turn off linking just for the Entity Framework package? Is this solution a workaround (we should note that in the doc) or a permanent one?

Jeremy

@codemillmatt
Copy link
Contributor Author

Hey @JeremyLikness ...

  1. --interpreter is no longer needed.

  2. And I wanted to talk with you about linking/not linking Entity Framework. Right now when I tell the linker to skip the EF packages I still get the exception. I would suspect then that EF is using something further down the chain the linker needs. Or maybe not ... I'm going to pull the EF source into the solution & see what I can find out. Ideally we can then add [Preserve] attributes to the correct spots and make a permanent fix.

@codemillmatt
Copy link
Contributor Author

codemillmatt commented Sep 29, 2020

fwiw - it looks like it's the QueryableMethods constructor where the issue is originating from.

@codemillmatt
Copy link
Contributor Author

A little more digging - since QueryableMethods is doing a bunch of reflection - something that eventually gets used based off that class (in this particular case it will be Count) gets linked out.

But if I do a --linkskip System.Core all is well without having to turn off linking altogether.

Now with that said, it would be nice if we could narrow this down a bit more, so I'll still do some digging.

@JeremyLikness
Copy link
Member

@codemillmatt thanks for your efforts with this! Is it in a state ready for review or are you still working on it?

@codemillmatt
Copy link
Contributor Author

@JeremyLikness - yes - please do give it a review. If it's good let's merge this in.

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.

2 participants