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

[regression] iOS app build fails when referencing package (e.g. Entity Framework Core 2.1) that depends on newer System.Memory in d15-9 #4761

Closed
rolfbjarne opened this issue Sep 6, 2018 · 3 comments
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS regression The issue or pull request is a regression
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Sep 6, 2018

Steps to Reproduce

  1. Install Xamarin.iOS 11.16 (d15-9)
  2. Download, extract, open & build https://github.com/xamarin/xamarin-macios/files/2350303/iOSEFCore212.zip

Expected Behavior

No build failure (just like in d15-8).

Actual Behavior

MTOUCH : error MT2101: Can't resolve the reference 'System.ReadOnlySpan`1<System.Char> System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)', referenced from the method 'System.ReadOnlySpan`1<System.Char> Microsoft.Extensions.Primitives.StringSegment::AsSpan()' in 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [/Users/rolf/Downloads/iOSEFCore21/iOSEFCore21.csproj]

This is a repeat/regression of #4168, just that it only happens in d15-9.

Build Logs

Failing build log (with Xamarin.iOS 11.16.0.26): https://gist.github.com/rolfbjarne/9b1cecf7968f6958a667204dda49a09f
Working build log (with Xamarin.iOS 11.14.0.14): https://gist.github.com/rolfbjarne/a4e0a0859a627777f8302cda841ada19
Diff between build logs: https://gist.github.com/rolfbjarne/76c1dab569d0994497a8754910a5de63

The significant difference seems to be that we're shipping System.Memory.dll in d15-9, which we end up using, while in d15-8 we use the nuget-provided version:

https://gist.github.com/rolfbjarne/76c1dab569d0994497a8754910a5de63#file-build-diff-L47-L52
https://gist.github.com/rolfbjarne/76c1dab569d0994497a8754910a5de63#file-build-diff-L207

This is supported by the fact that if I remove the System.Memory.dll we ship in d15-9:

rm /Library/Frameworks/Xamarin.iOS.framework/Versions/11.16.0.26/lib/mono/Xamarin.iOS/Facades/System.Memory.dll

then the project builds fine.

The project also builds fine if I use a version of Xamarin.iOS that has bumped to mono 2018-06 (from PR #4277):

which seems to indicate that this is a problem in mono's 2018-04 branch (d15-8 used mono's 2018-02 branch, while d15-9 is using mono's 2018-04 branch).

@rolfbjarne rolfbjarne added this to the d15-9 milestone Sep 6, 2018
@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS regression The issue or pull request is a regression labels Sep 6, 2018
@rolfbjarne rolfbjarne changed the title iOS app build fails when referencing package (e.g. Entity Framework Core 2.1) that depends on newer System.Memory in d15-9 [regression] iOS app build fails when referencing package (e.g. Entity Framework Core 2.1) that depends on newer System.Memory in d15-9 Sep 6, 2018
@rolfbjarne
Copy link
Member Author

@spouliot @marek-safar This is a regression in d15-9.

Could a potential solution be to not ship System.Memory.dll in d15-9?

@marek-safar
Copy link
Contributor

That error is quite strange. We don't ship System.Memory (which is actually an issue on our side) but the current setup should still work. I'll check if I can reproduce it as well

@spouliot
Copy link
Contributor

spouliot commented Sep 6, 2018

@marek-safar it was removed in 15.8 (mono 2018-02) but, IIRC, you mentioned there was a fix in progress for the next mono, i.e. my understanding is that System.Memory.dll was not removed in mono master (which became the 2018-04 we're presently using for 15.9).

marek-safar added a commit to marek-safar/xamarin-macios that referenced this issue Sep 10, 2018
marek-safar added a commit to marek-safar/xamarin-macios that referenced this issue Sep 10, 2018
marek-safar added a commit to marek-safar/xamarin-macios that referenced this issue Sep 10, 2018
@marek-safar marek-safar mentioned this issue Sep 10, 2018
xamarin-jenkins pushed a commit that referenced this issue Sep 11, 2018
spouliot pushed a commit that referenced this issue Sep 12, 2018
rolfbjarne pushed a commit that referenced this issue Sep 13, 2018
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS regression The issue or pull request is a regression
Projects
None yet
Development

No branches or pull requests

3 participants