From 95bcaa91245daae38bbec4d78486ae9bd08128d0 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 15 Jun 2018 12:43:04 -0400 Subject: [PATCH 01/32] Bump to mono:2018-06 --- .gitmodules | 2 +- Make.config | 6 +++--- external/mono | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 19d4d7183a7c..48800f6cb257 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ [submodule "external/mono"] path = external/mono url = ../../mono/mono.git - branch = 2018-02 + branch = 2018-06 [submodule "external/opentk"] path = external/opentk url = ../../mono/opentk.git diff --git a/Make.config b/Make.config index 690a35cd2f54..9fe7c9422dc0 100644 --- a/Make.config +++ b/Make.config @@ -62,9 +62,9 @@ XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_9.4.xip XCODE_DEVELOPER_ROOT=/Applications/Xcode94.app/Contents/Developer # Minimum Mono version -MIN_MONO_VERSION=5.12.0.226 -MAX_MONO_VERSION=5.12.99 -MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-02/192/9824e260f56eb08b163e2c79d3338cd946aad7d6/MonoFramework-MDK-5.12.0.226.macos10.xamarin.universal.pkg +MIN_MONO_VERSION=5.16.0.5 +MAX_MONO_VERSION=5.16.99 +MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-06/7/7627a5f9eeba0fd846731ad0c498556f55be1a34/MonoFramework-MDK-5.16.0.5.macos10.xamarin.universal.pkg # Minimum Visual Studio version MIN_VISUAL_STUDIO_URL=https://download.visualstudio.microsoft.com/download/pr/11550896/783d2219a348f93b6988fb415951788a/VisualStudioForMac-Preview-7.4.0.985.dmg diff --git a/external/mono b/external/mono index 1c24c158b0cc..7627a5f9eeba 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 1c24c158b0cc0647adf216fd2244a094ce437611 +Subproject commit 7627a5f9eeba0fd846731ad0c498556f55be1a34 From 8ad66664bbaaffc2fea8b8d12a8257a99ff87862 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 11 Jul 2018 10:50:59 +0200 Subject: [PATCH 02/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 6e514dcc645e..a520836ddb85 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 6e514dcc645ef70d53ab2a34266005d4ad875c73 +Subproject commit a520836ddb8584111cc9e13b1f1cdbefae6ade91 From e20975b6bc9434a03570f61f6aaf840a0394c003 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Sat, 14 Jul 2018 20:30:19 +0200 Subject: [PATCH 03/32] Updates compression to work with the public span --- src/Compression/Compression.cs | 6 +++--- src/Compression/Deflater.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Compression/Compression.cs b/src/Compression/Compression.cs index 0631c34fb4a4..52f307bb35f2 100644 --- a/src/Compression/Compression.cs +++ b/src/Compression/Compression.cs @@ -558,14 +558,14 @@ public override Task WriteAsync (byte[] array, int offset, int count, Cancellati return WriteAsyncMemory (new ReadOnlyMemory (array, offset, count), cancellationToken); } - public override Task WriteAsync (ReadOnlyMemory source, CancellationToken cancellationToken) + public override ValueTask WriteAsync (ReadOnlyMemory source, CancellationToken cancellationToken) { if (GetType () != typeof (CompressionStream)) { // Ensure that existing streams derived from DeflateStream and that override WriteAsync(byte[],...) // get their existing behaviors when the newer Memory-based overload is used. return base.WriteAsync (source, cancellationToken); } else { - return WriteAsyncMemory (source, cancellationToken); + return new ValueTask(WriteAsyncMemory (source, cancellationToken)); } } @@ -576,7 +576,7 @@ internal Task WriteAsyncMemory (ReadOnlyMemory source, CancellationToken c EnsureNotDisposed (); return cancellationToken.IsCancellationRequested ? - Task.FromCanceled (cancellationToken) : + Task.FromCanceled(cancellationToken) : WriteAsyncMemoryCore (source, cancellationToken); } diff --git a/src/Compression/Deflater.cs b/src/Compression/Deflater.cs index ee6e327327f7..b5a22ea4db08 100644 --- a/src/Compression/Deflater.cs +++ b/src/Compression/Deflater.cs @@ -63,7 +63,7 @@ internal unsafe void SetInput (ReadOnlyMemory inputBuffer) { if (!NeedsInput ()) throw new InvalidOperationException ("We have something left in previous input!"); - if (_inputBufferHandle.HasPointer) + if (_inputBufferHandle.Pointer == null) throw new InvalidOperationException ("Unexpected input buffer handler found."); if (0 == inputBuffer.Length) { @@ -71,7 +71,7 @@ internal unsafe void SetInput (ReadOnlyMemory inputBuffer) } lock (SyncLock) { - _inputBufferHandle = inputBuffer.Retain (pin: true); + _inputBufferHandle = inputBuffer.Pin (); _compression_struct.Source = (IntPtr)_inputBufferHandle.Pointer; _compression_struct.SourceSize = inputBuffer.Length; @@ -84,7 +84,7 @@ internal unsafe void SetInput (byte* inputBufferPtr, int count) throw new InvalidOperationException ("We have something left in previous input!"); if (inputBufferPtr == null) throw new ArgumentNullException ( nameof (inputBufferPtr)); - if (_inputBufferHandle.HasPointer) + if (_inputBufferHandle.Pointer == null) throw new InvalidOperationException ("Unexpected input buffer handler found."); if (count == 0) { @@ -155,7 +155,7 @@ internal bool Finish (byte[] outputBuffer, out int bytesRead) /// /// Returns true if there was something to flush. Otherwise False. /// - internal bool Flush (byte[] outputBuffer, out int bytesRead) + internal unsafe bool Flush (byte[] outputBuffer, out int bytesRead) { if (outputBuffer == null) throw new ArgumentNullException (nameof (outputBuffer)); @@ -163,7 +163,7 @@ internal bool Flush (byte[] outputBuffer, out int bytesRead) throw new ArgumentException ("Can't pass in an empty output buffer!"); if (!NeedsInput ()) throw new InvalidOperationException ("We have something left in previous input!"); - if (_inputBufferHandle.HasPointer) + if (_inputBufferHandle.Pointer == null) throw new InvalidOperationException ("InputHandler should not be set"); // Note: we require that NeedsInput() == true, i.e. that 0 == _zlibStream.AvailIn. From c044c6b8fb6fd853fe62a5858afe4a4807f35d1b Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Sat, 14 Jul 2018 20:35:57 +0200 Subject: [PATCH 04/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index a520836ddb85..b9dd9d11a707 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit a520836ddb8584111cc9e13b1f1cdbefae6ade91 +Subproject commit b9dd9d11a707c6786b8c186f832b2d33cae609a1 From 9935c1cf0d455086016f38199840b5908a72a766 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Sun, 15 Jul 2018 11:17:54 +0200 Subject: [PATCH 05/32] Fixes pointer check logic in Deflater --- src/Compression/Deflater.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compression/Deflater.cs b/src/Compression/Deflater.cs index b5a22ea4db08..3e8d7d83a44d 100644 --- a/src/Compression/Deflater.cs +++ b/src/Compression/Deflater.cs @@ -63,7 +63,7 @@ internal unsafe void SetInput (ReadOnlyMemory inputBuffer) { if (!NeedsInput ()) throw new InvalidOperationException ("We have something left in previous input!"); - if (_inputBufferHandle.Pointer == null) + if (_inputBufferHandle.Pointer != null) throw new InvalidOperationException ("Unexpected input buffer handler found."); if (0 == inputBuffer.Length) { @@ -84,7 +84,7 @@ internal unsafe void SetInput (byte* inputBufferPtr, int count) throw new InvalidOperationException ("We have something left in previous input!"); if (inputBufferPtr == null) throw new ArgumentNullException ( nameof (inputBufferPtr)); - if (_inputBufferHandle.Pointer == null) + if (_inputBufferHandle.Pointer != null) throw new InvalidOperationException ("Unexpected input buffer handler found."); if (count == 0) { From d5e029ace65c6abeb05d74e9d3b0eceec5fe76ea Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Sun, 15 Jul 2018 22:36:23 +0200 Subject: [PATCH 06/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index b9dd9d11a707..d7985272b7a5 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit b9dd9d11a707c6786b8c186f832b2d33cae609a1 +Subproject commit d7985272b7a5bc256e652078ad5b3e6f419a3fca From 559ef82d598121fb02915f4e8e9d935bc02da676 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Mon, 16 Jul 2018 15:20:13 +0200 Subject: [PATCH 07/32] Fixes pointer check logic in Deflater --- src/Compression/Deflater.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compression/Deflater.cs b/src/Compression/Deflater.cs index 3e8d7d83a44d..081eecf28adf 100644 --- a/src/Compression/Deflater.cs +++ b/src/Compression/Deflater.cs @@ -163,7 +163,7 @@ internal unsafe bool Flush (byte[] outputBuffer, out int bytesRead) throw new ArgumentException ("Can't pass in an empty output buffer!"); if (!NeedsInput ()) throw new InvalidOperationException ("We have something left in previous input!"); - if (_inputBufferHandle.Pointer == null) + if (_inputBufferHandle.Pointer != null) throw new InvalidOperationException ("InputHandler should not be set"); // Note: we require that NeedsInput() == true, i.e. that 0 == _zlibStream.AvailIn. From 8121c7b9b78b405c28c8d1bf0f83a788236c9326 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 19 Jul 2018 10:20:12 +0200 Subject: [PATCH 08/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index d7985272b7a5..f4dbef76c981 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit d7985272b7a5bc256e652078ad5b3e6f419a3fca +Subproject commit f4dbef76c98182461e70f27c4ab4389e349fcf3a From fe4b21567d1702fd75cefe4fea87884d365ce8e9 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Mon, 23 Jul 2018 15:41:26 +0200 Subject: [PATCH 09/32] Bump Mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index f4dbef76c981..7d5f4b613660 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit f4dbef76c98182461e70f27c4ab4389e349fcf3a +Subproject commit 7d5f4b61366008d47665bb473205f4ae1f716d1f From ce95d2a47264f60b541646a95fbc3e745e5ffdea Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Tue, 24 Jul 2018 15:04:52 +0200 Subject: [PATCH 10/32] [runtime] always use `mono_jit_set_aot_mode` (#4491) `mono_jit_set_aot_only` is deprecated and accidentally broke with https://github.com/mono/mono/pull/7887 This should fix device tests with `mono-2018-06` --- runtime/exports.t4 | 4 ---- runtime/monotouch-main.m | 1 - tools/mtouch/mtouch.cs | 3 ++- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/runtime/exports.t4 b/runtime/exports.t4 index d145a311b82a..17a89b57f63d 100644 --- a/runtime/exports.t4 +++ b/runtime/exports.t4 @@ -537,10 +537,6 @@ "char**", "argv" ), - new Export ("void", "mono_jit_set_aot_only", - "mono_bool", "aot_only" - ), - new Export ("void", "mono_jit_set_aot_mode", "MonoAotMode", "mode" ), diff --git a/runtime/monotouch-main.m b/runtime/monotouch-main.m index 555181123696..76c068529ac2 100644 --- a/runtime/monotouch-main.m +++ b/runtime/monotouch-main.m @@ -393,7 +393,6 @@ - (void) memoryWarning: (NSNotification *) sender #if defined (__arm__) || defined(__aarch64__) xamarin_register_modules (); - mono_jit_set_aot_only (TRUE); #endif DEBUG_LAUNCH_TIME_PRINT ("\tAOT register time"); diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index 4d51b646ea5f..0ef8571d133b 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -663,7 +663,8 @@ public static string GenerateMain (Application app, IEnumerable assemb sw.WriteLine ("\tmono_sgen_mono_ilgen_init ();"); sw.WriteLine ("\tmono_ee_interp_init (NULL);"); sw.WriteLine ("\tmono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);"); - } + } else if (app.IsDeviceBuild) + sw.WriteLine ("\tmono_jit_set_aot_mode (MONO_AOT_MODE_FULL);"); if (assembly_location.Length > 0) sw.WriteLine ("\txamarin_set_assembly_directories (&assembly_locations);"); From 4bacab3d5c7fa86a0e6437f64bb9f08ea3d0741b Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 26 Jul 2018 14:40:24 +0200 Subject: [PATCH 11/32] Testing with Zoltan's patch --- tools/mtouch/mtouch.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index 0ef8571d133b..ad19b1febee5 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -306,6 +306,8 @@ public static bool GetLLVMAsmWriter (Application app) return app.LLVMAsmWriter.Value; switch (app.Platform) { case ApplePlatform.iOS: + if (app.Is32Build) + return true; return false; case ApplePlatform.TVOS: case ApplePlatform.WatchOS: From 3b18aee93470fc4d5f3b98daf153b71ca6de94ae Mon Sep 17 00:00:00 2001 From: Alexis Christoforides Date: Thu, 19 Jul 2018 15:46:58 -0400 Subject: [PATCH 12/32] Include libmono-system-native on Xamarin.Mac --- builds/Makefile | 2 ++ tests/mmptest/src/LinkerTests.cs | 16 ++++++++++------ tools/mmp/driver.cs | 5 ++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/builds/Makefile b/builds/Makefile index bf872c192f17..91d6bbf73627 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -199,6 +199,7 @@ MAC_BCL_TARGETS = \ MAC_TARGETS = \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/libmono-profiler-log.a \ + $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/libmono-system-native.a \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/libmono-2.0.dylib \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/libmono-2.0.a \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/pkgconfig/mono-2.pc \ @@ -314,6 +315,7 @@ endef $(eval $(call lipo_template_static,libmono-profiler-log.a,mono/profiler)) $(eval $(call lipo_template_static,libmonosgen-2.0.a,mono/mini)) +$(eval $(call lipo_template_static,libmono-system-native.a,mono/metadata)) $(eval $(call lipo_template_dynamic,libmonosgen-2.0.dylib,mono/mini)) $(eval $(call lipo_template_dynamic,libMonoPosixHelper.dylib,support)) diff --git a/tests/mmptest/src/LinkerTests.cs b/tests/mmptest/src/LinkerTests.cs index bc4d8a0001c1..9b8534e70785 100644 --- a/tests/mmptest/src/LinkerTests.cs +++ b/tests/mmptest/src/LinkerTests.cs @@ -86,19 +86,23 @@ public void DynamicSymbolMode (string mode) CSProjConfig = $"--dynamic-symbol-mode={mode}\n", }; var output = TI.TestUnifiedExecutable (config); + string build_output; switch (mode) { case "linker": case "default": - Assert.That (output.BuildOutput, Does.Contain ("-u "), "reference.m"); - Assert.That (output.BuildOutput, Does.Not.Contain ("reference.m"), "reference.m"); + build_output = output.BuildOutput; + Assert.That (build_output, Does.Contain ("-u "), "reference.m"); + Assert.That (build_output, Does.Not.Contain ("reference.m"), "reference.m"); break; case "code": - Assert.That (output.BuildOutput, Does.Not.Contain ("-u "), "reference.m"); - Assert.That (output.BuildOutput, Does.Contain ("reference.m"), "reference.m"); + build_output = output.BuildOutput.Replace ("-u _SystemNative_RealPath", String.Empty); + Assert.That (build_output, Does.Not.Contain ("-u "), "reference.m"); + Assert.That (build_output, Does.Contain ("reference.m"), "reference.m"); break; case "ignore": - Assert.That (output.BuildOutput, Does.Not.Contain ("-u "), "reference.m"); - Assert.That (output.BuildOutput, Does.Not.Contain ("reference.m"), "reference.m"); + build_output = output.BuildOutput.Replace ("-u _SystemNative_RealPath", String.Empty); + Assert.That (build_output, Does.Not.Contain ("-u "), "reference.m"); + Assert.That (build_output, Does.Not.Contain ("reference.m"), "reference.m"); break; default: throw new NotImplementedException (); diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index c1a4e0fb70a3..e03bb577a92b 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -1,4 +1,3 @@ - /* * Copyright 2011-2014 Xamarin Inc. All rights reserved. * Copyright 2010 Novell Inc. @@ -1340,6 +1339,10 @@ static int Compile () args.Append (StringUtils.Quote (lib)).Append (' '); + var libsystem_native_path = Path.Combine (libdir, "libmono-system-native.a"); + args.Append (StringUtils.Quote (libsystem_native_path)).Append (' '); + args.Append ("-u ").Append ("_SystemNative_RealPath").Append (' '); // This keeps libmono_system_native_la-pal_io.o symbols + if (profiling.HasValue && profiling.Value) { args.Append (StringUtils.Quote (Path.Combine (libdir, "libmono-profiler-log.a"))).Append (' '); args.Append ("-u _mono_profiler_init_log -lz "); From b456a32933e348c34ebf28d7be36113a7cf6164c Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 30 Jul 2018 23:12:14 +0200 Subject: [PATCH 13/32] 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: https://github.com/mono/mono/compare/7d5f4b61366008d47665bb473205f4ae1f716d1f...7bcda192a06267562af565d404c06d159f475c03 --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 7d5f4b613660..7bcda192a062 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 7d5f4b61366008d47665bb473205f4ae1f716d1f +Subproject commit 7bcda192a06267562af565d404c06d159f475c03 From 609f7b609fd55ffbc77374902d3181769c0d1c66 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Sat, 28 Jul 2018 01:09:29 -0400 Subject: [PATCH 14/32] Revert 4bacab3d5c7fa86a0e6437f64bb9f08ea3d0741b, it doesn't fix the ios aot problems. --- tools/mtouch/mtouch.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index ad19b1febee5..0ef8571d133b 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -306,8 +306,6 @@ public static bool GetLLVMAsmWriter (Application app) return app.LLVMAsmWriter.Value; switch (app.Platform) { case ApplePlatform.iOS: - if (app.Is32Build) - return true; return false; case ApplePlatform.TVOS: case ApplePlatform.WatchOS: From bda2b1429ece3963afea38e76fd6b803f1366677 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 1 Aug 2018 16:35:07 +0200 Subject: [PATCH 15/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 7bcda192a062..0e0e4a68f947 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 7bcda192a06267562af565d404c06d159f475c03 +Subproject commit 0e0e4a68f947748fdcde3d83d28c99b613f23ba3 From 9946fbd4ddbcae4c69689aa7baad81f37acbbd35 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 2 Aug 2018 11:11:02 +0200 Subject: [PATCH 16/32] [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. --- tests/mtouch/MTouch.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index 17ede9bf0494..3b64158a59d5 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -1770,10 +1770,13 @@ public class B mtouch.Linker = MTouchLinker.DontLink; File.Delete (dllPath); mtouch.AlwaysShowOutput = true; - mtouch.AssertExecute (MTouchAction.BuildSim, "build"); + mtouch.AssertExecuteFailure (MTouchAction.BuildSim, "build"); + mtouch.AssertWarningPattern (136, "Cannot find the assembly 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '.*/testApp.exe'."); mtouch.AssertWarning (137, "Cannot find the assembly 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null', referenced by a MyCustomAttribute attribute in 'testApp.exe'."); mtouch.AssertWarning (137, "Cannot find the assembly 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null', referenced by a System.Diagnostics.DebuggerTypeProxyAttribute attribute in 'testApp.exe'."); - mtouch.AssertWarningCount (2); + mtouch.AssertWarningCount (3); + mtouch.AssertError (2002, "Failed to resolve assembly: 'A, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'"); + mtouch.AssertErrorCount (1); } } From fc561b247cc0bfef0a365c4d9e27c5db26eed542 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 2 Aug 2018 11:21:28 +0200 Subject: [PATCH 17/32] [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 --- .../Xamarin.MacDev.Tasks.Core/Tasks/ACToolTaskBase.cs | 11 +++++++---- .../Xamarin.iOS.Tasks.Tests/ProjectsTests/Bug60536.cs | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/ACToolTaskBase.cs b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/ACToolTaskBase.cs index c0f80b2c5524..40db30af347f 100644 --- a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/ACToolTaskBase.cs +++ b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/ACToolTaskBase.cs @@ -390,12 +390,15 @@ public override bool Execute () int line = 0, column = 0; int index, endIndex; - if ((index = ex.Message.IndexOf ("At line ", StringComparison.Ordinal)) != -1) { + var message = ex.Message; + if (message.EndsWith (".", StringComparison.Ordinal)) + message = message.Substring (0, message.Length - 1); + if ((index = message.IndexOf ("At line ", StringComparison.Ordinal)) != -1) { index += "At line ".Length; - if ((endIndex = ex.Message.IndexOf (", column ", index, StringComparison.Ordinal)) != -1) { - var columnBuf = ex.Message.Substring (endIndex + ", column ".Length); - var lineBuf = ex.Message.Substring (index, endIndex - index); + if ((endIndex = message.IndexOf (", column ", index, StringComparison.Ordinal)) != -1) { + var columnBuf = message.Substring (endIndex + ", column ".Length); + var lineBuf = message.Substring (index, endIndex - index); int.TryParse (columnBuf, out column); int.TryParse (lineBuf, out line); diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/Bug60536.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/Bug60536.cs index 4d3cecea167d..2feaea790b00 100644 --- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/Bug60536.cs +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/Bug60536.cs @@ -71,7 +71,7 @@ public void TestACToolTaskCatchesJsonException () Assert.AreEqual (2, Engine.Logger.ErrorEvents[0].ColumnNumber, "ColumnNumber"); Assert.AreEqual (197, Engine.Logger.ErrorEvents[0].EndLineNumber, "EndLineNumber"); Assert.AreEqual (2, Engine.Logger.ErrorEvents[0].EndColumnNumber, "EndColumnNumber"); - Assert.AreEqual ("Unexpected character ']'. At line 197, column 2", Engine.Logger.ErrorEvents[0].Message, "Message"); + Assert.AreEqual ("Unexpected character ']'. At line 197, column 2.", Engine.Logger.ErrorEvents[0].Message, "Message"); } } } From db6b3b7c72fd91a991c6e17733847c8f384998a6 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 7 Aug 2018 09:45:11 +0200 Subject: [PATCH 18/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index dc815ae5623e..925d10ba9c49 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit dc815ae5623e963e6fce54dec8a2601bcf501084 +Subproject commit 925d10ba9c49e94fc89eb1691ae09a9908c14cc9 From 6c5544ebb8c981d1b696a9231afa4a8a2d2b1ad2 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Tue, 7 Aug 2018 04:07:54 -0400 Subject: [PATCH 19/32] [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that. --- builds/Makefile | 8 ++++++++ tools/mtouch/mtouch.cs | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/builds/Makefile b/builds/Makefile index 91d6bbf73627..ee03daca9e6b 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -1512,13 +1512,21 @@ install-llvm: install-llvm32 install-llvm64 LLVM_TARGETS = \ $(PREFIX)/LLVM/bin/opt \ $(PREFIX)/LLVM/bin/llc \ + $(PREFIX)/LLVM36/bin/opt \ + $(PREFIX)/LLVM36/bin/llc $(PREFIX)/LLVM/bin/%: $(SDK_DESTDIR)/ios-llvm64/bin/% | $(PREFIX)/LLVM/bin $(call Q_2,INSTALL ,[LLVM64]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ +$(PREFIX)/LLVM36/bin/%: $(SDK_DESTDIR)/ios-llvm36-32/bin/% | $(PREFIX)/LLVM36/bin + $(call Q_2,INSTALL ,[LLVM64]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ + $(PREFIX)/LLVM/bin: $(Q) mkdir -p $@ +$(PREFIX)/LLVM36/bin: + $(Q) mkdir -p $@ + install-llvm32:.stamp-build-llvm $(LLVM_TARGETS) install-llvm64: .stamp-build-llvm $(LLVM_TARGETS) diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index 78a3556910b2..983bc6a64f5e 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -456,6 +456,7 @@ public static string GetAotArguments (Application app, string filename, Abi abi, bool enable_debug_symbols = app.PackageManagedDebugSymbols; bool llvm_only = app.EnableLLVMOnlyBitCode; bool interp = app.UseInterpreter; + bool is32bit = (abi & Abi.Arch32Mask) > 0; string arch = abi.AsArchString (); args.Append ("--debug "); @@ -503,7 +504,7 @@ public static string GetAotArguments (Application app, string filename, Abi abi, } if (enable_llvm) - args.Append ("llvm-path=").Append (MonoTouchDirectory).Append ("/LLVM/bin/,"); + args.Append ("llvm-path=").Append (MonoTouchDirectory).Append (is32bit ? "/LLVM36/bin/," : "/LLVM/bin/,"); if (!llvm_only) args.Append ("outfile=").Append (StringUtils.Quote (outputFile)); From 3901d8e2726bcbd81c18af0a2f3bcb5cd6d787b6 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 8 Aug 2018 10:50:08 +0200 Subject: [PATCH 20/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 925d10ba9c49..a8b65e127b5e 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 925d10ba9c49e94fc89eb1691ae09a9908c14cc9 +Subproject commit a8b65e127b5e4ce072bef31359dfa18073996159 From b3245a6930b7a6f4eaccdee01f9dbba520a0d205 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 29 Aug 2018 14:47:19 +0200 Subject: [PATCH 21/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index a8b65e127b5e..f9c42ea71673 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit a8b65e127b5e4ce072bef31359dfa18073996159 +Subproject commit f9c42ea71673aabe0010be96274038cb7561dce2 From dc0ccb33fd46f139f43071e6b15488cc566e74cc Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 21 Aug 2018 23:31:42 +0200 Subject: [PATCH 22/32] [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). --- jenkins/Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index f6332702da16..d7014c8200e8 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -366,8 +366,12 @@ timestamps { } else { def outputFile = "${workspace}/xamarin-macios/wrench-launch-external.output.tmp" try { + // VSTS does not allow any branch name anymore, it has to be an existing branch. + // Since pull requests don't create branches in the xamarin org (that VSTS sees at least), + // I've created a 'pull-request' branch which we'll use for pull requests. + def vsts_branch = isPr ? "pull-request" : branchName; withCredentials ([string (credentialsId: 'macios_provisionator_pat', variable: 'PROVISIONATOR_VSTS_PAT')]) { - sh ("make -C ${workspace}/xamarin-macios/tests wrench-launch-external MAC_PACKAGE_URL=${xmPackageUrl} IOS_PACKAGE_URL=${xiPackageUrl} WRENCH_URL=${env.RUN_DISPLAY_URL} BUILD_REVISION=${gitHash} BUILD_LANE=jenkins/${branchName} BUILD_WORK_HOST=${env.NODE_NAME} 2>&1 | tee ${outputFile}") + sh ("make -C ${workspace}/xamarin-macios/tests wrench-launch-external MAC_PACKAGE_URL=${xmPackageUrl} IOS_PACKAGE_URL=${xiPackageUrl} WRENCH_URL=${env.RUN_DISPLAY_URL} BUILD_REVISION=${gitHash} BUILD_LANE=${vsts_branch} BUILD_WORK_HOST=${env.NODE_NAME} 2>&1 | tee ${outputFile}") } processAtMonkeyWrench (outputFile) } catch (error) { From d491fd46b6495ad4089570b3afecf3b018adbf30 Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Wed, 29 Aug 2018 12:28:42 +0300 Subject: [PATCH 23/32] Assembly.LoadFile accepts only absolute path --- tests/linker/ios/link all/LinkAllTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/linker/ios/link all/LinkAllTest.cs b/tests/linker/ios/link all/LinkAllTest.cs index 95c677ca8813..6369fa62b861 100644 --- a/tests/linker/ios/link all/LinkAllTest.cs +++ b/tests/linker/ios/link all/LinkAllTest.cs @@ -270,7 +270,7 @@ string FindAssemblyPath () public void Assembly_LoadFile () { string filename = FindAssemblyPath (); - Assert.NotNull (Assembly.LoadFile (filename), "1"); + Assert.NotNull (Assembly.LoadFile (Path.GetFullPath (filename)), "1"); } [Test] From f69a8fc169fe3661d9110c6b2374acb06852e0c7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 30 Aug 2018 15:01:18 +0200 Subject: [PATCH 24/32] [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" > --- tools/linker/MobileProfile.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/linker/MobileProfile.cs b/tools/linker/MobileProfile.cs index d16616930a94..5e5c453e9d12 100644 --- a/tools/linker/MobileProfile.cs +++ b/tools/linker/MobileProfile.cs @@ -172,6 +172,7 @@ public abstract class MobileProfile : BaseProfile { "System.Threading.Overlapped", "System.Threading.Tasks.Parallel", "System.Threading.Tasks", + "System.Threading.Tasks.Extensions", "System.Threading.Thread", "System.Threading.ThreadPool", "System.Threading.Timer", From c7654a0457a56827452bcddad9821c655d05922f Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 2 Sep 2018 15:24:44 -0400 Subject: [PATCH 25/32] [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732) --- builds/Makefile | 14 +++++++------- configure | 2 +- external/mono | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/builds/Makefile b/builds/Makefile index ee03daca9e6b..988ee3674380 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -90,10 +90,10 @@ CCACHE_CXXFLAGS=-Qunused-arguments # Configuration for the mono sdk makefiles # SDK_CONFIG=$(MONO_PATH)/sdks/Make.config -SDK_ARGS=XCODE_DIR=$(XCODE_DEVELOPER_ROOT) IOS_VERSION=$(IOS_SDK_VERSION) IOS_VERSION_MIN=$(MIN_IOS_SDK_VERSION) TVOS_VERSION=$(TVOS_SDK_VERSION) TVOS_VERSION_MIN=$(MIN_TVOS_SDK_VERSION) WATCHOS_VERSION=$(WATCH_SDK_VERSION) WATCHOS_VERSION_MIN=$(MIN_WATCHOS_SDK_VERSION) +SDK_ARGS=XCODE_DIR=$(XCODE_DEVELOPER_ROOT) IOS_VERSION=$(IOS_SDK_VERSION) IOS_VERSION_MIN=$(MIN_IOS_SDK_VERSION) TVOS_VERSION=$(TVOS_SDK_VERSION) TVOS_VERSION_MIN=$(MIN_TVOS_SDK_VERSION) WATCHOS_VERSION=$(WATCH_SDK_VERSION) WATCHOS_VERSION_MIN=$(MIN_WATCHOS_SDK_VERSION) IGNORE_PROVISION_LLVM=1 -ifdef IGNORE_PACKAGE_LLVM -SDK_ARGS += IGNORE_PACKAGE_LLVM=1 +ifdef DISABLE_DOWNLOAD_LLVM +SDK_ARGS += DISABLE_DOWNLOAD_LLVM=1 endif SDK_BUILDDIR = $(MONO_PATH)/sdks/builds @@ -1498,11 +1498,11 @@ build-llvm32: .stamp-build-llvm build-llvm64: .stamp-build-llvm .stamp-build-llvm: $(SDK_CONFIG) - $(MAKE) -C $(SDK_BUILDDIR) build-ios-llvm $(SDK_ARGS) + $(MAKE) -C $(SDK_BUILDDIR) provision-llvm36-llvm32 provision-llvm-llvm64 $(SDK_ARGS) $(Q) touch $@ clean-llvm: $(SDK_CONFIG) - $(MAKE) -C $(SDK_BUILDDIR) clean-ios-llvm $(SDK_ARGS) + $(MAKE) -C $(SDK_BUILDDIR) clean-llvm36-llvm32 clean-llvm-llvm64 $(SDK_ARGS) $(RM) .stamp-*-llvm* .PHONY: install-llvm64 llvm llvm64 @@ -1515,10 +1515,10 @@ LLVM_TARGETS = \ $(PREFIX)/LLVM36/bin/opt \ $(PREFIX)/LLVM36/bin/llc -$(PREFIX)/LLVM/bin/%: $(SDK_DESTDIR)/ios-llvm64/bin/% | $(PREFIX)/LLVM/bin +$(PREFIX)/LLVM/bin/%: $(SDK_DESTDIR)/llvm-llvm64/bin/% | $(PREFIX)/LLVM/bin $(call Q_2,INSTALL ,[LLVM64]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ -$(PREFIX)/LLVM36/bin/%: $(SDK_DESTDIR)/ios-llvm36-32/bin/% | $(PREFIX)/LLVM36/bin +$(PREFIX)/LLVM36/bin/%: $(SDK_DESTDIR)/llvm36-llvm32/bin/% | $(PREFIX)/LLVM36/bin $(call Q_2,INSTALL ,[LLVM64]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ $(PREFIX)/LLVM/bin: diff --git a/configure b/configure index a5a53a72e602..611226256305 100755 --- a/configure +++ b/configure @@ -85,7 +85,7 @@ while test x$1 != x; do shift ;; --disable-packaged-llvm) - echo "IGNORE_PACKAGE_LLVM=1" >> $CONFIGURED_FILE + echo "DISABLE_DOWNLOAD_LLVM=1" >> $CONFIGURED_FILE shift ;; --help|-h) diff --git a/external/mono b/external/mono index f9c42ea71673..330eec3b4c97 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit f9c42ea71673aabe0010be96274038cb7561dce2 +Subproject commit 330eec3b4c970e85536637686b5332d6b0863dc3 From a285ec72bce1fe52fc84a9738c47b6fee9373ce9 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 5 Sep 2018 13:56:56 +0200 Subject: [PATCH 26/32] Bump Mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 330eec3b4c97..9439ee6dca22 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 330eec3b4c970e85536637686b5332d6b0863dc3 +Subproject commit 9439ee6dca229584a3f94fc1733639cce1fcca5b From cdbf1227d2f41a3fb7ded30edb99fdeca03ef4f8 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Tue, 11 Sep 2018 14:06:53 +0200 Subject: [PATCH 27/32] [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. --- .../Tasks/MTouchTaskBase.cs | 7 +-- .../Xamarin.iOS.Common.props | 1 - .../Xamarin.iOS.Common.targets | 2 +- tests/common/BundlerTool.cs | 8 ++- tests/mtouch/MTouch.cs | 19 +++++++ tests/xharness/Jenkins.cs | 3 + tools/common/Application.cs | 1 - tools/mtouch/Application.cs | 57 ++++++++++++++++++- tools/mtouch/Assembly.cs | 17 +++--- tools/mtouch/Target.cs | 25 ++++++++ tools/mtouch/mtouch.cs | 22 +++++-- 11 files changed, 139 insertions(+), 23 deletions(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs index c0159bc5bc34..7d58d6e37591 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs +++ b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs @@ -106,8 +106,7 @@ public GccOptions () [Required] public bool EnableSGenConc { get; set; } - [Required] - public bool UseInterpreter { get; set; } + public string Interpreter { get; set; } [Required] public bool LinkerDumpDependencies { get; set; } @@ -405,8 +404,8 @@ protected override string GenerateCommandLineCommands () if (EnableSGenConc) args.AddLine ("--sgen-conc"); - if (UseInterpreter) - args.Add ("--interpreter"); + if (!string.IsNullOrEmpty (Interpreter)) + args.Add ($"--interpreter={Interpreter}"); switch (LinkMode.ToLowerInvariant ()) { case "sdkonly": args.AddLine ("--linksdkonly"); break; diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.props b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.props index de1f2acdf112..a29b7e7a18e5 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.props +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.props @@ -51,7 +51,6 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. False $(MSBuildProjectDirectory) False - False 2 true diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets index db613f01c062..ff54f2301f14 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets @@ -831,7 +831,7 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. UseThumb="$(MtouchUseThumb)" EnableBitcode="$(MtouchEnableBitcode)" EnableSGenConc="$(MtouchEnableSGenConc)" - UseInterpreter="$(MtouchUseInterpreter)" + Interpreter="$(MtouchInterpreter)" AppExtensionReferences="@(_ResolvedAppExtensionReferences)" ArchiveSymbols="$(MonoSymbolArchive)" Verbosity="$(MtouchVerbosity)" diff --git a/tests/common/BundlerTool.cs b/tests/common/BundlerTool.cs index 498c95d6076e..65fba9979882 100644 --- a/tests/common/BundlerTool.cs +++ b/tests/common/BundlerTool.cs @@ -74,6 +74,7 @@ abstract class BundlerTool : Tool public int Verbosity; public int [] WarnAsError; // null array: nothing passed to mtouch/mmp. empty array: pass --warnaserror (which means makes all warnings errors). public string [] XmlDefinitions; + public string Interpreter; // These are a bit smarter public bool NoPlatformAssemblyReference; @@ -291,7 +292,12 @@ protected virtual void BuildArguments (StringBuilder sb) sb.Append (" --xml:").Append (StringUtils.Quote (xd)); } - + if (Interpreter != null) { + if (Interpreter.Length == 0) + sb.Append (" --interpreter"); + else + sb.Append (" --interpreter=").Append (Interpreter); + } } public string CreateTemporaryDirectory () diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index 34cca5475041..4644e1001ee1 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -1780,6 +1780,25 @@ public class B } } + [Test] + public void MT0138 () + { + using (var mtouch = new MTouchTool ()) { + var tmpdir = mtouch.CreateTemporaryDirectory (); + mtouch.CreateTemporaryCacheDirectory (); + + mtouch.CreateTemporaryApp (); + mtouch.WarnAsError = new int [] { 138 }; // This is just to make mtouch bail out early instead of spending time building the app when that's not what we're interested in. + mtouch.Interpreter = "all,-all,foo,-bar,mscorlib.dll,mscorlib"; + mtouch.AssertExecuteFailure (MTouchAction.BuildSim, "build"); + mtouch.AssertError (138, "Cannot find the assembly 'foo', passed as an argument to --interpreter."); + mtouch.AssertError (138, "Cannot find the assembly 'bar', passed as an argument to --interpreter."); + mtouch.AssertError (138, "Cannot find the assembly 'mscorlib.dll', passed as an argument to --interpreter."); + // just the name, without the extension, is the right way. + mtouch.AssertErrorCount (3); + } + } + [Test] [TestCase ("all")] [TestCase ("-all")] diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index fa67c59abd40..5cc986274557 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -182,12 +182,15 @@ IEnumerable GetTestData (RunTestTask test) yield return new TestData { Variation = "Release (all optimizations)", MTouchExtraArgs = "--registrar:static --optimize:all", Debug = false, Profiling = false, Defines = "OPTIMIZEALL" }; yield return new TestData { Variation = "Debug (all optimizations)", MTouchExtraArgs = "--registrar:static --optimize:all", Debug = true, Profiling = false, Defines = "OPTIMIZEALL" }; yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Ignored = true, }; + yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Ignored = true, }; break; case "mscorlib": yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Ignored = true, Undefines = "FULL_AOT_RUNTIME" }; + yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Ignored = true, Undefines = "FULL_AOT_RUNTIME" }; break; case "mini": yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; break; } break; diff --git a/tools/common/Application.cs b/tools/common/Application.cs index 01b661a2b4d0..b111651dbf80 100644 --- a/tools/common/Application.cs +++ b/tools/common/Application.cs @@ -63,7 +63,6 @@ public partial class Application public bool? EnableCoopGC; public bool EnableSGenConc; - public bool UseInterpreter; public MarshalObjectiveCExceptionMode MarshalObjectiveCExceptions; public MarshalManagedExceptionMode MarshalManagedExceptions; diff --git a/tools/mtouch/Application.cs b/tools/mtouch/Application.cs index 3827c9deeb41..9d8d6d336441 100644 --- a/tools/mtouch/Application.cs +++ b/tools/mtouch/Application.cs @@ -116,6 +116,8 @@ public bool EnableMSym { public string AotOtherArguments = string.Empty; public bool? LLVMAsmWriter; public Dictionary LLVMOptimizations = new Dictionary (); + public bool UseInterpreter; + public List InterpretedAssemblies = new List (); public Dictionary EnvironmentVariables = new Dictionary (); @@ -129,6 +131,44 @@ public bool EnableMSym { public bool? BuildDSym; + public bool IsInterpreted (string assembly) + { + // IsAOTCompiled and IsInterpreted are not opposites: mscorlib.dll can be both. + if (!UseInterpreter) + return false; + + // Go through the list of assemblies to interpret in reverse order, + // so that the last option passed to mtouch takes precedence. + for (int i = InterpretedAssemblies.Count - 1; i >= 0; i--) { + var opt = InterpretedAssemblies [i]; + if (opt == "all") + return true; + else if (opt == "-all") + return false; + else if (opt == assembly) + return true; + else if (opt [0] == '-' && opt.Substring (1) == assembly) + return false; + } + + // There's an implicit 'all' at the start of the list. + return true; + } + + public bool IsAOTCompiled (string assembly) + { + if (!UseInterpreter) + return true; + + // IsAOTCompiled and IsInterpreted are not opposites: mscorlib.dll can be both: + // - mscorlib will always be processed by the AOT compiler to generate required wrapper functions for the interpreter to work + // - mscorlib might also be fully AOT-compiled (both when the interpreter is enabled and when it's not) + if (assembly == "mscorlib") + return true; + + return !IsInterpreted (assembly); + } + // If we're targetting a 32 bit arch. bool? is32bits; public bool Is32Build { @@ -462,7 +502,7 @@ public bool UseDlsym (string assembly) if (EnableLLVMOnlyBitCode) return false; - if (UseInterpreter) + if (IsInterpreted (Assembly.GetIdentity (assembly))) return true; switch (Platform) { @@ -2124,7 +2164,20 @@ public void StripNativeCode () public void BundleAssemblies () { - var strip = !UseInterpreter && ManagedStrip && IsDeviceBuild && !EnableDebug && !PackageManagedDebugSymbols; + Assembly.StripAssembly strip = ((path) => + { + if (!ManagedStrip) + return false; + if (!IsDeviceBuild) + return false; + if (EnableDebug) + return false; + if (PackageManagedDebugSymbols) + return false; + if (IsInterpreted (Assembly.GetIdentity (path))) + return false; + return true; + }); var grouped = Targets.SelectMany ((Target t) => t.Assemblies).GroupBy ((Assembly asm) => asm.Identity); foreach (var @group in grouped) { diff --git a/tools/mtouch/Assembly.cs b/tools/mtouch/Assembly.cs index e7618983ada0..ac37322c80c3 100644 --- a/tools/mtouch/Assembly.cs +++ b/tools/mtouch/Assembly.cs @@ -54,11 +54,7 @@ public HashSet DependencyMap { public bool IsAOTCompiled { get { - if (App.UseInterpreter) - /* interpreter only requires a few stubs that are attached - * to mscorlib.dll, other assemblies won't be AOT compiled */ - return FileName == "mscorlib.dll"; - return true; + return App.IsAOTCompiled (Identity); } } @@ -108,15 +104,18 @@ public void ComputeDependencyMap (List exceptions) ComputeDependencies (exceptions); } + public delegate bool StripAssembly (string path); + // returns false if the assembly was not copied (because it was already up-to-date). - public bool CopyAssembly (string source, string target, bool copy_debug_symbols = true, bool strip = false) + public bool CopyAssembly (string source, string target, bool copy_debug_symbols = true, StripAssembly strip = null) { var copied = false; try { - if (!Application.IsUptodate (source, target) && (strip || !Cache.CompareAssemblies (source, target))) { + var strip_assembly = strip != null && strip (source); + if (!Application.IsUptodate (source, target) && (strip_assembly || !Cache.CompareAssemblies (source, target))) { copied = true; - if (strip) { + if (strip_assembly) { Driver.FileDelete (target); Directory.CreateDirectory (Path.GetDirectoryName (target)); MonoTouch.Tuner.Stripper.Process (source, target); @@ -195,7 +194,7 @@ public void CopyConfigToDirectory (string directory) // Aot data is copied separately, because we might want to copy aot data // even if we don't want to copy the assembly (if 32/64-bit assemblies are identical, // only one is copied, but we still want the aotdata for both). - public void CopyToDirectory (string directory, bool reload = true, bool check_case = false, bool only_copy = false, bool copy_debug_symbols = true, bool strip = false) + public void CopyToDirectory (string directory, bool reload = true, bool check_case = false, bool only_copy = false, bool copy_debug_symbols = true, StripAssembly strip = null) { var target = Path.Combine (directory, FileName); diff --git a/tools/mtouch/Target.cs b/tools/mtouch/Target.cs index 75585bd4394d..fdd067bf1d80 100644 --- a/tools/mtouch/Target.cs +++ b/tools/mtouch/Target.cs @@ -283,6 +283,29 @@ public void Initialize (bool show_warnings) } linker_flags = new CompilerFlags (this); + + // Verify that there are no entries in our list of intepreted assemblies that doesn't match + // any of the assemblies we know about. + if (App.UseInterpreter) { + var exceptions = new List (); + foreach (var entry in App.InterpretedAssemblies) { + var assembly = entry; + if (string.IsNullOrEmpty (assembly)) + continue; + + if (assembly [0] == '-') + assembly = assembly.Substring (1); + + if (assembly == "all") + continue; + + if (Assemblies.ContainsKey (assembly)) + continue; + + exceptions.Add (ErrorHelper.CreateWarning (138, $"Cannot find the assembly '{assembly}', passed as an argument to --interpreter.")); + } + ErrorHelper.ThrowIfErrors (exceptions); + } } // This is to load the symbols for all assemblies, so that we can give better error messages @@ -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? */ return; // Code in one assembly (either in a P/Invoke or a third-party library) can depend on a third-party library in another assembly. diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index 983bc6a64f5e..ed27746d98e8 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -455,7 +455,8 @@ public static string GetAotArguments (Application app, string filename, Abi abi, bool enable_debug = app.EnableDebug; bool enable_debug_symbols = app.PackageManagedDebugSymbols; bool llvm_only = app.EnableLLVMOnlyBitCode; - bool interp = app.UseInterpreter; + bool interp = app.IsInterpreted (Assembly.GetIdentity (filename)); + bool interp_full = !interp && app.UseInterpreter && fname == "mscorlib.dll"; bool is32bit = (abi & Abi.Arch32Mask) > 0; string arch = abi.AsArchString (); @@ -474,9 +475,15 @@ public static string GetAotArguments (Application app, string filename, Abi abi, args.Append (app.AotArguments); if (llvm_only) args.Append ("llvmonly,"); - else if (interp) + else if (interp) { + if (fname != "mscorlib.dll") + throw ErrorHelper.CreateError (99, $"Internal error: can only enable the interpreter for mscorlib.dll when AOT-compiling assemblies (tried to interpret {fname}). Please file an issue at https://github.com/xamarin/xamarin-macios/issues/new."); args.Append ("interp,"); - else + } else if (interp_full) { + if (fname != "mscorlib.dll") + throw ErrorHelper.CreateError (99, $"Internal error: can only enable the interpreter for mscorlib.dll when AOT-compiling assemblies (tried to interpret {fname}). Please file an issue at https://github.com/xamarin/xamarin-macios/issues/new."); + args.Append ("interp,full,"); + } else args.Append ("full,"); var aname = Path.GetFileNameWithoutExtension (fname); @@ -1247,7 +1254,14 @@ static Application ParseArguments (string [] args, out Action a) app.LLVMOptimizations [asm] = opt; } }, - { "interpreter", "Enable the *experimental* interpreter.", v => { app.UseInterpreter = true; }}, + { "interpreter:", "Enable the *experimental* 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. This argument can be specified multiple times.", v => + { + app.UseInterpreter = true; + if (!string.IsNullOrEmpty (v)) { + app.InterpretedAssemblies.AddRange (v.Split (new char [] { ',' }, StringSplitOptions.RemoveEmptyEntries)); + } + } + }, { "http-message-handler=", "Specify the default HTTP message handler for HttpClient", v => { http_message_handler = v; }}, { "output-format=", "Specify the output format for some commands. Possible values: Default, XML", v => { From aa6b803262e39102a1d996e54898c74dce1a0c55 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 13 Sep 2018 10:20:45 +0200 Subject: [PATCH 28/32] Bump Mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 9439ee6dca22..e944415e2629 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 9439ee6dca229584a3f94fc1733639cce1fcca5b +Subproject commit e944415e26295216ab91f6de0cc64b191e835f3f From 7a4ee2e1357f2dc7516cdc6c603882739458c4f5 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 13 Sep 2018 10:21:15 +0200 Subject: [PATCH 29/32] [linker] Updates SDKs facades list --- tools/linker/MobileProfile.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/linker/MobileProfile.cs b/tools/linker/MobileProfile.cs index 5e5c453e9d12..4e4de790b1df 100644 --- a/tools/linker/MobileProfile.cs +++ b/tools/linker/MobileProfile.cs @@ -48,6 +48,7 @@ public abstract class MobileProfile : BaseProfile { "Microsoft.Win32.Registry.AccessControl", "Microsoft.Win32.Registry", "System.AppContext", + "System.Buffers", "System.Collections.Concurrent", "System.Collections.NonGeneric", "System.Collections.Specialized", From a5df51dd9c349aea791dca5827f35ab284215937 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 13 Sep 2018 13:55:29 +0200 Subject: [PATCH 30/32] Bump mono --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index e944415e2629..fbaeba4fec17 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit e944415e26295216ab91f6de0cc64b191e835f3f +Subproject commit fbaeba4fec17df1c730550e2355316121f309976 From ac8fd9e60aba0fae174eb7175a54d42a3c6b61f1 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 13 Sep 2018 14:40:32 +0200 Subject: [PATCH 31/32] [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 --- .../Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in | 5 ++++- .../Xamarin.WatchOS-FrameworkList.xml.in | 5 ++++- .../Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in index 6028d69d6556..2d579a291a41 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in @@ -1,2 +1,5 @@ - + + + + diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in index 2e7e853b8398..2936eefda152 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in @@ -1,2 +1,5 @@ - + + + + diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in index b5b1541c468b..00ca97959d49 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in @@ -1,2 +1,5 @@ - + + + + From 894315a26c445123e65209f694cbf04fa2769bc4 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 1 Oct 2018 10:13:15 +0200 Subject: [PATCH 32/32] Bump to a VSfM version that can build XM Classic projects. --- Make.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Make.config b/Make.config index 4e4cfe186024..4a46f2461ce1 100644 --- a/Make.config +++ b/Make.config @@ -71,9 +71,9 @@ MIN_XM_MONO_VERSION=5.14.0.136 MIN_XM_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-04/111/07c8f25fe536dbb7e244f965aa3f9a871f41e953/MonoFramework-MDK-5.14.0.136.macos10.xamarin.universal.pkg # Minimum Visual Studio version -MIN_VISUAL_STUDIO_URL=https://download.visualstudio.microsoft.com/download/pr/11550896/783d2219a348f93b6988fb415951788a/VisualStudioForMac-Preview-7.4.0.985.dmg -MIN_VISUAL_STUDIO_VERSION=7.4.0.985 -MAX_VISUAL_STUDIO_VERSION=7.5.99 +MIN_VISUAL_STUDIO_URL=https://bosstoragemirror.azureedge.net/vsmac/7a/7aff2dc1f28d711d11d63d79b2a4c49cda217189/VisualStudioForMac-Preview-7.7.0.1470.dmg +MIN_VISUAL_STUDIO_VERSION=7.7.0.1470 +MAX_VISUAL_STUDIO_VERSION=7.8.99 # Minimum CMake version MIN_CMAKE_URL=https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.dmg