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

[mtouch] add mixed-mode support #4751

Merged
merged 8 commits into from
Sep 11, 2018

Conversation

lewurm
Copy link
Contributor

@lewurm lewurm commented Sep 5, 2018

Note: Requires mono-2018-06 to be merged, thus opened against it.

When enabling this option, mtouch will AOT compile mscorlib.dll. At runtime that means every method that wasn't AOT'd will be executed by the runtime interpreter.

mono/mono#6860

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.
Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

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

How are --interpreter and --interp-mixed different? From what I can see, the only real difference is that you pass full as an aot option in mixed mode. What does that do?

@lewurm
Copy link
Contributor Author

lewurm commented Sep 5, 2018

@rolfbjarne correct. mscorlib.dll is special handled regarding the interpreter, since it's used to attach AOT compiled wrappers/trampolines:

  • --aot=interp mscorlib.dll: emits a .dylib that only contains wrappers/trampolines for the interpreter, but no methods of the assembly are AOT compiled.
  • --aot=full,interp mscorlib.dll: emits a .dylib that contains the same as --aot=full mscorlib.dll plus the wrappers/trampolines for the interpreter mentioned above.

Note that interp option in the AOT compiler is ignored for any other assembly than mscorlib.dll. So for example, --aot=full System.dll equals --aot=full,interp System.dll.

@rolfbjarne
Copy link
Member

OK, I think I understand, and I propose the following command-line syntax for mtouch:

  • --interpreter: Enables the interpreter. Optionally takes a comma-separated list of assemblies to interpret (if prefixed with a minus sign, the assembly will be AOT-compiled instead). all can be used to specify all assemblies. Can be specified multiple times.

Examples:

  • --interpreter=all: Interpret all assemblies. This is the same as --interpreter.
  • --interpreter=-all,System.dll: AOT-compile all assemblies except System.dll
  • --interpreter=-mscorlib.dll: Interpret all assemblies except mscorlib.dll, which is AOT-compiled.

This means that your --interp-mixed would instead be --interpreter=-mscorlib.dll.

Does that sound like it could work (and be flexible enough)?

@lewurm
Copy link
Contributor Author

lewurm commented Sep 5, 2018

I like your proposal, looks good.

Do you mind to implement your suggestion yourself? For example, I don't know how the suggested option would propagate to msbuild task.

@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
🔥 Test run failed 🔥

Test results

7 tests failed, 0 tests skipped, 75 tests passed.

Failed tests

  • link sdk/iOS Unified 32-bits - simulator/Debug: Failed
  • link sdk/iOS Unified 32-bits - simulator/Release: Failed
  • link sdk/iOS Unified 64-bits - simulator/Debug: Failed
  • link sdk/iOS Unified 64-bits - simulator/Release: Failed
  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed
  • mmptest/macOS/All: Failed (Execution failed with exit code 1)

@rolfbjarne
Copy link
Member

Do you mind to implement your suggestion yourself?

Yes, I can have a look at this.

@rolfbjarne rolfbjarne self-assigned this Sep 5, 2018
@rolfbjarne rolfbjarne added the do-not-merge Do not merge this pull request label Sep 5, 2018
@rolfbjarne rolfbjarne removed the do-not-merge Do not merge this pull request label Sep 7, 2018
@rolfbjarne
Copy link
Member

@lewurm have a look now to see if what I did will work for you.

@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
Test run succeeded

{
app.UseInterpreter = true;
if (!string.IsNullOrEmpty (v)) {
app.InterpretedAssemblies.AddRange (v.Split (new char [] { ',' }, StringSplitOptions.RemoveEmptyEntries));
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: incorrect alignment

@@ -1134,6 +1157,8 @@ void AOTCompile ()
}

if (App.UseInterpreter)
/* TODO: not sure? we might have to continue here, depending on
* the set of assemblies are AOT'd? */
Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, that condition is can't work if we're mixing

@@ -64,6 +64,7 @@ public partial class Application
public bool? EnableCoopGC;
public bool EnableSGenConc;
public bool UseInterpreter;
public List<string> InterpretedAssemblies = new List<string> ();
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... it's inside common which is shared with XM
not sure it's the best place, Maybe under #if MTOUCH ?

Copy link
Member

Choose a reason for hiding this comment

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

Fixed by moving the code to an mtouch-specific file.

@@ -52,6 +52,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
<MtouchProjectDirectory>$(MSBuildProjectDirectory)</MtouchProjectDirectory>
<MtouchEnableSGenConc Condition="'$(MtouchEnableSGenConc)' == ''">False</MtouchEnableSGenConc>
<MtouchUseInterpreter Condition="'$(MtouchUseInterpreter)' == ''">False</MtouchUseInterpreter>
<MtouchInterpreter Condition="'$(MtouchInterpreter)' == ''">all</MtouchInterpreter>
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe both variables could be shared ? otherwise we end up with inconsistent state - and the tooling might start doing weird things (if the same duplicated conditions are not also duplicated in code)

Copy link
Member

Choose a reason for hiding this comment

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

Fixed to use a single variable.

@@ -832,6 +832,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
EnableBitcode="$(MtouchEnableBitcode)"
EnableSGenConc="$(MtouchEnableSGenConc)"
UseInterpreter="$(MtouchUseInterpreter)"
Interpreter="$(MtouchInterpreter)"
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

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

👍

@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
🔥 Test run failed 🔥

Test results

147 tests failed, 0 tests skipped, 71 tests passed.

Failed tests

  • monotouch-test/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • framework-test/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • mini/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • interdependent-binding-projects/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • fsharp/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • mscorlib/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Core/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Data/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Net.Http/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Numerics/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Runtime.Serialization/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Transactions/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Web.Services/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Xml/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Xml.Linq/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • Mono.Security/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.ComponentModel.DataAnnotations/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Json/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.ServiceModel.Web/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • Mono.Data.Sqlite/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • Mono.Data.Tds/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.IO.Compression/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.IO.Compression.FileSystem/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • Mono.CSharp/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.Security/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.ServiceModel/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • System.IdentityModel/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • introspection/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • dont link/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • dont link/iOS Unified 32-bits - simulator/Release: BuildFailure
  • link all/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • link all/iOS Unified 32-bits - simulator/Release: BuildFailure
  • link sdk/iOS Unified 32-bits - simulator/Debug: BuildFailure
  • link sdk/iOS Unified 32-bits - simulator/Release: BuildFailure
  • monotouch-test/iOS Unified 32-bits - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/iOS Unified 32-bits - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • framework-test/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • mini/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • interdependent-binding-projects/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • fsharp/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • mscorlib/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Core/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Data/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Net.Http/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Numerics/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Runtime.Serialization/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Transactions/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Web.Services/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Xml/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Xml.Linq/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • Mono.Security/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.ComponentModel.DataAnnotations/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Json/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.ServiceModel.Web/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • Mono.Data.Sqlite/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • Mono.Data.Tds/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.IO.Compression/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.IO.Compression.FileSystem/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • Mono.CSharp/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.Security/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.ServiceModel/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • System.IdentityModel/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • introspection/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Release: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Release: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Release: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/tvOS - simulator/Debug: BuildFailure
  • framework-test/tvOS - simulator/Debug: BuildFailure
  • mini/tvOS - simulator/Debug: BuildFailure
  • interdependent-binding-projects/tvOS - simulator/Debug: BuildFailure
  • fsharp/tvOS - simulator/Debug: BuildFailure
  • mscorlib/tvOS - simulator/Debug: BuildFailure
  • System/tvOS - simulator/Debug: BuildFailure
  • System.Core/tvOS - simulator/Debug: BuildFailure
  • System.Data/tvOS - simulator/Debug: BuildFailure
  • System.Net.Http/tvOS - simulator/Debug: BuildFailure
  • System.Numerics/tvOS - simulator/Debug: BuildFailure
  • System.Runtime.Serialization/tvOS - simulator/Debug: BuildFailure
  • System.Transactions/tvOS - simulator/Debug: BuildFailure
  • System.Web.Services/tvOS - simulator/Debug: BuildFailure
  • System.Xml/tvOS - simulator/Debug: BuildFailure
  • System.Xml.Linq/tvOS - simulator/Debug: BuildFailure
  • Mono.Security/tvOS - simulator/Debug: BuildFailure
  • System.ComponentModel.DataAnnotations/tvOS - simulator/Debug: BuildFailure
  • System.Json/tvOS - simulator/Debug: BuildFailure
  • System.ServiceModel.Web/tvOS - simulator/Debug: BuildFailure
  • Mono.Data.Sqlite/tvOS - simulator/Debug: BuildFailure
  • Mono.Data.Tds/tvOS - simulator/Debug: BuildFailure
  • System.IO.Compression/tvOS - simulator/Debug: BuildFailure
  • System.IO.Compression.FileSystem/tvOS - simulator/Debug: BuildFailure
  • Mono.CSharp/tvOS - simulator/Debug: BuildFailure
  • System.Security/tvOS - simulator/Debug: BuildFailure
  • System.ServiceModel/tvOS - simulator/Debug: BuildFailure
  • System.IdentityModel/tvOS - simulator/Debug: BuildFailure
  • introspection/tvOS - simulator/Debug: BuildFailure
  • dont link/tvOS - simulator/Debug: BuildFailure
  • dont link/tvOS - simulator/Release: BuildFailure
  • link all/tvOS - simulator/Debug: BuildFailure
  • link all/tvOS - simulator/Release: BuildFailure
  • link sdk/tvOS - simulator/Debug: BuildFailure
  • link sdk/tvOS - simulator/Release: BuildFailure
  • monotouch-test/tvOS - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/tvOS - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/watchOS - simulator/Debug: BuildFailure
  • framework-test/watchOS - simulator/Debug: BuildFailure
  • mini/watchOS - simulator/Debug: BuildFailure
  • interdependent-binding-projects/watchOS - simulator/Debug: BuildFailure
  • fsharp/watchOS - simulator/Debug: BuildFailure
  • mscorlib/watchOS - simulator/Debug: BuildFailure
  • System/watchOS - simulator/Debug: BuildFailure
  • System.Core/watchOS - simulator/Debug: BuildFailure
  • System.Data/watchOS - simulator/Debug: BuildFailure
  • System.Net.Http/watchOS - simulator/Debug: BuildFailure
  • System.Numerics/watchOS - simulator/Debug: BuildFailure
  • System.Runtime.Serialization/watchOS - simulator/Debug: BuildFailure
  • System.Transactions/watchOS - simulator/Debug: BuildFailure
  • System.Web.Services/watchOS - simulator/Debug: BuildFailure
  • System.Xml/watchOS - simulator/Debug: BuildFailure
  • System.Xml.Linq/watchOS - simulator/Debug: BuildFailure
  • System.ComponentModel.DataAnnotations/watchOS - simulator/Debug: BuildFailure
  • System.Json/watchOS - simulator/Debug: BuildFailure
  • System.ServiceModel.Web/watchOS - simulator/Debug: BuildFailure
  • Mono.Data.Sqlite/watchOS - simulator/Debug: BuildFailure
  • System.IO.Compression/watchOS - simulator/Debug: BuildFailure
  • System.IO.Compression.FileSystem/watchOS - simulator/Debug: BuildFailure
  • System.Security/watchOS - simulator/Debug: BuildFailure
  • System.ServiceModel/watchOS - simulator/Debug: BuildFailure
  • System.IdentityModel/watchOS - simulator/Debug: BuildFailure
  • introspection/watchOS - simulator/Debug: BuildFailure
  • dont link/watchOS - simulator/Debug: BuildFailure
  • dont link/watchOS - simulator/Release: BuildFailure
  • link all/watchOS - simulator/Debug: BuildFailure
  • link all/watchOS - simulator/Release: BuildFailure
  • link sdk/watchOS - simulator/Debug: BuildFailure
  • link sdk/watchOS - simulator/Release: BuildFailure
  • monotouch-test/watchOS - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/watchOS - simulator/Release (all optimizations): BuildFailure
  • MSBuild tests/iOS: Failed (Execution failed with exit code 54)
  • MTouch tests/NUnit: Failed (Execution failed with exit code 11)

@@ -476,6 +477,8 @@ public static string GetAotArguments (Application app, string filename, Abi abi,
args.Append ("llvmonly,");
else if (interp)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest to add an assert here, interp should only be true of fname == "mscorlib.dll" is true.

Copy link
Member

Choose a reason for hiding this comment

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

Don't you mean that interp_full should only be true if name == "mscorlib.dll"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, other assemblies than mscorlib.dll are vaild with --aot=interp,full too, as it will add wrappers specific to signatures seen during AOT compilation that are necessary for the AOT<>interpreter transitions.

However, --aot=interp only makes sense for mscorlib.dll. At least that's how it's supposed to work, I should double check that on the mono side: mono/mono#10543

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see your point, for other interpreted assemblies this method (GetAotArguments) shouldn't be called at all.

Copy link
Contributor Author

@lewurm lewurm left a comment

Choose a reason for hiding this comment

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

tested changes on device, works as expected. Thank you! 🙂

@luhenry luhenry changed the title [mtouch] add --interp-mixed option [mtouch] add mixed-mode support Sep 10, 2018
@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
Test run succeeded

@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
Test run succeeded

@rolfbjarne rolfbjarne merged commit cdbf122 into xamarin:mono-2018-06 Sep 11, 2018
spouliot pushed a commit that referenced this pull request Oct 10, 2018
* Bump to mono:2018-06

* Bump mono

* Updates compression to work with the public span

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Bump Mono

* [runtime] always use `mono_jit_set_aot_mode` (#4491)

`mono_jit_set_aot_only` is deprecated and accidentally broke with
mono/mono#7887

This should fix device tests with `mono-2018-06`

* Testing with Zoltan's patch

* Include libmono-system-native on Xamarin.Mac

* Bump Mono

Commit list for mono/mono:

* mono/mono@7bcda192a06 Bump llvm to release_60/fc854b8ec5873d294b80afa3e6cf6a88c5c48886. (#9786). (#9804)
* mono/mono@23e95ec7ad7 Apply F# portable pdb debug fix for pinvokes & bump (#9797)
* mono/mono@295f6d32afd [2018-06] [MacOS] On Mac, use the copyfile API to copy files (#9696)

Diff: mono/mono@7d5f4b6...7bcda19

* Revert 4bacab3, it doesn't fix the ios aot problems.

* Bump mono

* [tests] Adjust the MT0137 test for mcs change in behavior.

Starting with mono 5.16 mcs will now add assembly references when the assembly
is only used in attributes (this was already the case for csc in both 5.14 and
5.16, so it seems to be a compatibility change).

Adjust the MT0137 test accordingly.

* [msbuild] Fix parsing of json parser errors to handle trailing periods in the error message.

Fixes this test:

    1) Test Failure : Xamarin.iOS.Tasks.Bug60536.TestACToolTaskCatchesJsonException
         ColumnNumber
      Expected: 2
      But was:  0

* Bump mono

* [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that.

* Bump mono

* Bump mono

* [jenkins] Don't give VSTS a fake branch. (#4667)

Something in VSTS changed, and now fake branch names don't work anymore.

So instead use real branch names (and for pull requests I've created a
'pull-request' branch we can use).

* Assembly.LoadFile accepts only absolute path

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump Mono

* [mtouch] add mixed-mode support (#4751)

* [mtouch] add --interp-mixed option

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.

* [mtouch] Add support to --interpreter to list the assemblies to (not) interpret.

* [msbuild] Simplify interpreter code to use a single variable.

* Fix whitespace.

* [mtouch] Move mtouch-specific code to mtouch-specific file.

* [msbuild] An empty string is a valid value for 'Interpreter', so make it a non-required property.

* [mtouch] Add sanity check for aot-compiling interpreted assemblies.

* Bump Mono

* [linker] Updates SDKs facades list

* Bump mono

* [msbuild] Adds facades which might override default nuget version to framework list

The collision resolver task reads them from here https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/ConflictResolution/FrameworkListReader.cs

* Bump to a VSfM version that can build XM Classic projects.
spouliot added a commit that referenced this pull request Dec 6, 2018
* Bump to mono:2018-06

* Bump mono

* Updates compression to work with the public span

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Bump Mono

* [runtime] always use `mono_jit_set_aot_mode` (#4491)

`mono_jit_set_aot_only` is deprecated and accidentally broke with
mono/mono#7887

This should fix device tests with `mono-2018-06`

* Testing with Zoltan's patch

* Include libmono-system-native on Xamarin.Mac

* Bump Mono

Commit list for mono/mono:

* mono/mono@7bcda192a06 Bump llvm to release_60/fc854b8ec5873d294b80afa3e6cf6a88c5c48886. (#9786). (#9804)
* mono/mono@23e95ec7ad7 Apply F# portable pdb debug fix for pinvokes & bump (#9797)
* mono/mono@295f6d32afd [2018-06] [MacOS] On Mac, use the copyfile API to copy files (#9696)

Diff: mono/mono@7d5f4b6...7bcda19

* Revert 4bacab3, it doesn't fix the ios aot problems.

* Bump mono

* [tests] Adjust the MT0137 test for mcs change in behavior.

Starting with mono 5.16 mcs will now add assembly references when the assembly
is only used in attributes (this was already the case for csc in both 5.14 and
5.16, so it seems to be a compatibility change).

Adjust the MT0137 test accordingly.

* [msbuild] Fix parsing of json parser errors to handle trailing periods in the error message.

Fixes this test:

    1) Test Failure : Xamarin.iOS.Tasks.Bug60536.TestACToolTaskCatchesJsonException
         ColumnNumber
      Expected: 2
      But was:  0

* Bump mono

* [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that.

* Bump mono

* Bump to mono:2018-08

* Initialize Dependency Injector.

* Fix typo

* Fix llvm build

* Reflect latest X509CertificateImpl changes

* Use same compile flags also for link

Linking can fail if the minimum versions are different

* Bump mono

* Bump mono

* Assembly.LoadFile accepts only absolute path

* Bump mono

* [jenkins] Don't give VSTS a fake branch. (#4667)

Something in VSTS changed, and now fake branch names don't work anymore.

So instead use real branch names (and for pull requests I've created a
'pull-request' branch we can use).

* Assembly.LoadFile accepts only absolute path

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [tests] Reference GuiUnit_Net_4_5 using a project reference.

This makes sure GuiUnit is built when the main project is built.

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump Mono

* [mtouch] add mixed-mode support (#4751)

* [mtouch] add --interp-mixed option

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.

* [mtouch] Add support to --interpreter to list the assemblies to (not) interpret.

* [msbuild] Simplify interpreter code to use a single variable.

* Fix whitespace.

* [mtouch] Move mtouch-specific code to mtouch-specific file.

* [msbuild] An empty string is a valid value for 'Interpreter', so make it a non-required property.

* [mtouch] Add sanity check for aot-compiling interpreted assemblies.

* Bump Mono

* [linker] Updates SDKs facades list

* Bump mono

* [msbuild] Adds facades which might override default nuget version to framework list

The collision resolver task reads them from here https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/ConflictResolution/FrameworkListReader.cs

* Bump mono to pick up hybrid suspend fixes

Pick up the 2018-08 backport (mono/mono#10551)
of mono/mono#10545

This should fix GC hangs when managed code runs on a GCD threadpool worker
thread.

* [builds] Fix target name in llvm36 provisioning

package-llvm-llvm36-32 isn't defined in external/mono/sdks/builds/llvm.mk,
but package-llvm36-llvm32 is.

* Revert "[builds] Fix target name in llvm36 provisioning"

This reverts commit b233837.

* Revert "Fix llvm build"

This reverts commit f668561.

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump mono

* Bump mono

* Revert "Use same compile flags also for link"

This reverts commit cf20539.

* Bump mono to pick up mono/mono@1a309a7

* [mmptest] System.Core doesn't depend on Mono.Posix in 2018-08

System.Core doesn't depend on Mono.Posix anymore since it's using the corefx
implementation of pipes now mono/mono@0f0e318

* Bump mono and minimum system mono

* [security]: Make `SecCertificate` work with the latest runtime code.

* Fix the `NATIVE_APPLE_CERTIFICATE` logic; it should only be defined when
  using `XAMARIN_APPLETLS` and not on watch.

* It is no longer allowed to construct `X509Certificate` from a native pointer,
  the `X509Certificate(IntPtr)` and `X509Certificate2(IntPtr)` constructors now
  throw an exception.  Use `X509CertificateImplAppl` directly instead.

* Bump mono

* Bump VSmac min version to 7.7.0.1373

To pick up the fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/658916/
Should fix the XM classic build failures

* Revert "Bump VSmac min version to 7.7.0.1373"

This reverts commit b2686bb.

* Bump to a VSfM version that can build XM Classic projects.

* Bump mono system dependency

* Bump mono

Pick up mono/mono@1644a1a0 - fix for mono/mono#10743

* Bump mono

* Bump mono

* [monotouch-test] Disable X509Certificate(byte[]) tests on watchOS (#4942)

* [monotouch-test] Disable X509Certificate(byte[]) tests on watchOS

* [tests] Add TestRuntime.AssertNotWatchOS()

* fixup WatchOS build

* Bump mono

* Bump mono

* [tests] Disable link-preserve-calendar-1 until we can upgrade it to be a Unified test.

See #4596 (comment)
for reference: mono's desktop API changed, the linker behavior the test is
verifying is only expected when using XM's Mobile profile.

* Bump mono

* Revert "[monotouch-test] Disable X509Certificate(byte[]) tests on watchOS (#4942)"

This reverts commit d003a9b.

* Bump Mono.

* [security]: `NATIVE_APPLE_CERTIFICATE` should now be defined on watchOS as well.

* Mono 2018-08 requires macOS 10.9+, so Xamarin.Mac must as well.

* Bump min mono version for XM system apps.

Using a system mono < 5.18 results in a TypeLoadException:

    Could not resolve type with token 01000032 from typeref (expected class 'Mono.ISystemDependencyProvider' in assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')

* Bump guiunit to get updated min macOS version.

Commit list for mono/guiunit:

* mono/guiunit@9f67042 Bump min macOS version to 10.9.
* mono/guiunit@0c3159a [Harness] Fix exit code of 0 being reported in case of exceptions in the harness
* mono/guiunit@9b7497c Merge pull request #15 from mono/fix-more-warnings
* mono/guiunit@a264470 Fix more warnings
* mono/guiunit@dd094e7 Merge pull request #14 from mono/fix-warnings
* mono/guiunit@b3afede Fix build warnings

Diff: mono/guiunit@1306b0d...9f67042

* [tests] More min macOS version setting to 10.9.

* Remove 10.7 & 10.8 availability attributes, since they're redundant now.

* Bump mono

* [2018-08][watchos] Use mono_dangerous_add_raw_internal_call for watchOS icalls (#5030)

* Add optional mono_dangerous_add_raw_internal_call to exports.t4

* Use mono_dangerous_add_raw_internal_call on watchOS for icall registration

Internal calls added with mono_dangerous_add_raw_internal_call run in GC Unsafe
mode under cooperative and hybrid suspend, whereas internal calls added with
mono_add_internal_call run in GC Safe mode since
mono/mono@5756ba4 in order for hybrid suspend
to be a transparent replacement for preemptive suspend (the old default).  The
icalls in GC Unsafe mode have a responsibility not to block indefinitely
without manually performing a thread state transition to GC Safe mode, and in
return they avoid a thread state transition when the icall is invoked from a
managed method.

* [mmptest] Less hardcoding.

* Bump minimum mono one that has 'mono_dangerous_add_raw_internal_call'.

* Bump mono

* Bump system mono dependency

* Fixes building mono tests

* [ImageCaptureCore] Remove redundant availability attribute.

* [mtouch] Clear the MONO_THREADS_SUSPEND environment variable before calling the AOT compiler. Works around mono/mono#11765.

Visual Studio for Mac may set MONO_THREADS_SUSPEND, and this ends up confusing
the AOT compiler when compiling for watchOS.

So unset the environment variable before calling the AOT compiler.

Works around mono/mono#11765.
@ysmoradi
Copy link

ysmoradi commented Dec 23, 2018

  • --interpreter=all: Interpret all assemblies. This is the same as --interpreter.
  • --interpreter=-all,System.dll: AOT-compile all assemblies except System.dll
  • --interpreter=-mscorlib.dll: Interpret all assemblies except mscorlib.dll, which is AOT-compiled.

I passed --interpreter to additional mtouch args and aot limitations went away on physical device. am I able to use other examples in d16? for example --interpreter=-all,SomeLibrary.dll?

I tested all of them. If I use --interpreter, it will interpret all assemblies no matter what parameter I provide to it! I provided some invalid names to it, and it's didn't show any kind of error to me.

Thanks

@lewurm
Copy link
Contributor Author

lewurm commented Jan 15, 2019

@ysmoradi sorry I missed your message. How did you verify that a specific assembly is interpreted or not?

@rolfbjarne
Copy link
Member

@ysmoradi

I provided some invalid names to it, and it's didn't show any kind of error to me.

We show a warning in that case, not an error:

exceptions.Add (ErrorHelper.CreateWarning (138, $"Cannot find the assembly '{assembly}', passed as an argument to --interpreter."));

You can make it an error by adding /warnaserror:138 to the additional mtouch arguments in the project's iOS Build options.

@ysmoradi
Copy link

@ysmoradi sorry I missed your message. How did you verify that a specific assembly is interpreted or not?

I have an issue which results into JIT fallback & crash on iOS devices only.
I provided --interpreter and problem become solved. I decided to run only part of my app in an interpreted mode, because AOT mode has better performance for sure. So, I provided --interpreter=-all,SomeLibrary.dll
Based on what I've got understand, that means all assemblies should run in AOT mode, but SomeLibrary.dll should run in interpreted mode. I've no SomeLibrary.dll at all (!). Based on what @rolfbjarne said, there is no exception is expcted. That's fine. But I except my app to gets crashed again, but it doesn't crash. If all assemblies are running in AOT mode, I expect my app to get crashed.
In a nutshell, can I say --interpreter=-all is equal to no interpreter at all?

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.

6 participants