-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter +…
… AOT when needed. Fixes #11421 and #11724. (#12237) * [dotnet] Refactor and extend the logic to determine whether we should 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. * [runtime] AOT is no longer limited to device builds. * [runtime/tools] Implement finding native mono lib for Mac Catalyst. This 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. * [tools] Implement interpreter + AOT compilation for simulator + Mac Catalyst. 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. * [tests] Add a MyInterpretedApp test solution * [dotnet] Parse --dlsym and pass it to the dotnet-linker tasks. * [dotnet] Only list linker flags for assemblies after we've computed them. 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). * [dotnet-linker] Add native references to libSystem.Security.Cryptography.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. * [monotouch-test] Fix some formatting and add assert messages * [tools] Disable direct-pinvoke for AOT-compiled code on Mac Catalyst. 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. * [monotouch-test] Improve the MTLDeviceTest to work on Mac Catalyst. * [tools] Always use '__Internal' as the native library for .NET. This is not the final fix, but this code will be reworked extensively, and this fix works for now to make the interpreter work. * [monotouch-test] Ignore the MTLDeviceTest.ReturnReleaseTest on Mac Catalyst. It requires a backport of other test fixes (which we're not really interested in), so just ignore it. Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
- Loading branch information
1 parent
8a70ed4
commit c0e6736
Showing
29 changed files
with
273 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../shared.mk |
8 changes: 8 additions & 0 deletions
8
tests/dotnet/MyInterpretedApp/MacCatalyst/MyInterpretedApp.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-maccatalyst</TargetFramework> | ||
<RuntimeIdentifier>maccatalyst-arm64</RuntimeIdentifier> | ||
</PropertyGroup> | ||
<Import Project="../shared.csproj" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
using Foundation; | ||
using UIKit; | ||
|
||
namespace MySingleView | ||
namespace MyInterpretedApp | ||
{ | ||
public class Application | ||
{ | ||
static void Main (string[] args) | ||
{ | ||
Console.WriteLine ($"Execution mode: {GetExecutionMode ()}"); | ||
UIApplication.Main (args, null, typeof (AppDelegate)); | ||
} | ||
|
||
public static string GetExecutionMode() | ||
{ | ||
if (!RuntimeFeature.IsDynamicCodeSupported) | ||
return "AOT"; | ||
if (RuntimeFeature.IsDynamicCodeCompiled) | ||
return "JIT"; | ||
return "Interpreter"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include ../shared.mk | ||
|
||
dev: | ||
$(DOTNET6) build /bl *.csproj $(MSBUILD_VERBOSITY) /p:RuntimeIdentifier=ios-arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<UseInterpreter>true</UseInterpreter> | ||
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip> | ||
|
||
<ApplicationTitle>MyInterpretedApp</ApplicationTitle> | ||
<ApplicationId>com.xamarin.myinterpretedapp</ApplicationId> | ||
<ApplicationVersion>1.0</ApplicationVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="../*.cs" /> | ||
<None Include="../Info.plist"> | ||
<Link>Info.plist</Link> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
TOP=../../../.. | ||
include $(TOP)/Make.config | ||
|
||
reload: | ||
rm -Rf $(TOP)/tests/dotnet/packages | ||
$(MAKE) -C $(TOP) -j8 all | ||
$(MAKE) -C $(TOP) -j8 install | ||
git clean -xfdq | ||
|
||
reload-and-build: reload | ||
$(MAKE) build | ||
|
||
reload-and-run: reload | ||
$(MAKE) run | ||
|
||
build: | ||
$(DOTNET6) build /bl *.csproj $(MSBUILD_VERBOSITY) | ||
|
||
run: | ||
$(DOTNET6) build /bl *.csproj $(MSBUILD_VERBOSITY) -t:Run | ||
|
||
diag: | ||
$(DOTNET6) build /v:diag msbuild.binlog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../shared.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-tvos</TargetFramework> | ||
</PropertyGroup> | ||
<Import Project="../shared.csproj" /> | ||
</Project> |
Oops, something went wrong.
c0e6736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ [CI 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)
Packages generated
View packages
Test results
3 tests failed, 218 tests passed.
Failed tests
Pipeline on Agent XAMBOT-1024.BigSur'
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12237)
c0e6736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12237)
c0e6736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12237)
c0e6736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Tests passed on macOS Mac Catalina (10.15) ✅
Tests passed
All tests on macOS X Mac Catalina (10.15) passed.
Pipeline on Agent
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12237)
c0e6736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Tests passed on macOS Mac Mojave (10.14) ✅
Tests passed
All tests on macOS X Mac Mojave (10.14) passed.
Pipeline on Agent
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12237)
c0e6736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Tests passed on macOS Mac High Sierra (10.13) ✅
Tests passed
All tests on macOS X Mac High Sierra (10.13) passed.
Pipeline on Agent
[release/6.0.1xx-preview7] [dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12237)