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

[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. #12237

Conversation

vs-mobiletools-engineering-service2
Copy link
Collaborator

  • Add support for the interpreter everywhere.
  • Add support for the AOT compiler everywhere we didn't support it before,
    because the interpreter needs it (at least System.Private.CoreLib.dll must
    be AOT-compiled when using the interpreter).
  • Do FullAOT compilation on Mac Catalyst/ARM64 if we're not using the
    interpreter, since we can't use the JIT.
  • Fix monotouch-test to be green on Mac Catalyst/ARM64.

Fixes #11724.
Fixes #11421.

Backport of #12211

… run the AOT compiler or not.

We also can't link dynamically with libmonosgen-2.0.dylib if we AOT compile anything,
so make sure we don't do that.
…his also meant propagating how libmono is linked from the MSBuild code to the Application class so that our existing logic is able to correctly determine which native mono lib to use.
…atalyst.

The interpreter requires running the AOT compiler for System.Private.CoreLib.dll,
so the first step in implementing the interpreter is to implement support for the
AOT compiler as well.

For .NET the logic is now as follows:

* If the interpreter is enabled, AOT compile System.Private.CoreLib.dll.
* If the interpreter is disabled, AOT everything on device + Mac Catalyst on ARM64.
…hem.

This means not listing per-assembly linker flags for only binding projects, but delay
it until we've computed the linker flags for all assemblies (and reflect this in
variable names as well).
…phy.Native.Apple for Mac Catalyst.

Fixes these test failures:

    Ctor_Trust: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
    MailX1: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
    Encrypt_Empty: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
    KeyRecordTest: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
    Basic_Leaf_Only: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple

which are all because of

    Xamarin.MacCatalyst: Unable to resolve P/Invoke 'AppleCryptoNative_X509GetContentType' in the library 'libSystem.Security.Cryptography.Native.Apple'

which happens because without this change we're not linking with the static version
of libSystem.Security.Cryptography.Native.Apple.
Using 'direct-pinvoke' will tell the AOT compiler to emit a direct call to the
native function declared in the DllImport, which doesn't work when we want to
redirect to a different native funcion (in our xamarin_pinvoke_override/PINVOKE_OVERRIDE
implementation).

This fixes our exception marshalling tests in monotouch-test.
This is not the final fix, but this code will be reworked extensively, and
this fix works for now to make the interpreter work.
@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

1 tests failed, 114 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2626 Passed: 2487 Inconclusive: 35 Failed: 3 Ignored: 136)

Pipeline on Agent XAMBOT-1104.BigSur'
Merge 1346f31 into 3a110b4

…talyst.

It requires a backport of other test fixes (which we're not really interested in), so just ignore it.
@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 113 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2626 Passed: 2487 Inconclusive: 35 Failed: 2 Ignored: 137)
  • DotNet tests: TimedOut (Execution timed out after 30 minutes.)

Pipeline on Agent XAMBOT-1098.BigSur'
Merge ee83ee3 into bd38870

@rolfbjarne
Copy link
Member

Test failures are unrelated

@rolfbjarne rolfbjarne merged commit c0e6736 into dotnet:release/6.0.1xx-preview7 Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported not-notes-worthy Ignore for release notes run-dotnet-tests Run all the .NET tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants