From b16f41abd0a04163e8da49a7cf7a87f9c36de37e Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 15 Oct 2019 23:50:42 +0200 Subject: [PATCH 01/55] [linker] Ensure we can remove NSUrlSessionHandler if unused (#7164) Moving `NSUrlSessionHandler` into the platform assemblies (e.g. Xamarin.iOS.dll) instead of System.Net.Http.dll was not optimal as it prevented the linker to remove it when the application did not use it. This shows a lot in an "helloworld" type of application (see below) but in real life most of the removed code gets used by something else (and is included. ``` Directories / Files helloworld-d16-4.app helloworld-fixed.app diff % ./ AppIcon60x60@2x.png 2,632 2,632 0 0.00 % AppIcon76x76@2x~ipad.png 3,125 3,125 0 0.00 % archived-expanded-entitlements.xcent 181 181 0 0.00 % Assets.car 75,688 75,688 0 0.00 % embedded.mobileprovision 8,456 8,456 0 0.00 % helloworld 4,700,256 3,915,936 -784,320 -16.69 % helloworld.aotdata.arm64 1,448 1,432 -16 -1.10 % helloworld.exe 6,144 6,144 0 0.00 % Info.plist 1,712 1,712 0 0.00 % mscorlib.aotdata.arm64 406,080 364,104 -41,976 -10.34 % mscorlib.dll 561,664 501,760 -59,904 -10.67 % NOTICE 159 159 0 0.00 % PkgInfo 8 8 0 0.00 % System.aotdata.arm64 17,008 936 -16,072 -94.50 % System.Core.aotdata.arm64 2,432 0 -2,432 -100.00 % System.Core.dll 4,608 0 -4,608 -100.00 % System.dll 32,768 5,120 -27,648 -84.38 % System.Net.Http.aotdata.arm64 31,648 0 -31,648 -100.00 % System.Net.Http.dll 29,184 0 -29,184 -100.00 % Xamarin.iOS.aotdata.arm64 62,544 33,464 -29,080 -46.50 % Xamarin.iOS.dll 92,672 53,248 -39,424 -42.54 % ./_CodeSignature CodeResources 7,575 6,655 -920 -12.15 % ./LaunchScreen.storyboardc 01J-lp-oVM-view-Ze5-6b-2t3.nib 1,831 1,835 4 0.22 % Info.plist 258 258 0 0.00 % UIViewController-01J-lp-oVM.nib 896 896 0 0.00 % ./Main.storyboardc BYZ-38-t0r-view-8bC-Xf-vdC.nib 1,836 1,832 -4 -0.22 % Info.plist 258 258 0 0.00 % UIViewController-BYZ-38-t0r.nib 916 916 0 0.00 % Statistics Native subtotal 4,700,256 3,915,936 -784,320 -16.69 % Executable 4,700,256 3,915,936 -784,320 -16.69 % AOT data *.aotdata 0 0 0 - Managed *.dll/exe 727,040 566,272 -160,768 -22.11 % TOTAL 6,053,987 4,986,755 -1,067,232 -17.63 % ``` --- src/Foundation/NSUrlSessionHandler.cs | 16 ++++++---------- src/ObjCRuntime/RuntimeOptions.cs | 1 - tools/linker/MarkNSObjects.cs | 4 +--- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Foundation/NSUrlSessionHandler.cs b/src/Foundation/NSUrlSessionHandler.cs index b559c2f8fa..20bb46b6f5 100644 --- a/src/Foundation/NSUrlSessionHandler.cs +++ b/src/Foundation/NSUrlSessionHandler.cs @@ -459,8 +459,6 @@ namespace Foundation { return await tcs.Task.ConfigureAwait (false); } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] partial class NSUrlSessionHandlerDelegate : NSUrlSessionDataDelegate { readonly NSUrlSessionHandler sessionHandler; @@ -487,6 +485,7 @@ namespace Foundation { return null; } + [Preserve (Conditional = true)] public override void DidReceiveResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSUrlResponse response, Action completionHandler) { var inflight = GetInflightData (dataTask); @@ -549,6 +548,7 @@ namespace Foundation { completionHandler (NSUrlSessionResponseDisposition.Allow); } + [Preserve (Conditional = true)] public override void DidReceiveData (NSUrlSession session, NSUrlSessionDataTask dataTask, NSData data) { var inflight = GetInflightData (dataTask); @@ -560,6 +560,7 @@ namespace Foundation { SetResponse (inflight); } + [Preserve (Conditional = true)] public override void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, NSError error) { var inflight = GetInflightData (task); @@ -608,16 +609,19 @@ namespace Foundation { } } + [Preserve (Conditional = true)] public override void WillCacheResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSCachedUrlResponse proposedResponse, Action completionHandler) { completionHandler (sessionHandler.DisableCaching ? null : proposedResponse); } + [Preserve (Conditional = true)] public override void WillPerformHttpRedirection (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response, NSUrlRequest newRequest, Action completionHandler) { completionHandler (sessionHandler.AllowAutoRedirect ? newRequest : null); } + [Preserve (Conditional = true)] public override void DidReceiveChallenge (NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, Action completionHandler) { var inflight = GetInflightData (task); @@ -705,8 +709,6 @@ namespace Foundation { } } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class InflightData : IDisposable { public readonly object Lock = new object (); @@ -745,8 +747,6 @@ namespace Foundation { } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class NSUrlSessionDataTaskStreamContent : MonoStreamContent { Action disposed; @@ -857,8 +857,6 @@ namespace Foundation { } } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class NSUrlSessionDataTaskStream : Stream { readonly Queue data; @@ -1004,8 +1002,6 @@ namespace Foundation { } } - // Needed since we strip during linking since we're inside a product assembly. - [Preserve (AllMembers = true)] class WrappedNSInputStream : NSInputStream { NSStreamStatus status; diff --git a/src/ObjCRuntime/RuntimeOptions.cs b/src/ObjCRuntime/RuntimeOptions.cs index 0be4980ca7..bbcbaecb8d 100644 --- a/src/ObjCRuntime/RuntimeOptions.cs +++ b/src/ObjCRuntime/RuntimeOptions.cs @@ -150,7 +150,6 @@ namespace ObjCRuntime { } } - [Preserve] // always present but re-written by the linker internal static HttpMessageHandler GetHttpMessageHandler () { var options = RuntimeOptions.Read (); diff --git a/tools/linker/MarkNSObjects.cs b/tools/linker/MarkNSObjects.cs index eca84e849f..af4c10942f 100644 --- a/tools/linker/MarkNSObjects.cs +++ b/tools/linker/MarkNSObjects.cs @@ -29,7 +29,6 @@ // using System; -using System.Collections.Generic; using Mono.Cecil; using Mono.Linker; @@ -154,8 +153,7 @@ namespace Xamarin.Linker.Steps { static bool IsProductType (TypeDefinition type) { - var name = type.Module.Assembly.Name.Name; - return name == ProductAssembly || name == "System.Net.Http"; + return type.Module.Assembly.Name.Name == ProductAssembly; } } } From 08acbf3dccfad1d7e751ea747f5a16d06608ae47 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 15 Oct 2019 23:50:59 +0200 Subject: [PATCH 02/55] Fix version numbers in FrameworkList.xml files (#7162) The existing test only checked that an assembly was mentioned in the file, but not that its version etc matches. Updated the test and fixed the differences. --- .../Xamarin.Mac-Full-FrameworkList.xml.in | 2 +- .../Xamarin.Mac-Mobile-FrameworkList.xml.in | 4 ++-- .../Xamarin.TVOS-FrameworkList.xml.in | 2 +- .../Xamarin.WatchOS-FrameworkList.xml.in | 2 +- .../Xamarin.iOS-FrameworkList.xml.in | 2 +- .../tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs | 10 ++++++++++ 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in index 17b1b2189a..a97f464247 100644 --- a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in +++ b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Full-FrameworkList.xml.in @@ -187,5 +187,5 @@ - + \ No newline at end of file diff --git a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in index a874bd7167..47ddc8075a 100644 --- a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in +++ b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac-Mobile-FrameworkList.xml.in @@ -17,7 +17,7 @@ - + @@ -186,5 +186,5 @@ - + \ No newline at end of file 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 11d2f85801..8d36f0df4c 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.TVOS-FrameworkList.xml.in @@ -187,5 +187,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 9f312e1cbe..70834044bd 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS-FrameworkList.xml.in @@ -183,5 +183,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 aacc7ed8cd..dc6926755d 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS-FrameworkList.xml.in @@ -187,5 +187,5 @@ - + diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs index 3f796f6b6e..c1ff5f2dc1 100644 --- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/FrameworkListTest.cs @@ -35,6 +35,8 @@ namespace Xamarin.iOS.Tasks foreach (var assembly in installedAssemblies) { if (!frameworkListAssemblies.Any (a => a.Name == assembly.Name)) ReportAssemblies (assembly, $"One or more assemblies in the the SDK root folder are not listed in '{frameworkListFile}'. Update the list if an assembly was intentionally added."); + else if (!frameworkListAssemblies.Single (a => a.Name == assembly.Name).Equals (assembly)) + ReportAssemblies (assembly, $"One or more assemblies in the the SDK root folder do not match the entry in '{frameworkListFile}'. Update the list if an assembly was intentionally modified."); } } @@ -158,5 +160,13 @@ namespace Xamarin.iOS.Tasks if (j == -1) j = fn.Length; PublicKeyToken = fn.Substring (i, j - i); } + + public bool Equals (AssemblyInfo other) { + // ignore Culture and InGac for equality since those are not mentioned in the FrameworkList.xml + return other.Name == this.Name && + other.Version == this.Version && + other.PublicKeyToken == this.PublicKeyToken && + other.ProcessorArchitecture == this.ProcessorArchitecture; + } } } From 1d88f13be62e9a4da3ae327f17a6e13b7432ebf9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 16 Oct 2019 08:01:55 +0200 Subject: [PATCH 03/55] Fix a few introspection issues on Catalina. (#7212) * [SceneKit] Adjust deprecation message. Fixes this introspection failure: [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Type: SCNLayer [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_OpenGLContext, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_OpenGLContext, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_PixelFormat, Type: SCNView [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_PixelFormat, Type: SCNView * [tests] Fix introspection and xammac tests on Catalina. (#7200) * [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011. Fixes https://github.com/xamarin/maccore/issues/2011. * [tests] Fix typo test on macOS 10.15. Fixes #7116. Fixes https://github.com/xamarin/xamarin-macios/issues/7116. * [introspection] Ignore MTLCounterSampleBufferDescriptor's selectors. They're implemented using a different/internal type: $ nm /System/Library/Frameworks/Metal.framework/Metal | grep MTLCounterSampleBuffer 00000000000458ab t +[MTLCounterSampleBufferDescriptor allocWithZone:] 0000000000045897 t +[MTLCounterSampleBufferDescriptor alloc] 000000000004591e t -[MTLCounterSampleBufferDescriptor copyWithZone:] 000000000004598e t -[MTLCounterSampleBufferDescriptorInternal copyWithZone:] 0000000000045c0f t -[MTLCounterSampleBufferDescriptorInternal counterSet] 0000000000045936 t -[MTLCounterSampleBufferDescriptorInternal dealloc] 0000000000045b65 t -[MTLCounterSampleBufferDescriptorInternal hash] 0000000000045a31 t -[MTLCounterSampleBufferDescriptorInternal isEqual:] 0000000000045c58 t -[MTLCounterSampleBufferDescriptorInternal label] 0000000000045c7f t -[MTLCounterSampleBufferDescriptorInternal sampleCount] 0000000000045c25 t -[MTLCounterSampleBufferDescriptorInternal setCounterSet:] 0000000000045c6e t -[MTLCounterSampleBufferDescriptorInternal setLabel:] 0000000000045c90 t -[MTLCounterSampleBufferDescriptorInternal setSampleCount:] 0000000000045c47 t -[MTLCounterSampleBufferDescriptorInternal setStorageMode:] 0000000000045c36 t -[MTLCounterSampleBufferDescriptorInternal storageMode] 000000000010b0b8 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptor 000000000010b0e0 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptorInternal 0000000000107070 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._counterSet 0000000000107078 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._label 0000000000107088 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._sampleCount 0000000000107080 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._storageMode 000000000010b108 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptor 000000000010b130 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptorInternal Fixes these test failures: 1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods) 8 errors found in 26658 instance selector validated: Selector not found for Metal.MTLCounterSampleBufferDescriptor : counterSet Selector not found for Metal.MTLCounterSampleBufferDescriptor : setCounterSet: Selector not found for Metal.MTLCounterSampleBufferDescriptor : label Selector not found for Metal.MTLCounterSampleBufferDescriptor : setLabel: Selector not found for Metal.MTLCounterSampleBufferDescriptor : sampleCount Selector not found for Metal.MTLCounterSampleBufferDescriptor : setSampleCount: Selector not found for Metal.MTLCounterSampleBufferDescriptor : storageMode Selector not found for Metal.MTLCounterSampleBufferDescriptor : setStorageMode: * [introspection] Ignore some API we've bound incorrectly. Fixes #7116. There are also a few API fixes, those will be submitted in a different PR. Fixes https://github.com/xamarin/xamarin-macios/issues/7116. --- src/AppKit/Enums.cs | 4 ++++ src/scenekit.cs | 10 +++++----- tests/introspection/ApiProtocolTest.cs | 6 ++++++ tests/introspection/ApiTypoTest.cs | 4 ++++ tests/introspection/Mac/MacApiSelectorTest.cs | 8 ++++++++ .../NaturalLanguage/EmbeddingTest.cs | 17 ++++++++++++----- 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/AppKit/Enums.cs b/src/AppKit/Enums.cs index b82778ba90..16013bf99e 100644 --- a/src/AppKit/Enums.cs +++ b/src/AppKit/Enums.cs @@ -2198,7 +2198,11 @@ namespace AppKit { GenericPreferencesIcon = 0x70726566, //'pref' GenericQueryDocumentIcon = 0x71657279, //'qery' GenericRamDiskIcon = 0x72616D64, //'ramd' +#if !XAMCORE_4_0 + [Obsolete ("Use 'GenericSharedLibraryIcon' instead.")] GenericSharedLibaryIcon = 0x73686C62, //'shlb' +#endif + GenericSharedLibraryIcon = 0x73686C62, //'shlb' GenericStationeryIcon = 0x73646F63, //'sdoc' GenericSuitcaseIcon = 0x73756974, //'suit' GenericUrlIcon = 0x6775726C, //'gurl' diff --git a/src/scenekit.cs b/src/scenekit.cs index 5378eb9ded..b9c4d4538b 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -1213,7 +1213,7 @@ namespace SceneKit { #if MONOMAC [iOS (8,0)] - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")] [BaseType (typeof (CAOpenGLLayer))] interface SCNLayer : SCNSceneRenderer, SCNTechniqueSupport { @@ -3507,16 +3507,16 @@ namespace SceneKit { bool AllowsCameraControl { get; set; } #if MONOMAC - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("openGLContext", ArgumentSemantic.Retain)] NSOpenGLContext OpenGLContext { get; set; } - [Deprecated (PlatformName.MacOSX, 10, 14, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("pixelFormat", ArgumentSemantic.Retain)] NSOpenGLPixelFormat PixelFormat { get; set; } #elif !WATCH - [Deprecated (PlatformName.iOS, 12, 0, message: "OpenGL API deprecated, please use Metal instead.")] - [Deprecated (PlatformName.TvOS, 12, 0, message: "OpenGL API deprecated, please use Metal instead.")] + [Deprecated (PlatformName.iOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] + [Deprecated (PlatformName.TvOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] [Export ("eaglContext", ArgumentSemantic.Retain)] #if XAMCORE_2_0 EAGLContext EAGLContext { get; set; } diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 19ccc112d5..c0a4217b14 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -299,6 +299,12 @@ namespace Introspection { break; } break; +#if !XAMCORE_4_0 + case "MTLCounter": + case "MTLCounterSampleBuffer": + case "MTLCounterSet": + return true; // Incorrectly bound, will be fixed for XAMCORE_4_0. +#endif } return false; } diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index aad09889cd..16cb357aab 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -145,6 +145,7 @@ namespace Introspection "Cartes", // french "Cavlc", "Cda", // acronym: Clinical Document Architecture + "Cdrom", "Cfa", // acronym: Color Filter Array "Celp", // MPEG4ObjectID "Characterteristic", @@ -386,6 +387,7 @@ namespace Introspection "nint", "Nntps", "Ntlm", + "Nsl", // InternetLocationNslNeighborhoodIcon "Ntsc", "nuint", "Ndef", @@ -436,6 +438,7 @@ namespace Introspection "Prerolls", "Preseti", "Prev", + "Privs", // SharingPrivsNotApplicableIcon "Propogate", "Psec", "Psm", // Protocol/Service Multiplexer @@ -864,6 +867,7 @@ namespace Introspection "Attributest", "Failwith", "Imageimage", + "Libary", "Musthold", "Olus", // Typo, should be 'Bolus', fixed in 'HKInsulinDeliveryReason' "Ostprandial", // Typo, should be 'Postprandial', fixed in 'HKBloodGlucoseMealTime' diff --git a/tests/introspection/Mac/MacApiSelectorTest.cs b/tests/introspection/Mac/MacApiSelectorTest.cs index 9a6663d692..76601a62f3 100644 --- a/tests/introspection/Mac/MacApiSelectorTest.cs +++ b/tests/introspection/Mac/MacApiSelectorTest.cs @@ -694,6 +694,14 @@ namespace Introspection { break; } break; + case "Metal": + switch (type.Name) { + case "MTLCounterSampleBufferDescriptor": + // This whole type is implemented using a different (internal) type, + // and it's the internal type who knows how to respond to the selectors. + return true; + } + break; } return base.Skip (type, selectorName); } diff --git a/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs b/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs index b24eb902da..465e10a82f 100644 --- a/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs +++ b/tests/monotouch-test/NaturalLanguage/EmbeddingTest.cs @@ -22,11 +22,18 @@ namespace MonoTouchFixtures.NaturalLanguage { { TestRuntime.AssertXcodeVersion (11, 0); - using (var e = NLEmbedding.GetWordEmbedding (NLLanguage.English)) { - Assert.NotNull (e, "GetWordEmbedding"); - Assert.Null (e.GetVector ("Xamarin"), "GetVector"); - Assert.False (e.TryGetVector ("Xamarin", out var vector), "TryGetVector"); - Assert.Null (vector, "vector"); + foreach (NLLanguage v in Enum.GetValues (typeof (NLLanguage))) { + if (v == NLLanguage.Unevaluated) + continue; // this is not a value provided by Apple. + + NLEmbedding e = null; + Assert.DoesNotThrow (() => e = NLEmbedding.GetWordEmbedding (v), $"Throws: {v}"); + if (e != null) { + Assert.NotNull (e, "GetWordEmbedding"); + Assert.Null (e.GetVector ("Xamarin"), "GetVector"); + Assert.False (e.TryGetVector ("Xamarin", out var vector), "TryGetVector"); + Assert.Null (vector, "vector"); + } } } #endif From 9bd50b7990d122e9767972052502c361667c50e0 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Fri, 11 Oct 2019 14:04:18 -0400 Subject: [PATCH 04/55] [d16-4] Bump mono 2019-08@3eb5f34f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New commits in mono/mono: * mono/mono@3eb5f34f541 [GTK] Bump bockbuild for GtkViewport autoscrolling patch. (#17321) * mono/mono@b601371d5f0 Update MERP event type to MonoAppCrash * mono/mono@6184ff007b2 [2019-08][ci] Use Xcode11.1 and 11.2beta2 for XI/XM Mono SDK builds (#17324) * mono/mono@8969f2cc99b [2019-08] [merp] Include any managed methods in the 'unmanaged_frames' portion … (#17316) * mono/mono@30094401081 [2019-08][merp] Don't install SIGTERM handler in EnableMicrosoftTelemetry (#17308) * mono/mono@df5e13f95df [tests] Bump corefx to get Azure testhost change (#17275) * mono/mono@11e1499c227 [2019-08] [merp] Print missing status marker file for stage 1 (setup) (#17220) * mono/mono@7dbad3c3618 [arm] Fix fetching of method addresses (#17253) * mono/mono@9a88a36789e [sgen] Fix invalid value passed to write barrier (#17247) * mono/mono@0f241c975ce [2019-08] Add drawing type converters to mobile profiles (#17240) * mono/mono@7ebe1a1763c Update Roslyn to 3.4.0-beta2-19477-01 * mono/mono@b759449ba8d Bump msbuild to track mono-2019-08 * mono/mono@617f399efca [IO] Remove read-only logic in mono_w32_get_disk_free_space (#17211) * mono/mono@77258ea1122 [2019-08] [debugger][exception] Debugger breaks on handled exceptions (#17202) * mono/mono@f83c321f88f Bump msbuild to track mono-2019-08 (#17193) * mono/mono@1ecd094b44c [2019-08] [Mono.Debugger.Soft] Fix VirtualMachine detaching (#17077) * mono/mono@54a33be9dee [merp] Put thread into async context before running summarizer (#17197) * mono/mono@72128bb00d3 Bump libgdiplus to 6.0.4 * mono/mono@65a972c0333 Always do copy_stack_data on entering GC safe/unsafe mode. (#17184) * mono/mono@9e6def1553b [merp] exit_status is 0 if we ran the uploader successfully (#17187) * mono/mono@8a707cc0124 [2019-08] [reflection] Only duplicate MonoMarshalSpec strings for custom types (#17189) * mono/mono@bd72952cf82 [2019-08] [merp] Don't overrun buffer in copy_summary_string_safe … (#17178) * mono/mono@b6efc0cc906 Bump msbuild to track xplat-master (#17132) * mono/mono@2869cd5f67e Bump ikvm to get https://github.com/mono/ikvm-fork/pull/13 (#17170) * mono/mono@a64a25695d6 [2019-08] [merp] Use macOS version not Darwin version in MERP reports (#17147) * mono/mono@57f068438d4 [2019-08] [merp] Add API method that whitelists all native libraries (#17128) Diff: https://github.com/mono/mono/compare/528103728fc2aedb7b6062e11255d39a0ed3f31c..3eb5f34f5412edfcb6932050b6c5c66fe1db2830 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 8a90e82594..a4919fdb52 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 528103728fc2aedb7b6062e11255d39a0ed3f31c +NEEDED_MONO_VERSION := 3eb5f34f5412edfcb6932050b6c5c66fe1db2830 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 307dc86f6ffe1205a0ca3bdd96001f827a2ec7da Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 16 Oct 2019 19:02:27 -0400 Subject: [PATCH 05/55] [tests] Ignore mscorlib test that runs out of memory See mono issue: https://github.com/mono/mono/issues/17375 ``` [PASS] System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetMethodInfo Test name: System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeMethod Exception messages: System.OutOfMemoryException : Out of memory Handler for event TestFailedEvent failed with exception System.Reflection.Tests.RuntimeReflectionExtensionsTests 0 ms ``` --- .../common-monotouch_corlib_xunit-test.dll.ignore | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore b/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore index b9ef3636ed..819559b22c 100644 --- a/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore +++ b/tests/bcl-test/common-monotouch_corlib_xunit-test.dll.ignore @@ -414,4 +414,10 @@ System.SpanTests.ReadOnlySpanTests.BinarySearch_Double System.Reflection.Tests.MethodBaseTests.Test_GetCurrentMethod_Inlineable # device issues, it was reported here: https://github.com/mono/mono/issues/14761 -System.Text.Tests.StringBuilderTests.Append_CharPointer_Null_ThrowsNullReferenceException \ No newline at end of file +System.Text.Tests.StringBuilderTests.Append_CharPointer_Null_ThrowsNullReferenceException + +# device failures, reported at: https://github.com/mono/mono/issues/17375 +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeMethod +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeField +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeEvent +Platform32:System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeProperty \ No newline at end of file From 39c56d853b0a41a1ea9a998a3c76e9d2d649379f Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 17 Oct 2019 17:25:37 +0200 Subject: [PATCH 06/55] Bump system mono to get fix for mono/mono#17151. (#7246) mono/mono#17151 prevents xharness from running tests on Catalina, because xharness thinks the root drive has no more space. --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index cb3a38cf27..b54732c463 100644 --- a/Make.config +++ b/Make.config @@ -69,9 +69,9 @@ include $(TOP)/mk/mono.mk MONO_HASH := $(NEEDED_MONO_VERSION) # Minimum Mono version for building XI/XM -MIN_MONO_VERSION=6.6.0.48 +MIN_MONO_VERSION=6.6.0.117 MAX_MONO_VERSION=6.6.99 -MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-08/51/23cc371009da14640980f98ad7b8b83818568f73/MonoFramework-MDK-6.6.0.48.macos10.xamarin.universal.pkg +MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2019-08/117/617f399efca133f357cb8207bc7f58b1120f12f1/MonoFramework-MDK-6.6.0.117.macos10.xamarin.universal.pkg # Minimum Mono version for Xamarin.Mac apps using the system mono MIN_XM_MONO_VERSION=6.4.0.94 From ab60a11f14be170734810aa62ea1e6b65d5172e9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Oct 2019 17:44:37 +0200 Subject: [PATCH 07/55] [mmp] Add deployment target to the -fobjc-runtime clang argument. Fixes #7204. (#7227) (#7231) This is required when also passing the -fobjc-arc argument. Fixes https://github.com/xamarin/xamarin-macios/issues/7204. This is a backport of #7227. --- tests/mmptest/src/MMPTest.cs | 13 +++++++++++++ tools/mmp/driver.cs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/mmptest/src/MMPTest.cs b/tests/mmptest/src/MMPTest.cs index 537c1afef4..7ee30c153f 100644 --- a/tests/mmptest/src/MMPTest.cs +++ b/tests/mmptest/src/MMPTest.cs @@ -737,5 +737,18 @@ namespace Xamarin.MMP.Tests // TODO: Add something to validate the archive is loadable by Xcode } + + [Test] + public void BuildWithObjcArcFlag () + { + RunMMPTest (tmpDir => { + TI.UnifiedTestConfig test = new TI.UnifiedTestConfig (tmpDir) { + CSProjConfig = "-link_flags=-fobjc-arc" + }; + TI.TestUnifiedExecutable (test); + var output = TI.BuildProject (Path.Combine (tmpDir, "UnifiedExample.csproj")); + }); + + } } } diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index fb0661e129..3a1023128e 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -1179,7 +1179,7 @@ namespace Xamarin.Bundler { args.Append ("-mmacosx-version-min=").Append (App.DeploymentTarget.ToString ()).Append (' '); args.Append ("-arch ").Append (arch).Append (' '); if (arch == "x86_64") - args.Append ("-fobjc-runtime=macosx "); + args.Append ($"-fobjc-runtime=macosx-{App.DeploymentTarget.ToString ()} "); if (!embed_mono) args.Append ("-DDYNAMIC_MONO_RUNTIME "); From ca7eab8f1cb04333ab4d4349b9efd5c2d127ed51 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Oct 2019 17:46:02 +0200 Subject: [PATCH 08/55] [Metal] Fix a few issues with the latest Metal API additions. Fixes #7116. (#7213) We weren't using protocol types when we should, and we were using [BaseType] when we shouldn't. --- src/Metal/MTLCompat.cs | 44 +++++++++++++++++++++++++++++++++++++++++- src/metal.cs | 21 ++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/Metal/MTLCompat.cs b/src/Metal/MTLCompat.cs index 5295b58341..559956386c 100644 --- a/src/Metal/MTLCompat.cs +++ b/src/Metal/MTLCompat.cs @@ -1,4 +1,7 @@ +#if !XAMCORE_4_0 using System; + +using Foundation; using ObjCRuntime; namespace Metal { @@ -9,4 +12,43 @@ namespace Metal { public MTLSharedTextureHandle () {} } -} \ No newline at end of file +#if MONOMAC + public static partial class MTLDevice_Extensions { + [BindingImpl (BindingImplOptions.Optimizable)] + public static IMTLCounterSet[] GetIMTLCounterSets (this IMTLDevice This) + { + return NSArray.ArrayFromHandle(global::ObjCRuntime.Messaging.IntPtr_objc_msgSend (This.Handle, Selector.GetHandle ("counterSets"))); + } + + [Unavailable (PlatformName.iOS, PlatformArchitecture.All)] + [Unavailable (PlatformName.TvOS, PlatformArchitecture.All)] + [Introduced (PlatformName.MacOSX, 10,15, PlatformArchitecture.All)] + [BindingImpl (BindingImplOptions.Optimizable)] + public static IMTLCounterSampleBuffer CreateIMTLCounterSampleBuffer (this IMTLDevice This, MTLCounterSampleBufferDescriptor descriptor, out NSError error) + { + if (descriptor == null) + throw new ArgumentNullException ("descriptor"); + IntPtr errorValue = IntPtr.Zero; + + var ret = Runtime.GetINativeObject (global::ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_ref_IntPtr (This.Handle, Selector.GetHandle ("newCounterSampleBufferWithDescriptor:error:"), descriptor.Handle, ref errorValue), owns: false); + error = Runtime.GetNSObject (errorValue); + + return ret; + } + } + + public static partial class MTLComputeCommandEncoder_Extensions { + [Unavailable (PlatformName.iOS, PlatformArchitecture.All)] + [Unavailable (PlatformName.TvOS, PlatformArchitecture.All)] + [Introduced (PlatformName.MacOSX, 10,15, PlatformArchitecture.All)] + [BindingImpl (BindingImplOptions.Optimizable)] + public static void SampleCounters (this IMTLComputeCommandEncoder This, IMTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier) + { + if (sampleBuffer == null) + throw new ArgumentNullException ("sampleBuffer"); + global::ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_nuint_bool (This.Handle, Selector.GetHandle ("sampleCountersInBuffer:atSampleIndex:withBarrier:"), sampleBuffer.Handle, sampleIndex, barrier); + } + } +#endif // MONOMAC +} +#endif // !XAMCORE_4_0 diff --git a/src/metal.cs b/src/metal.cs index 30dc375548..1b65db798a 100644 --- a/src/metal.cs +++ b/src/metal.cs @@ -597,7 +597,12 @@ namespace Metal { #endif [NoiOS, NoTV, Mac (10,15)] [Export ("sampleCountersInBuffer:atSampleIndex:withBarrier:")] +#if XAMCORE_4_0 + void SampleCounters (IMTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); +#else + [Obsolete ("Use the overload that takes an IMTLCounterSampleBuffer instead.")] void SampleCounters (MTLCounterSampleBuffer sampleBuffer, nuint sampleIndex, bool barrier); +#endif } [iOS (8,0)][Mac (10,11)] @@ -1363,7 +1368,12 @@ namespace Metal { #endif [NoiOS, NoTV, Mac (10, 15)] [NullAllowed, Export ("counterSets")] +#if XAMCORE_4_0 + IMTLCounterSet[] CounterSets { get; } +#else + [Obsolete ("Use 'GetIMTLCounterSets' instead.")] MTLCounterSet[] CounterSets { get; } +#endif #if XAMCORE_4_0 [Abstract] @@ -1371,7 +1381,12 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Export ("newCounterSampleBufferWithDescriptor:error:")] [return: NullAllowed] +#if XAMCORE_4_0 + IMTLCounterSampleBuffer CreateCounterSampleBuffer (MTLCounterSampleBufferDescriptor descriptor, [NullAllowed] out NSError error); +#else + [Obsolete ("Use 'CreateIMTLCounterSampleBuffer' instead.")] MTLCounterSampleBuffer CreateCounterSampleBuffer (MTLCounterSampleBufferDescriptor descriptor, [NullAllowed] out NSError error); +#endif #if XAMCORE_4_0 [Abstract] @@ -4148,7 +4163,9 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Protocol] +#if !XAMCORE_4_0 [BaseType (typeof(NSObject))] +#endif interface MTLCounter { [Abstract] [Export ("name")] @@ -4159,7 +4176,9 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Protocol] +#if !XAMCORE_4_0 [BaseType (typeof(NSObject))] +#endif interface MTLCounterSet { [Abstract] [Export ("name")] @@ -4174,7 +4193,9 @@ namespace Metal { [NoiOS, NoTV, Mac (10,15)] [Protocol] +#if !XAMCORE_4_0 [BaseType (typeof(NSObject))] +#endif interface MTLCounterSampleBuffer { [Abstract] [Export ("device")] From e452a36cfe3a9c53ce05503c9170f8d979129040 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 18 Oct 2019 04:18:18 +0200 Subject: [PATCH 09/55] Update APIDIFF_REFERENCES to track current stable (13.4/6.4) (#7254) --- Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.config b/Make.config index b54732c463..1295bc1464 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/d16-3/d532e90de664caf46baea6226d742b9f68b3173a/44/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) From 900437e861cd44c6a2c921c0d7a336f6c3fe337b Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 21 Oct 2019 09:24:35 -0400 Subject: [PATCH 10/55] [d16-4] Bump mono 2019-08@01dbbb74 (#7251) New commits in mono/mono: * mono/mono@01dbbb746f4 [2019-08] Enable GSS on Linux (#17410) * mono/mono@51a3dc37dab Fix SafeHandle marshalling in ref/in/out parameters (#17330) Diff: https://github.com/mono/mono/compare/3eb5f34f5412edfcb6932050b6c5c66fe1db2830..01dbbb746f4174130ef1226e4a9683f2f9a70f9d --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index a4919fdb52..1a34044820 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 3eb5f34f5412edfcb6932050b6c5c66fe1db2830 +NEEDED_MONO_VERSION := 01dbbb746f4174130ef1226e4a9683f2f9a70f9d NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 5aade5e00af51219a6729d513717e452dc2b005f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 21 Oct 2019 22:00:31 +0200 Subject: [PATCH 11/55] Bump prebuilt-apps, ios-samples and xamarin-form-samples for SampleTester. (#7265) --- tests/sampletester/Samples.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sampletester/Samples.cs b/tests/sampletester/Samples.cs index e28006c45d..6ec6781726 100644 --- a/tests/sampletester/Samples.cs +++ b/tests/sampletester/Samples.cs @@ -8,7 +8,7 @@ namespace Samples { const string ORG = "xamarin"; const string REPO = "ios-samples"; // monotouch-samples redirects to ios-samples const string CATEGORY = "iossamples"; // categories can't contain dashes - const string HASH = "1d0f3270c394e9c15c014813e804972b17ce3e48"; + const string HASH = "bffa511ecb8f74b2d4a42418a130d0c83c9723cf"; static Dictionary test_data = new Dictionary { // Build solution instead of csproj @@ -124,7 +124,7 @@ namespace Samples { const string ORG = "xamarin"; const string REPO = "prebuilt-apps"; const string CATEGORY = "prebuiltapps"; // categories can't contain dashes - const string HASH = "40da1283722df96e81efb5c62364d05e5bd3dd76"; + const string HASH = "f111672bc6915ceb402abb47dedfe3480e111720"; static Dictionary test_data = new Dictionary { // Known failures @@ -142,7 +142,7 @@ namespace Samples { const string ORG = "xamarin"; const string REPO = "xamarin-forms-samples"; const string CATEGORY = "xamarinformssamples"; // categories can't contain dashes - const string HASH = "206f4c3a2be1e988eda2ad9130a37019c60f1c7e"; + const string HASH = "d196d3f7ba418d06ef799074eb4f6120e26a9cf4"; static Dictionary test_data = new Dictionary { // Build solution instead of csproj. From 9b13690a2d96fd485f05fa896a346cd68a5745fc Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 22 Oct 2019 07:13:14 +0200 Subject: [PATCH 12/55] [d16-4] [tests] Fix tests on Catalina. (#7262) * [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031. The 32-bit slice is causing a build failure on the bots: Task "Exec" (TaskId:35) Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35) Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35) make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35) ^ (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35) @interface NSAnimationContext : NSObject (TaskId:35) ^ (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35) ^ (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @interface NSItemProvider (NSCloudKitSharing) (TaskId:35) ^ (TaskId:35) In file included from ../common/mac/SimpleClass.m:1: (TaskId:35) In file included from ../common/mac/SimpleClass.h:1: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35) In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35) /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj] @interface NSItemProvider (NSItemSourceInfo) (TaskId:35) ^ (TaskId:35) 4 errors generated. (TaskId:35) make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35) and since we don't need the 32-bit slice anymore, just remove it. Fixes https://github.com/xamarin/maccore/issues/2031. * [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032. Fixes this xammac test failure when the csproj has paths in its path: 1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption) System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false. at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in :0 at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in :0 at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <9c0bd541400747ef85267f70e32bd8e4>:0 Fixes https://github.com/xamarin/maccore/issues/2032. * [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030. The simulator crashes when the app tests if MPS is supported... Fixes https://github.com/xamarin/maccore/issues/2030. * [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030. The simulator crashes when the app tests if MPS is supported... Fixes https://github.com/xamarin/maccore/issues/2030. * Fix whitespace. --- tests/mac-binding-project/Makefile | 8 ++++---- .../MediaAccessibility/ImageCaptioningTest.cs | 5 ++++- .../MetalPerformanceShaders/ImageScaleTest.cs | 6 ++++++ .../monotouch-test/MetalPerformanceShaders/KernelTest.cs | 4 ++++ .../MPSImageHistogramEqualizationTest.cs | 4 ++++ .../MPSImageHistogramSpecificationTest.cs | 4 ++++ .../MetalPerformanceShaders/MPSImageHistogramTest.cs | 4 ++++ 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/tests/mac-binding-project/Makefile b/tests/mac-binding-project/Makefile index fdc78fab49..1deb35a75f 100644 --- a/tests/mac-binding-project/Makefile +++ b/tests/mac-binding-project/Makefile @@ -14,17 +14,17 @@ bin: $(Q) mkdir -p bin bin/SimpleClassDylib.dylib: bin - $(Q) xcrun clang -shared ../common/mac/SimpleClass.m -o bin/SimpleClassDylib.dylib -std=gnu99 -mmacosx-version-min=10.9 -framework Cocoa -lSystem + $(Q) xcrun clang -shared ../common/mac/SimpleClass.m -o bin/SimpleClassDylib.dylib -std=gnu99 -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -framework Cocoa -lSystem bin/SimpleClass\ Dylib.dylib: bin/SimpleClassDylib.dylib $(Q) cp bin/SimpleClassDylib.dylib bin/SimpleClass\ Dylib.dylib bin/SimpleClass.%.a: ../common/mac/SimpleClass.m bin - $(Q) clang -c $< -o bin/SimpleClass.$*.o -std=gnu99 -mmacosx-version-min=10.9 -arch $* + $(Q) clang -c $< -o bin/SimpleClass.$*.o -std=gnu99 -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -arch $* $(Q) xcrun ar -rcs $@ bin/SimpleClass.$*.o -bin/SimpleClassStatic.a: bin bin/SimpleClass.i386.a bin/SimpleClass.x86_64.a - $(Q) lipo -create bin/SimpleClass.i386.a bin/SimpleClass.x86_64.a -output $@ +bin/SimpleClassStatic.a: bin/SimpleClass.x86_64.a | bin + $(Q) $(CP) $< $@ bin/Mobile-dynamic/MobileBinding.dll: bin/SimpleClassDylib.dylib $(Q) $(SYSTEM_XIBUILD) -- $(XBUILD_VERBOSITY) MobileBinding/MobileBinding_dynamic.csproj diff --git a/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs b/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs index f6831c7dc9..61f9ddac84 100644 --- a/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs +++ b/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs @@ -34,12 +34,15 @@ namespace MonoTouchFixtures.MediaAccessibility { Assert.Null (e, "remote / no error"); // weird should be an "image on disk" } string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png"); + file = file.Replace (" ", "%20"); using (NSUrl url = new NSUrl (file)) { var s = MAImageCaptioning.GetCaption (url, out var e); Assert.Null (s, "local / return value"); Assert.NotNull (e, "local / error"); // does not like the URL (invalid) } - using (NSUrl url = new NSUrl (NSBundle.MainBundle.ResourceUrl.AbsoluteString + "basn3p08.png")) { + file = NSBundle.MainBundle.ResourceUrl.AbsoluteString + "basn3p08.png"; + file = file.Replace (" ", "%20"); + using (NSUrl url = new NSUrl (file)) { var s = MAImageCaptioning.GetCaption (url, out var e); Assert.Null (s, "local / return value"); Assert.Null (e, "local / no error"); diff --git a/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs b/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs index c4fad8a579..6d2633470e 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/ImageScaleTest.cs @@ -2,6 +2,7 @@ using System; using Foundation; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -25,6 +26,11 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { { TestRuntime.AssertXcodeVersion (9,0); +#if !MONOMAC + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); +#endif + device = MTLDevice.SystemDefault; // some older hardware won't have a default if (device == null || !MPSKernel.Supports (device)) diff --git a/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs b/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs index 448b2717e6..ea3b9bf343 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/KernelTest.cs @@ -4,6 +4,7 @@ using System; using Foundation; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs index b963d5cbe6..4140664bfa 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramEqualizationTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs index be9ac2f88d..2b34be9f33 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramSpecificationTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs index 4f0f6482d9..5178d2448d 100644 --- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs +++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageHistogramTest.cs @@ -3,6 +3,7 @@ #if !__WATCHOS__ using System; +using ObjCRuntime; #if XAMCORE_2_0 using Metal; @@ -27,6 +28,9 @@ namespace MonoTouchFixtures.MetalPerformanceShaders { #if !MONOMAC TestRuntime.AssertXcodeVersion (7, 0); + + if (Runtime.Arch == Arch.SIMULATOR && Environment.OSVersion.Version.Major >= 15) + Assert.Inconclusive ("Metal is not supported in the simulator on macOS 10.15"); #else TestRuntime.AssertXcodeVersion (9, 0); #endif From 4b3a6a79fae5f48cffaf067eab6bc6f173ca6673 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 22 Oct 2019 04:59:47 -0400 Subject: [PATCH 13/55] [d16-4] Bump mono 2019-08@ef75d4be (#7269) New commits in mono/mono: * mono/mono@ef75d4bef75 [2019-08] BeginConnect complete to early when not using callback. (#17416) Diff: https://github.com/mono/mono/compare/01dbbb746f4174130ef1226e4a9683f2f9a70f9d..ef75d4bef7509b23103fffa2acca039e9acbb157 --- mk/mono.mk | 2 +- tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 1a34044820..0f309d365c 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 01dbbb746f4174130ef1226e4a9683f2f9a70f9d +NEEDED_MONO_VERSION := ef75d4bef7509b23103fffa2acca039e9acbb157 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono diff --git a/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore b/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore index a3ca266927..9a563ec502 100644 --- a/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore +++ b/tests/bcl-test/iOS-monotouch_corlib_xunit-test.dll.ignore @@ -54,3 +54,8 @@ Platform32:Test.TaskContinueWhenAnyTests.RunContinueWhenAnyTests # Test running out of memory Platform32:System.Collections.Tests.BitArray_OperatorsTests.Xor_Operator(l: [False, True, False, True, False, ...], r: [True, True, True, True, True, ...], expected: [True, False, True, False, True, ...]) +# out of memory, filled in mono as https://github.com/mono/mono/issues/17480 +Platform32:System.Memory.Tests.ReadOnlySequenceTestsCommonChar.HelloWorldAcrossTwoBlocks + +# fails on 32b for an unknown reason, passed on 64 +Platform32:System.Collections.Concurrent.Tests.ConcurrentDictionary_NonGeneric_Tests.ICollection_NonGeneric_CopyTo_TwoDimensionArray_ThrowsException(count: 75) From 84ee21569f76d86b59bf63178cc6851f4169e6f7 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 28 Oct 2019 10:38:53 -0400 Subject: [PATCH 14/55] [d16-4] Bump mono 2019-08@8946e49a (#7311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New commits in mono/mono: * mono/mono@8946e49a974 Added SR.missing from original backport * mono/mono@5c784c9747b Bump to mono/corefx@fb41040 * mono/mono@fdb704901e4 Revert "[2019-08] rollback msbuild/roslyn updates for a preview" (#17543) * mono/mono@92a177923cb [2019-08] [debugger] Changing how debugger handles exception w… (#17524) * mono/mono@1b2e536b223 [2019-08] rollback msbuild/roslyn updates for a preview * mono/mono@ec4ef9bc344 Bump roslyn-binaries to get roslyn 3.4.0-beta3-19521-01 * mono/mono@cc8deca901c Bump msbuild to pick up sdks+roslyn updates * mono/mono@335f0109c52 Bump msbuild to track mono-2019-08 * mono/mono@90d6e496e47 Fix checks so stack overflows work again. * mono/mono@4b60e7f930f [jit] Avoid running mono_handle_native_crash () on the altstack, it can't produce a backtrace. AMD64 only for now. * mono/mono@989333d6aec Bump Bockbuild to pick-up gtk# binding change (#17486) * mono/mono@baa12e5d240 [profiler] Fix coverage profiler on macos (#17422) Diff: https://github.com/mono/mono/compare/ef75d4bef7509b23103fffa2acca039e9acbb157..8946e49a974ea8b75fe5b8b7e93ffd4571521a85 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 0f309d365c..0419183c42 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := ef75d4bef7509b23103fffa2acca039e9acbb157 +NEEDED_MONO_VERSION := 8946e49a974ea8b75fe5b8b7e93ffd4571521a85 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 898ea3cdbf8d0ca1fe8c5e8272bd6dec901c5f3e Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 4 Nov 2019 02:38:19 -0500 Subject: [PATCH 15/55] [d16-4] Bump mono 2019-08@e1ef7743 (#7356) New commits in mono/mono: * mono/mono@e1ef774391d [2019-08] Bump CoreFX to pickup corefx PR #367 to fix #17133. (#17622) * mono/mono@6d1f88e0ad2 Bump msbuild to get SDK updates from https://github.com/mono/msbuild/pull/150 * mono/mono@a3f3bfc4c3d Bump nuget to the latest suggested version * mono/mono@9bd3079f1ca [2019-08] bump msbuild with more p2 packages * mono/mono@6ac1ff75a27 [dim][regression] Explicit interface override (#17583) (#17627) * mono/mono@a119807a015 [acceptance-tests] Bump mono/roslyn to get build fix * mono/mono@d234d34b700 [2019-08][merp] Install sigterm handler in EnableMicrosoftTelemetry * mono/mono@444a9a3fc48 [2019-08] [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping (#17568) Diff: https://github.com/mono/mono/compare/8946e49a974ea8b75fe5b8b7e93ffd4571521a85..e1ef774391da2b84d003431e8871b0bacbd25cb3 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 0419183c42..7fb9d24857 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 8946e49a974ea8b75fe5b8b7e93ffd4571521a85 +NEEDED_MONO_VERSION := e1ef774391da2b84d003431e8871b0bacbd25cb3 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From ef1ccbd3f02af46cfe90288182a72e00b554f391 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 5 Nov 2019 11:07:50 -0500 Subject: [PATCH 16/55] Update xcode11.3 version to 13.9/6.9 (#7362) (.9) was previously used by master builds but this was not released to the public so we should be fine. xcode11.3 will eventually become (.10) --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index 64a3fd2b88..e3e852e1e2 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.8.2.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.8.2.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.9.0.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.9.0.$(MAC_COMMIT_DISTANCE) From 746fd47638446aa9772345051910333e74e0fc3e Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 5 Nov 2019 15:32:17 -0500 Subject: [PATCH 17/55] [Networking] Add the NWFramer implementation. (#7338) Uncommented the sources and update some mistakes after following the sample provided by Apple. Initially tests were going to be added but they resulted to be to flacky and would make the CI red too often to be adding value. Porting the sample will ensure that it works are the bindings are not broken. --- src/Network/NWFramer.cs | 76 +++++++++---------------- tests/xtro-sharpie/iOS-Network.todo | 25 +------- tests/xtro-sharpie/macOS-Network.todo | 23 -------- tests/xtro-sharpie/tvOS-Network.todo | 25 +------- tests/xtro-sharpie/watchOS-Network.todo | 23 -------- 5 files changed, 28 insertions(+), 144 deletions(-) diff --git a/src/Network/NWFramer.cs b/src/Network/NWFramer.cs index 9dbf4acef4..fecf6c8504 100644 --- a/src/Network/NWFramer.cs +++ b/src/Network/NWFramer.cs @@ -38,14 +38,17 @@ namespace Network { WillMarkReady = 2, } + public delegate nuint NWFramerParseCompletionDelegate (Memory buffer, bool isCompleted); + public delegate nuint NWFramerInputDelegate (NWFramer framer); + [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] public class NWFramer : NativeObject { internal NWFramer (IntPtr handle, bool owns) : base (handle, owns) {} -/* + [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_write_output_no_copy (OS_nw_framer framer, nuint output_length); - public bool WriteOutput (nuint outputLength) => nw_framer_write_output_no_copy (GetCheckedHandle (), outputLength); + public bool WriteOutputNoCopy (nuint outputLength) => nw_framer_write_output_no_copy (GetCheckedHandle (), outputLength); [DllImport (Constants.NetworkLibrary)] static extern void nw_framer_write_output_data (OS_nw_framer framer, OS_dispatch_data output_data); @@ -152,13 +155,13 @@ namespace Network { var del = BlockLiteral.GetTarget> (block); if (del != null) { var nwFramer = new NWFramer (framer, owns: true); - var nwProtocolMetadata = new NWProtocolMetadata (message, owns: true); + var nwProtocolMetadata = new NWFramerMessage (message, owns: true); del (nwFramer, nwProtocolMetadata, message_length, is_complete); } } [BindingImpl (BindingImplOptions.Optimizable)] - public Action OutputHandler { + public Action OutputHandler { set { unsafe { if (value == null) { @@ -180,21 +183,22 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_framer_set_input_handler (OS_nw_framer framer, void *input_handler); - delegate void nw_framer_set_input_handler_t (IntPtr block, OS_nw_framer framer); + delegate nuint nw_framer_set_input_handler_t (IntPtr block, OS_nw_framer framer); static nw_framer_set_input_handler_t static_InputHandler = TrampolineInputHandler; [MonoPInvokeCallback (typeof (nw_framer_set_input_handler_t))] - static void TrampolineInputHandler (IntPtr block, OS_nw_framer framer) + static nuint TrampolineInputHandler (IntPtr block, OS_nw_framer framer) { - var del = BlockLiteral.GetTarget> (block); + var del = BlockLiteral.GetTarget (block); if (del != null) { var nwFramer = new NWFramer (framer, owns: true); - del (nwFramer); + return del (nwFramer); } + return 0; } [BindingImpl (BindingImplOptions.Optimizable)] - public Action InputHandler { + public NWFramerInputDelegate InputHandler { set { unsafe { if (value == null) { @@ -217,9 +221,9 @@ namespace Network { unsafe static extern void nw_framer_set_cleanup_handler (OS_nw_framer framer, void *cleanup_handler); delegate void nw_framer_set_cleanup_handler_t (IntPtr block, OS_nw_framer framer); - static nw_framer_set_input_handler_t static_CleanupHandler = TrampolineCleanupHandler; + static nw_framer_set_cleanup_handler_t static_CleanupHandler = TrampolineCleanupHandler; - [MonoPInvokeCallback (typeof (nw_framer_set_input_handler_t))] + [MonoPInvokeCallback (typeof (nw_framer_set_cleanup_handler_t))] static void TrampolineCleanupHandler (IntPtr block, OS_nw_framer framer) { var del = BlockLiteral.GetTarget> (block); @@ -253,7 +257,6 @@ namespace Network { static extern void nw_framer_schedule_wakeup (OS_nw_framer framer, ulong milliseconds); public void ScheduleWakeup (ulong milliseconds) => nw_framer_schedule_wakeup (GetCheckedHandle (), milliseconds); - */ [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_metadata nw_framer_message_create (OS_nw_framer framer); @@ -261,7 +264,6 @@ namespace Network { public NWFramerMessage CreateMessage () => new NWFramerMessage (nw_framer_message_create (GetCheckedHandle ()), owns: true); - /* [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_prepend_application_protocol (OS_nw_framer framer, OS_nw_protocol_options protocol_options); @@ -295,7 +297,7 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern bool nw_framer_deliver_input_no_copy (OS_nw_framer framer, nuint input_length, OS_nw_protocol_metadata message, bool is_complete); - public bool DeliverInput (nuint length, NWProtocolMetadata message, bool isComplete) + public bool DeliverInputNoCopy (nuint length, NWFramerMessage message, bool isComplete) { if (message == null) throw new ArgumentNullException (nameof (message)); @@ -305,11 +307,12 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_options nw_framer_create_options (OS_nw_protocol_definition framer_definition); - public static NWProtocolOptions CreateOptions (NWProtocolDefinition protocolDefinition) + public static T CreateOptions (NWProtocolDefinition protocolDefinition) where T: NWProtocolOptions { if (protocolDefinition == null) throw new ArgumentNullException (nameof (protocolDefinition)); - return new NWProtocolOptions (nw_framer_create_options (protocolDefinition.Handle), owns: true); + var x = nw_framer_create_options (protocolDefinition.Handle); + return Runtime.GetINativeObject (x, owns: true); } [DllImport (Constants.NetworkLibrary)] @@ -399,23 +402,24 @@ namespace Network { [DllImport (Constants.NetworkLibrary)] static extern unsafe bool nw_framer_parse_input (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte *temp_buffer, ref BlockLiteral parse); - delegate void nw_framer_parse_input_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete); + delegate nuint nw_framer_parse_input_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete); static nw_framer_parse_input_t static_ParseInputHandler = TrampolineParseInputHandler; [MonoPInvokeCallback (typeof (nw_framer_parse_input_t))] - static void TrampolineParseInputHandler (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete) + static nuint TrampolineParseInputHandler (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete) { - var del = BlockLiteral.GetTarget, bool>> (block); + var del = BlockLiteral.GetTarget (block); if (del != null) { var bBuffer = new byte[buffer_length]; Marshal.Copy (buffer, bBuffer, 0, (int)buffer_length); var mValue = new Memory(bBuffer); - del (mValue, is_complete); + return del (mValue, is_complete); } + return 0; } [BindingImpl (BindingImplOptions.Optimizable)] - public bool ParseInput (nuint minimumIncompleteLength, nuint maximumLength, Memory tempBuffer, Action, bool> handler) + public bool ParseInput (nuint minimumIncompleteLength, nuint maximumLength, Memory tempBuffer, NWFramerParseCompletionDelegate handler) { if (handler == null) throw new ArgumentNullException (nameof (handler)); @@ -431,37 +435,10 @@ namespace Network { } } - [DllImport (Constants.NetworkLibrary)] - static extern unsafe void nw_framer_message_set_value (OS_nw_protocol_metadata message, string key, byte *value, void *dispose_value); - - public void SetKey (string key, ReadOnlySpan value) - { - // the method takes a callback to cleanup the data, but we do not need that since we are managed - if (key == null) - throw new ArgumentNullException (nameof (key)); - - unsafe { - fixed (byte* mh = value) - nw_framer_message_set_value (GetCheckedHandle (), key, mh, null); - } - } - - [DllImport (Constants.NetworkLibrary)] - static extern void nw_framer_message_set_object_value (OS_nw_protocol_metadata message, string key, IntPtr value); - - public void SetObject (string key, NSObject value) - => nw_framer_message_set_object_value (GetCheckedHandle (), key, value.GetHandle ()); - - [DllImport (Constants.NetworkLibrary)] - static extern IntPtr nw_framer_message_copy_object_value (OS_nw_protocol_metadata message, string key); - - public NSObject GetValue (string key) - => Runtime.GetNSObject (nw_framer_message_copy_object_value (GetCheckedHandle (), key)); - [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_framer_deliver_input (OS_nw_framer framer, byte *input_buffer, nuint input_length, OS_nw_protocol_metadata message, bool is_complete); - public void DeliverInput (ReadOnlySpan buffer, NWProtocolMetadata message, bool isComplete) + public void DeliverInput (ReadOnlySpan buffer, NWFramerMessage message, bool isComplete) { if (message == null) throw new ArgumentNullException (nameof (message)); @@ -470,6 +447,5 @@ namespace Network { nw_framer_deliver_input (GetCheckedHandle (),mh, (nuint)buffer.Length, message.Handle, isComplete); } } - */ } } diff --git a/tests/xtro-sharpie/iOS-Network.todo b/tests/xtro-sharpie/iOS-Network.todo index dc046d6a62..dcad7c13cc 100644 --- a/tests/xtro-sharpie/iOS-Network.todo +++ b/tests/xtro-sharpie/iOS-Network.todo @@ -1,24 +1 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound \ No newline at end of file +!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-Network.todo b/tests/xtro-sharpie/macOS-Network.todo index 89d3dc9700..b40d73ad49 100644 --- a/tests/xtro-sharpie/macOS-Network.todo +++ b/tests/xtro-sharpie/macOS-Network.todo @@ -7,26 +7,3 @@ !missing-pinvoke! nw_ethernet_channel_set_state_changed_handler is not bound !missing-pinvoke! nw_ethernet_channel_start is not bound !missing-pinvoke! nw_parameters_create_custom_ip is not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound diff --git a/tests/xtro-sharpie/tvOS-Network.todo b/tests/xtro-sharpie/tvOS-Network.todo index dc046d6a62..dcad7c13cc 100644 --- a/tests/xtro-sharpie/tvOS-Network.todo +++ b/tests/xtro-sharpie/tvOS-Network.todo @@ -1,24 +1 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound \ No newline at end of file +!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/watchOS-Network.todo b/tests/xtro-sharpie/watchOS-Network.todo index 04c1d79f24..f5e825a6d9 100644 --- a/tests/xtro-sharpie/watchOS-Network.todo +++ b/tests/xtro-sharpie/watchOS-Network.todo @@ -1,24 +1 @@ !missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_framer_async is not bound -!missing-pinvoke! nw_framer_copy_local_endpoint is not bound -!missing-pinvoke! nw_framer_copy_parameters is not bound -!missing-pinvoke! nw_framer_copy_remote_endpoint is not bound -!missing-pinvoke! nw_framer_create_options is not bound -!missing-pinvoke! nw_framer_deliver_input is not bound -!missing-pinvoke! nw_framer_deliver_input_no_copy is not bound -!missing-pinvoke! nw_framer_mark_failed_with_error is not bound -!missing-pinvoke! nw_framer_mark_ready is not bound -!missing-pinvoke! nw_framer_parse_input is not bound -!missing-pinvoke! nw_framer_parse_output is not bound -!missing-pinvoke! nw_framer_pass_through_input is not bound -!missing-pinvoke! nw_framer_pass_through_output is not bound -!missing-pinvoke! nw_framer_prepend_application_protocol is not bound -!missing-pinvoke! nw_framer_schedule_wakeup is not bound -!missing-pinvoke! nw_framer_set_cleanup_handler is not bound -!missing-pinvoke! nw_framer_set_input_handler is not bound -!missing-pinvoke! nw_framer_set_output_handler is not bound -!missing-pinvoke! nw_framer_set_stop_handler is not bound -!missing-pinvoke! nw_framer_set_wakeup_handler is not bound -!missing-pinvoke! nw_framer_write_output is not bound -!missing-pinvoke! nw_framer_write_output_data is not bound -!missing-pinvoke! nw_framer_write_output_no_copy is not bound From 954c01b54e3c1ba4bf4070e37c02caed37f8878b Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 07:26:18 +0100 Subject: [PATCH 18/55] Bump mono to get mono archives. (#7367) New commits in mono/mono: * mono/mono@062f0ab8cae [sdks] Use Xcode 11.2 stable version for iOS/Mac SDKs Diff: https://github.com/mono/mono/compare/e1ef774391da2b84d003431e8871b0bacbd25cb3..062f0ab8cae60d1d347e4d722884c065c9f34484 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 7fb9d24857..b6818f60c5 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := e1ef774391da2b84d003431e8871b0bacbd25cb3 +NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 2b570fafba69f3c507ad655363820d273121e94b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Nov 2019 07:40:35 +0100 Subject: [PATCH 19/55] Bump mono to get mono archives. (#7365) New commits in mono/mono: * mono/mono@062f0ab8cae [sdks] Use Xcode 11.2 stable version for iOS/Mac SDKs Diff: https://github.com/mono/mono/compare/e1ef774391da2b84d003431e8871b0bacbd25cb3..062f0ab8cae60d1d347e4d722884c065c9f34484 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index 7fb9d24857..b6818f60c5 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := e1ef774391da2b84d003431e8871b0bacbd25cb3 +NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 374fe91721bca771237c96fead98c9a7990f01ff Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 16:45:04 +0100 Subject: [PATCH 20/55] [Tests] Fix introspection failing due to a typo. (#7370) Fixes: https://github.com/xamarin/maccore/issues/2052 --- tests/introspection/ApiTypoTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index 3fb48c6285..3381892cac 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -180,6 +180,7 @@ namespace Introspection "Descendents", "Descrete", "Dhe", // Diffie–Hellman key exchange + "Diffable", // that you can diff it.. made up word from apple "Differental", "Diffie", "Directionfor", From 8536ba69757274c4e5f29057d534169fce829d39 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 21:21:24 +0100 Subject: [PATCH 21/55] [Tests] Fix introspection failing due to a typo. (#7377) Fixes: https://github.com/xamarin/maccore/issues/2052 --- tests/introspection/ApiTypoTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index 3fb48c6285..3381892cac 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -180,6 +180,7 @@ namespace Introspection "Descendents", "Descrete", "Dhe", // Diffie–Hellman key exchange + "Diffable", // that you can diff it.. made up word from apple "Differental", "Diffie", "Directionfor", From 011aaf7ccb6f28c2e3d8c8cd6b8a7369d851a56c Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 6 Nov 2019 17:06:38 -0500 Subject: [PATCH 22/55] Update APIDIFF_REFERENCES to current stable (#7372) --- Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.config b/Make.config index db22780bde..572b57085b 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.2/a82239687c7c498844137779ee529154f260cb6f/48/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) From 0641e079e0c7418ea488a2f191cb7d6f9826cdab Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 6 Nov 2019 23:09:49 +0100 Subject: [PATCH 23/55] Update APIDIFF_REFERENCES to current stable (#7375) --- Make.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.config b/Make.config index db22780bde..572b57085b 100644 --- a/Make.config +++ b/Make.config @@ -31,7 +31,7 @@ $(TOP)/Make.config.inc: $(TOP)/Make.config $(TOP)/mk/mono.mk include $(TOP)/Make.versions -APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.1/e37549bc9052bff81d5c7da8a3b7992b47a08154/29/package/bundle.zip +APIDIFF_REFERENCES=https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.2/a82239687c7c498844137779ee529154f260cb6f/48/package/bundle.zip PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) From 2db10bda07a9d5a01426dc9b25de0bad3be8168a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 7 Nov 2019 19:25:25 +0100 Subject: [PATCH 24/55] [Install] Do not crash when the directory is not found. (#7380) This is NOT a fix for https://github.com/xamarin/maccore/issues/2053 but a nice thing to have to make sure that when the file cannot be copied we have a useful debugging message. Fixing https://github.com/xamarin/maccore/issues/2053 should be done in the path mangler that is doing something wrong with the paths. --- tools/install-source/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/install-source/Program.cs b/tools/install-source/Program.cs index 66b1d7ca52..d092f69238 100644 --- a/tools/install-source/Program.cs +++ b/tools/install-source/Program.cs @@ -275,12 +275,18 @@ public class ListSourceFiles { } try { File.Copy (fixedSource, target); - } catch (FileNotFoundException e) { + } catch (FileNotFoundException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file does not exists: {2}", fixedSource, target, e); Console.WriteLine ("Debugging info:"); Console.WriteLine ("\tSource is {0}", src); Console.WriteLine ("\tFixed source is {0}", fixedSource); - Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType().Name); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); + } catch (DirectoryNotFoundException e) { + Console.WriteLine ("The file {0} could not be copied to {1} because the dir does not exists: {2}", fixedSource, target, e); + Console.WriteLine ("Debugging info:"); + Console.WriteLine ("\tSource is {0}", src); + Console.WriteLine ("\tFixed source is {0}", fixedSource); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); } catch (PathTooLongException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file path is too long: {2}", fixedSource, target, e); return 1; From 5fa3d8abbb563783721a137fa65385459bf8549d Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 7 Nov 2019 19:25:41 +0100 Subject: [PATCH 25/55] [Install] Do not crash when the directory is not found. (#7382) This is NOT a fix for https://github.com/xamarin/maccore/issues/2053 but a nice thing to have to make sure that when the file cannot be copied we have a useful debugging message. Fixing https://github.com/xamarin/maccore/issues/2053 should be done in the path mangler that is doing something wrong with the paths. --- tools/install-source/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/install-source/Program.cs b/tools/install-source/Program.cs index 66b1d7ca52..d092f69238 100644 --- a/tools/install-source/Program.cs +++ b/tools/install-source/Program.cs @@ -275,12 +275,18 @@ public class ListSourceFiles { } try { File.Copy (fixedSource, target); - } catch (FileNotFoundException e) { + } catch (FileNotFoundException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file does not exists: {2}", fixedSource, target, e); Console.WriteLine ("Debugging info:"); Console.WriteLine ("\tSource is {0}", src); Console.WriteLine ("\tFixed source is {0}", fixedSource); - Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType().Name); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); + } catch (DirectoryNotFoundException e) { + Console.WriteLine ("The file {0} could not be copied to {1} because the dir does not exists: {2}", fixedSource, target, e); + Console.WriteLine ("Debugging info:"); + Console.WriteLine ("\tSource is {0}", src); + Console.WriteLine ("\tFixed source is {0}", fixedSource); + Console.WriteLine ("\tPath mangler type is {0}", mangler.GetType ().Name); } catch (PathTooLongException e) { Console.WriteLine ("The file {0} could not be copied to {1} because the file path is too long: {2}", fixedSource, target, e); return 1; From a1b670cd6399fda42506f360f968b0450f371fa4 Mon Sep 17 00:00:00 2001 From: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:42:47 -0500 Subject: [PATCH 26/55] [FileProvider] Add FileProvider binding xcode11.2b1 (#7384) --- src/fileprovider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fileprovider.cs b/src/fileprovider.cs index 029d736284..13e71ca0ce 100644 --- a/src/fileprovider.cs +++ b/src/fileprovider.cs @@ -56,7 +56,6 @@ namespace FileProvider { NSUrl DocumentStorageUrl { get; } [NoMac] - [Deprecated (PlatformName.iOS, 13, 0)] // Undocumented replacement [Export ("URLForItemWithPersistentIdentifier:")] NSUrl GetUrlForItem (string persistentIdentifier); From 9297672d22e8132807b465c48f07041ff884e129 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 8 Nov 2019 22:07:47 +0100 Subject: [PATCH 27/55] [Install] Ensure that sources from mono are included when building from source. (#7390) The PathManglerFactory was getting confused when building mono from source again and since it did not find the sources in the download directory it considered that the path to modify was part of Xamarin. Now the factory tests first if we are getting a path from the mono external submodule, if that is the case we know is a mono path and do the right thing. Fixes https://github.com/xamarin/maccore/issues/2053 --- tools/install-source/PathManglerFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/install-source/PathManglerFactory.cs b/tools/install-source/PathManglerFactory.cs index c0cc5f2004..698daff0fb 100644 --- a/tools/install-source/PathManglerFactory.cs +++ b/tools/install-source/PathManglerFactory.cs @@ -82,6 +82,10 @@ namespace InstallSources Console.WriteLine($"Mono path is {monoPath}"); return File.Exists(monoPath); } + // check if the path is the xamarin source path + the mono external submodule + var monoSubmodule = Path.Combine (XamarinSourcePath.Replace ("src/", ""), "external", "mono"); + if (path.StartsWith (monoSubmodule, StringComparison.Ordinal)) + return true; if (path.StartsWith (XamarinSourcePath, StringComparison.Ordinal)) return false; var xamarinRuntimePath = XamarinSourcePath.Replace($"/{srcSubPath}/", $"/{runtimeSubPath}/"); From 6d13a3902772ae0ff42a333329efc98a75e5f3c0 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 8 Nov 2019 22:08:30 +0100 Subject: [PATCH 28/55] [Install] Ensure that sources from mono are included when building from source. (#7389) The PathManglerFactory was getting confused when building mono from source again and since it did not find the sources in the download directory it considered that the path to modify was part of Xamarin. Now the factory tests first if we are getting a path from the mono external submodule, if that is the case we know is a mono path and do the right thing. Fixes https://github.com/xamarin/maccore/issues/2053 --- tools/install-source/PathManglerFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/install-source/PathManglerFactory.cs b/tools/install-source/PathManglerFactory.cs index c0cc5f2004..698daff0fb 100644 --- a/tools/install-source/PathManglerFactory.cs +++ b/tools/install-source/PathManglerFactory.cs @@ -82,6 +82,10 @@ namespace InstallSources Console.WriteLine($"Mono path is {monoPath}"); return File.Exists(monoPath); } + // check if the path is the xamarin source path + the mono external submodule + var monoSubmodule = Path.Combine (XamarinSourcePath.Replace ("src/", ""), "external", "mono"); + if (path.StartsWith (monoSubmodule, StringComparison.Ordinal)) + return true; if (path.StartsWith (XamarinSourcePath, StringComparison.Ordinal)) return false; var xamarinRuntimePath = XamarinSourcePath.Replace($"/{srcSubPath}/", $"/{runtimeSubPath}/"); From 31be34a306b512a69fb95dfed95f535a2663345f Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 12 Nov 2019 15:05:35 +0100 Subject: [PATCH 29/55] [xcode11.3] [Packaging] Ensure that when we build from source, the srcs go to the correct place. (#7407) * [Packaging] Ensure that when we build from source, the srcs go to the correct plance. When building from source, the install-sources command was not moving the files correctly. This change makes sure that, if we build from source, we do add the mono sources in the correct location. Fixes: https://github.com/xamarin/xamarin-macios/issues/7393 --- .../MonoPathManglerTest.cs | 3 ++- tools/install-source/MonoPathMangler.cs | 22 ++++++++++++++++++- tools/install-source/PathManglerFactory.cs | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs b/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs index 8a178222ef..83cb3cc5cc 100644 --- a/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs +++ b/tools/install-source/InstallSourcesTests/MonoPathManglerTest.cs @@ -19,10 +19,11 @@ namespace InstallSourcesTests monoPath = "/Users/test/xamarin-macios/external/mono/"; installDir = "/Users/test/xamarin-macios/_ios-build//Library/Frameworks/Xamarin.iOS.framework/Versions/git"; destinationDir = "/Users/test/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git"; - mangler = new MonoPathMangler { + mangler = new MonoPathMangler { InstallDir = installDir, MonoSourcePath = monoPath, DestinationDir = destinationDir, + XamarinSourcePath = "/Users/test/xamarin-macios/src", }; } diff --git a/tools/install-source/MonoPathMangler.cs b/tools/install-source/MonoPathMangler.cs index d22f4a5601..262df31e0e 100644 --- a/tools/install-source/MonoPathMangler.cs +++ b/tools/install-source/MonoPathMangler.cs @@ -7,6 +7,9 @@ namespace InstallSources { public static readonly string iOSFramework = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/"; public static readonly string MacFramework = "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/src/Xamarin.Mac/"; + string monoSubmodulePath; + string xamarinSourcePath; + /// /// Gets and sets the location of the mono sources. /// @@ -19,12 +22,29 @@ namespace InstallSources /// The frame work dir. public string DestinationDir { get; set; } + /// + /// Gets and sets the path to the xamarin source. + /// + /// The xamarin source path. + public string XamarinSourcePath { + get { + return xamarinSourcePath; + } + set { + xamarinSourcePath = value; + monoSubmodulePath = Path.Combine (value.Replace ("src/", ""), "external", "mono") + "/"; + } + } + /// /// Gets or sets the install dir. /// /// The install dir. public string InstallDir { get; set; } + bool IsCheckout (string path) + => path.StartsWith (monoSubmodulePath, StringComparison.Ordinal); + public string GetSourcePath (string path) { // we are dealing with a Mono archive assembly @@ -40,7 +60,7 @@ namespace InstallSources public string GetTargetPath (string path) { - var relativePath = path.Substring (MonoSourcePath.Length); + var relativePath = path.Substring (IsCheckout (path) ? monoSubmodulePath.Length : MonoSourcePath.Length); if (relativePath.StartsWith ("/", StringComparison.Ordinal)) relativePath = relativePath.Remove (0, 1); var target = Path.Combine (DestinationDir, "src", (InstallDir.Contains("Xamarin.iOS")?"Xamarin.iOS":"Xamarin.Mac"), relativePath); diff --git a/tools/install-source/PathManglerFactory.cs b/tools/install-source/PathManglerFactory.cs index 698daff0fb..17299cae0a 100644 --- a/tools/install-source/PathManglerFactory.cs +++ b/tools/install-source/PathManglerFactory.cs @@ -28,7 +28,8 @@ namespace InstallSources monoMangler = new MonoPathMangler { InstallDir = InstallDir, DestinationDir = DestinationDir, - MonoSourcePath = MonoSourcePath + MonoSourcePath = MonoSourcePath, + XamarinSourcePath = XamarinSourcePath, }; return monoMangler; } From 83fd5162f28694720118bef5a6aeb879b62c085a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 12 Nov 2019 21:08:18 +0100 Subject: [PATCH 30/55] [xcode11.3] [Tests] If we have server errors. Mark test as inconclusive. (#7415) If we are getting errors (500,401..) do not mark a link all test as a failure, but as inconclusive. Fixes: https://github.com/xamarin/maccore/issues/2056 --- tests/linker/mac/LinkAnyTest.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/linker/mac/LinkAnyTest.cs b/tests/linker/mac/LinkAnyTest.cs index 3d3750cb14..ed75a48bc6 100644 --- a/tests/linker/mac/LinkAnyTest.cs +++ b/tests/linker/mac/LinkAnyTest.cs @@ -21,15 +21,27 @@ namespace LinkAnyTest { } static bool waited; + static bool requestError; + static HttpStatusCode statusCode; + + // http://blogs.msdn.com/b/csharpfaq/archive/2012/06/26/understanding-a-simple-async-program.aspx // ref: https://bugzilla.xamarin.com/show_bug.cgi?id=7114 static async Task GetWebPageAsync () { - Task getWebPageTask = new HttpClient ().GetStringAsync ("http://msdn.microsoft.com"); - string content = await getWebPageTask; - waited = true; - bool success = !String.IsNullOrEmpty (content); - Assert.IsTrue (success, $"received {content.Length} bytes"); + // do not use GetStringAsync, we are going to miss useful data, such as the resul code + using (var client = new HttpClient ()) { + HttpResponseMessage response = await client.GetAsync ("http://example.com"); + if(!response.IsSuccessStatusCode) { + requestError = true; + statusCode = response.StatusCode; + } else { + string content = await response.Content.ReadAsStringAsync (); + waited = true; + bool success = !String.IsNullOrEmpty (content); + Assert.IsTrue (success, $"received {content.Length} bytes"); + } + } } [Test] @@ -40,7 +52,11 @@ namespace LinkAnyTest { // we do not want the async code to get back to the AppKit thread, hanging the process SynchronizationContext.SetSynchronizationContext (null); GetWebPageAsync ().Wait (); - Assert.IsTrue (waited, "async/await worked"); + if (requestError) { + Assert.Inconclusive ($"Test cannot be trusted. Issues performing the request. Status code '{statusCode}'"); + } else { + Assert.IsTrue (waited, "async/await worked"); + } } finally { SynchronizationContext.SetSynchronizationContext (current_sc); } From b69e72ba5ccb5f69fb752927569fc7bd021fcff8 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 12 Nov 2019 21:45:06 +0100 Subject: [PATCH 31/55] [d16-4] [Tests] If we have server errors. Mark test as inconclusive. (#7417) If we are getting errors (500,401..) do not mark a link all test as a failure, but as inconclusive. Fixes: https://github.com/xamarin/maccore/issues/2056 --- tests/linker/mac/LinkAnyTest.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/linker/mac/LinkAnyTest.cs b/tests/linker/mac/LinkAnyTest.cs index 3d3750cb14..ed75a48bc6 100644 --- a/tests/linker/mac/LinkAnyTest.cs +++ b/tests/linker/mac/LinkAnyTest.cs @@ -21,15 +21,27 @@ namespace LinkAnyTest { } static bool waited; + static bool requestError; + static HttpStatusCode statusCode; + + // http://blogs.msdn.com/b/csharpfaq/archive/2012/06/26/understanding-a-simple-async-program.aspx // ref: https://bugzilla.xamarin.com/show_bug.cgi?id=7114 static async Task GetWebPageAsync () { - Task getWebPageTask = new HttpClient ().GetStringAsync ("http://msdn.microsoft.com"); - string content = await getWebPageTask; - waited = true; - bool success = !String.IsNullOrEmpty (content); - Assert.IsTrue (success, $"received {content.Length} bytes"); + // do not use GetStringAsync, we are going to miss useful data, such as the resul code + using (var client = new HttpClient ()) { + HttpResponseMessage response = await client.GetAsync ("http://example.com"); + if(!response.IsSuccessStatusCode) { + requestError = true; + statusCode = response.StatusCode; + } else { + string content = await response.Content.ReadAsStringAsync (); + waited = true; + bool success = !String.IsNullOrEmpty (content); + Assert.IsTrue (success, $"received {content.Length} bytes"); + } + } } [Test] @@ -40,7 +52,11 @@ namespace LinkAnyTest { // we do not want the async code to get back to the AppKit thread, hanging the process SynchronizationContext.SetSynchronizationContext (null); GetWebPageAsync ().Wait (); - Assert.IsTrue (waited, "async/await worked"); + if (requestError) { + Assert.Inconclusive ($"Test cannot be trusted. Issues performing the request. Status code '{statusCode}'"); + } else { + Assert.IsTrue (waited, "async/await worked"); + } } finally { SynchronizationContext.SetSynchronizationContext (current_sc); } From d99e3b24f91834b06e77ea6b211ca573afbf5ae2 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 13 Nov 2019 06:06:23 -0500 Subject: [PATCH 32/55] [CoreFoundation] Add Clone method for CFArray. (#7403) When working on https://github.com/xamarin/maccore/issues/940 we noticed that clone the array would be a better approach. The CFArrayCreateCopy add some nice things: * The pointer values from theArray are copied into the new array. * The values are also retained by the new array. * The count of the new array is the same as theArray * The new array uses the same callbacks as theArray. [IMPORTANT] Whith this in, we can have a better fix for https://github.com/xamarin/maccore/issues/940 --- src/CoreFoundation/CFArray.cs | 7 +++++++ tests/xtro-sharpie/common-CoreFoundation.ignore | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CoreFoundation/CFArray.cs b/src/CoreFoundation/CFArray.cs index 7f5df0e795..d3b9dd5f08 100644 --- a/src/CoreFoundation/CFArray.cs +++ b/src/CoreFoundation/CFArray.cs @@ -35,6 +35,8 @@ using Foundation; using ObjCRuntime; using CFIndex = System.nint; +using CFArrayRef = System.IntPtr; +using CFAllocatorRef = System.IntPtr; namespace CoreFoundation { @@ -149,6 +151,11 @@ namespace CoreFoundation { { return CFArrayGetCount (array); } + + [DllImport (Constants.CoreFoundationLibrary)] + extern static CFArrayRef CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray); + + public CFArray Clone () => new CFArray (CFArrayCreateCopy (IntPtr.Zero, this.Handle), true); } } diff --git a/tests/xtro-sharpie/common-CoreFoundation.ignore b/tests/xtro-sharpie/common-CoreFoundation.ignore index 3db8cadbd8..ee1d3a96ee 100644 --- a/tests/xtro-sharpie/common-CoreFoundation.ignore +++ b/tests/xtro-sharpie/common-CoreFoundation.ignore @@ -334,7 +334,6 @@ !missing-pinvoke! CFArrayApplyFunction is not bound !missing-pinvoke! CFArrayBSearchValues is not bound !missing-pinvoke! CFArrayContainsValue is not bound -!missing-pinvoke! CFArrayCreateCopy is not bound !missing-pinvoke! CFArrayCreateMutable is not bound !missing-pinvoke! CFArrayCreateMutableCopy is not bound !missing-pinvoke! CFArrayExchangeValuesAtIndices is not bound From cd7c5171a981bf3d44360111bacad7fb7a9153df Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 13 Nov 2019 17:19:16 -0500 Subject: [PATCH 33/55] [CoreFoundation] CFBundle.GetAll better thread safe. (#7425) The initial solution fixed the rance condition in which the index changed, but that did not guarantee that we would get the correct bundles. We now clone the CFArray (which also clones the callbacks set to the array) and iterate over it to make sure Apple does not do evil tings while we are iteraing. Better Fixes: https://github.com/xamarin/maccore/issues/940 --- src/CoreFoundation/CFBundle.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/CoreFoundation/CFBundle.cs b/src/CoreFoundation/CFBundle.cs index c4ac2db5ea..581e73112a 100644 --- a/src/CoreFoundation/CFBundle.cs +++ b/src/CoreFoundation/CFBundle.cs @@ -103,11 +103,22 @@ namespace CoreFoundation { public static CFBundle[] GetAll () { - using (var cfBundles = new CFArray (CFBundleGetAllBundles ())) { - var managedBundles = new CFBundle [cfBundles.Count]; - for (int index = 0; index < cfBundles.Count; index++) { + // as per apple documentation: + // CFBundleGetAllBundles + // + // 'This function is potentially expensive and not thread-safe' + // + // This means, that we should not trust the size of the array, since is a get and + // might be modified by a diff thread. We are going to clone the array and make sure + // that Apple does not modify the array while we work with it. That avoids changes + // in the index or in the bundles returned. + using (var cfBundles = new CFArray (CFBundleGetAllBundles ())) + using (var cfBundlesCopy = cfBundles.Clone () ) { + var bundleCount = cfBundlesCopy.Count; // the property is a C call, calling everytime we loop is not needed + var managedBundles = new CFBundle [bundleCount]; + for (int index = 0; index < bundleCount; index++) { // follow the get rule, we do not own the object - managedBundles [index] = new CFBundle (cfBundles.GetValue (index), false); + managedBundles [index] = new CFBundle (cfBundlesCopy.GetValue (index), false); } return managedBundles; } From 5e52f30c0545ccf8aee448dffb96ce3e88463987 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Thu, 14 Nov 2019 08:32:26 -0500 Subject: [PATCH 34/55] Bump for Xcode 11.3 beta 1 (#7431) * Bump for Xcode 11.3 beta 1 * [system-dependencies] Make it clearer what failed on the bots. Locally we use colors to distinguish between warnings and failures, but colors don't show up on the bots, so use text instead. * Verbose provisioning. * [system-dependencies] Improve simulator checks a bit. * Non-verbose provisioning. --- Make.config | 10 +++++----- Versions-ios.plist.in | 2 ++ system-dependencies.sh | 19 +++++++++++++------ tools/siminstaller/Program.cs | 7 +------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Make.config b/Make.config index 572b57085b..4df0124126 100644 --- a/Make.config +++ b/Make.config @@ -59,9 +59,9 @@ IOS_PACKAGE_VERSION_BUILD=$(IOS_COMMIT_DISTANCE) IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_MAJOR) $(IOS_PACKAGE_VERSION_MINOR) $(IOS_PACKAGE_VERSION_REV) $(IOS_PACKAGE_VERSION_BUILD)) # Xcode version should have both a major and a minor version (even if the minor version is 0) -XCODE_VERSION=11.2 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.2.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode112.app/Contents/Developer +XCODE_VERSION=11.3 +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.3_beta.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode113-beta1.app/Contents/Developer XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist) # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk @@ -106,9 +106,9 @@ TVOS_SDK_VERSION=13.2 # If the max OS version does not match the SDK version (for instance the iOS # 12.2 SDK supported both iOS 12.3 and iOS 12.4), then these variables can be # set to something other than the corresponding SDK versions. -MAX_IOS_VERSION=$(IOS_SDK_VERSION) +MAX_IOS_VERSION=13.3 MAX_WATCH_VERSION=$(WATCH_SDK_VERSION) -MAX_TVOS_VERSION=$(TVOS_SDK_VERSION) +MAX_TVOS_VERSION=13.3 # Minimum OS versions for running XI/XM apps. MIN_IOS_SDK_VERSION=7.0 diff --git a/Versions-ios.plist.in b/Versions-ios.plist.in index b0f084d071..b4e9cebd8b 100644 --- a/Versions-ios.plist.in +++ b/Versions-ios.plist.in @@ -36,6 +36,7 @@ 13.0 13.1 13.2 + 13.3 tvOS @@ -57,6 +58,7 @@ 12.4 13.0 13.2 + 13.3 watchOS diff --git a/system-dependencies.sh b/system-dependencies.sh index 1ee4626a65..6d796f4caa 100755 --- a/system-dependencies.sh +++ b/system-dependencies.sh @@ -179,8 +179,11 @@ COLOR_MAGENTA=$(tput setaf 5 2>/dev/null || true) COLOR_BLUE=$(tput setaf 6 2>/dev/null || true) COLOR_CLEAR=$(tput sgr0 2>/dev/null || true) COLOR_RESET=uniquesearchablestring +FAILURE_PREFIX= +if test -z "$COLOR_RED"; then FAILURE_PREFIX="** failure ** "; fi + function fail () { - echo " ${COLOR_RED}${1//${COLOR_RESET}/${COLOR_RED}}${COLOR_CLEAR}" + echo " $FAILURE_PREFIX${COLOR_RED}${1//${COLOR_RESET}/${COLOR_RED}}${COLOR_CLEAR}" FAIL=1 } @@ -950,7 +953,7 @@ function check_simulators () local XCODE EXTRA_SIMULATORS=$(grep ^EXTRA_SIMULATORS= Make.config | sed 's/.*=//') - XCODE=$(grep ^XCODE_DEVELOPER_ROOT= Make.config | sed 's/.*=//')/../.. + XCODE=$(dirname "$(dirname "$(grep ^XCODE_DEVELOPER_ROOT= Make.config | sed 's/.*=//')")") if ! make -C tools/siminstaller >/dev/null; then warn "Can't check if simulators are available, because siminstaller failed to build." @@ -976,13 +979,17 @@ function check_simulators () fi if [[ "$FAILED_SIMULATORS" =~ "Unknown simulators:" ]]; then $action "${FAILED_SIMULATORS}" - $action " If you just updated the Xcode version, it's likely Apple stopped shipping these simulators with the new version of Xcode." - $action " If that's the case, you can list the available simulators with ${COLOR_MAGENTA}make -C tools/siminstaller print-simulators${COLOR_RESET}," + $action " If you just updated the Xcode version, it's possible Apple stopped shipping these simulators with the new version of Xcode." + $action " If that's the case, you can list the available simulators with ${COLOR_MAGENTA}make -C tools/siminstaller print-simulators --xcode $XCODE${COLOR_RESET}," $action " and then update the ${COLOR_MAGENTA}MIN__SIMULATOR_VERSION${COLOR_RESET} and ${COLOR_MAGENTA}EXTRA_SIMULATORS${COLOR_RESET} variables in Make.config to the earliest available simulators." + $action " Another possibility is that Apple is not shipping any simulators (yet?) for the new version of Xcode (if the previous list shows no simulators)." else if ! test -z $PROVISION_SIMULATORS; then - mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" "${SIMS[@]}" - ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'" + if ! mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" "${SIMS[@]}"; then + $action "Failed to install extra simulators." + else + ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'" + fi else $action "The simulators '${FAILED_SIMULATORS//$'\n'/', '}' are not installed or need to be upgraded." fi diff --git a/tools/siminstaller/Program.cs b/tools/siminstaller/Program.cs index 555d85f880..d20beffaea 100644 --- a/tools/siminstaller/Program.cs +++ b/tools/siminstaller/Program.cs @@ -260,12 +260,7 @@ namespace xsiminstaller { } if (install.Count > 0) { - if (only_check) { - foreach (var sim in install) - Console.WriteLine ($"{sim} (unknown)"); - } else { - Console.WriteLine ("Unknown simulators: {0}", string.Join (", ", install)); - } + Console.WriteLine ("Unknown simulators: {0}", string.Join (", ", install)); return 1; } From e31e6773d1a9650e5837f992f27cf284795324a7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 15 Nov 2019 08:48:22 +0100 Subject: [PATCH 35/55] Bump mono to get archive built with Xcode 11.3 b1. (#7444) New commits in mono/mono: * mono/mono@3e882ed1a20 [2019-08][ci] Add Xcode 11.3beta1 for XI/XM Mono SDK builds * mono/mono@e59c3fbb688 Bump msbuild packages to 1e1d0f2caad3731357cca18b298536e514f5519b (#17724) Diff: https://github.com/mono/mono/compare/062f0ab8cae60d1d347e4d722884c065c9f34484..3e882ed1a2013f756bdbe104c23e8ff54d5fa49c --- mk/mono.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/mono.mk b/mk/mono.mk index b6818f60c5..5e116b50a6 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,5 +1,5 @@ -NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 -NEEDED_MONO_BRANCH := 2019-08 +NEEDED_MONO_VERSION := 3e882ed1a2013f756bdbe104c23e8ff54d5fa49c +NEEDED_MONO_BRANCH := 2019-08-xcode11.3 MONO_DIRECTORY := mono MONO_MODULE := https://github.com/mono/mono From 0e394f7e80445899ecb150d41a5557022315d581 Mon Sep 17 00:00:00 2001 From: Pramit Mallick Date: Fri, 15 Nov 2019 21:16:40 +0530 Subject: [PATCH 36/55] CoreFoundation update - adding to ignore (#7448) --- tests/xtro-sharpie/macOS-CoreFoundation.ignore | 2 ++ tests/xtro-sharpie/macOS-CoreFoundation.todo | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/xtro-sharpie/macOS-CoreFoundation.ignore b/tests/xtro-sharpie/macOS-CoreFoundation.ignore index 4b7472403d..23e7fe2a1c 100644 --- a/tests/xtro-sharpie/macOS-CoreFoundation.ignore +++ b/tests/xtro-sharpie/macOS-CoreFoundation.ignore @@ -74,3 +74,5 @@ !missing-pinvoke! CFXMLTreeCreateXMLData is not bound !missing-pinvoke! CFXMLTreeGetNode is not bound !unknown-pinvoke! _NSGetExecutablePath bound +!missing-field! kCFUserNotificationAlertTopMostKey not bound +!missing-field! kCFUserNotificationKeyboardTypesKey not bound diff --git a/tests/xtro-sharpie/macOS-CoreFoundation.todo b/tests/xtro-sharpie/macOS-CoreFoundation.todo index 0fa3678642..e69de29bb2 100644 --- a/tests/xtro-sharpie/macOS-CoreFoundation.todo +++ b/tests/xtro-sharpie/macOS-CoreFoundation.todo @@ -1,2 +0,0 @@ -!missing-field! kCFUserNotificationAlertTopMostKey not bound -!missing-field! kCFUserNotificationKeyboardTypesKey not bound From 806404fa51886aa1c066a7271a5493e4ef08c97e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 15 Nov 2019 17:21:10 +0100 Subject: [PATCH 37/55] Keep track of SDK versions and OS versions separately. Fixes xamarin/maccore#2066. (#7454) The latest SDK version and the latest OS version does not necessarily have to match (for instance the iOS 13.2 SDK can support both iOS 13.2 and iOS 13.3), so keep track of them separately. Also use the latest OS version to determine which simulator to run, instead of the latest SDK version (Xcode 11.3 ships with the iOS 13.2 SDK but only has an iOS 13.3 simulator, not an iOS 13.2 simulator). Fixes https://github.com/xamarin/maccore/issues/2066. --- tests/xharness/Simulators.cs | 10 +++++----- tools/common/Make.common | 4 ++++ tools/common/SdkVersions.cs.in | 12 +++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/xharness/Simulators.cs b/tests/xharness/Simulators.cs index 2a41e9c3b7..5112e853a2 100644 --- a/tests/xharness/Simulators.cs +++ b/tests/xharness/Simulators.cs @@ -253,21 +253,21 @@ namespace xharness break; case AppRunnerTarget.Simulator_iOS64: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType." + (min_version ? "iPhone-6" : "iPhone-X"); - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.iOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.MaxiOSSimulator).Replace ('.', '-'); break; case AppRunnerTarget.Simulator_iOS: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.iPhone-5"; - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.iOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.MaxiOSSimulator).Replace ('.', '-'); break; case AppRunnerTarget.Simulator_tvOS: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p"; - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.tvOS-" + (min_version ? Xamarin.SdkVersions.MinTVOSSimulator : Xamarin.SdkVersions.TVOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.tvOS-" + (min_version ? Xamarin.SdkVersions.MinTVOSSimulator : Xamarin.SdkVersions.MaxTVOSSimulator).Replace ('.', '-'); break; case AppRunnerTarget.Simulator_watchOS: simulator_devicetype = "com.apple.CoreSimulator.SimDeviceType." + (min_version ? "Apple-Watch-38mm" : "Apple-Watch-Series-3-38mm"); - simulator_runtime = "com.apple.CoreSimulator.SimRuntime.watchOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSSimulator : Xamarin.SdkVersions.WatchOS).Replace ('.', '-'); + simulator_runtime = "com.apple.CoreSimulator.SimRuntime.watchOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSSimulator : Xamarin.SdkVersions.MaxWatchOSSimulator).Replace ('.', '-'); companion_devicetype = "com.apple.CoreSimulator.SimDeviceType." + (min_version ? "iPhone-6" : "iPhone-X"); - companion_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSCompanionSimulator : Xamarin.SdkVersions.iOS).Replace ('.', '-'); + companion_runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + (min_version ? Xamarin.SdkVersions.MinWatchOSCompanionSimulator : Xamarin.SdkVersions.MaxWatchOSCompanionSimulator).Replace ('.', '-'); break; default: throw new Exception (string.Format ("Unknown simulator target: {0}", target)); diff --git a/tools/common/Make.common b/tools/common/Make.common index fefe3d3536..b039ee4b18 100644 --- a/tools/common/Make.common +++ b/tools/common/Make.common @@ -8,6 +8,10 @@ SdkVersions.cs: ../common/SdkVersions.cs.in Makefile $(TOP)/Make.config -e 's/@MIN_WATCHOS_SIMULATOR_VERSION@/$(MIN_WATCHOS_SIMULATOR_VERSION)/' \ -e 's/@MIN_WATCHOS_COMPANION_SIMULATOR_VERSION@/$(MIN_WATCHOS_COMPANION_SIMULATOR_VERSION)/' \ -e 's/@MIN_TVOS_SIMULATOR_VERSION@/$(MIN_TVOS_SIMULATOR_VERSION)/' \ + -e "s/@MAX_IOS_VERSION@/$(MAX_IOS_VERSION)/g" \ + -e "s/@MAX_MACOS_VERSION@/$(MAX_MACOS_VERSION)/g" \ + -e "s/@MAX_WATCH_VERSION@/$(MAX_WATCH_VERSION)/g" \ + -e "s/@MAX_TVOS_VERSION@/$(MAX_TVOS_VERSION)/g" \ $< > $@ diff --git a/tools/common/SdkVersions.cs.in b/tools/common/SdkVersions.cs.in index 910f7665b9..83663190b0 100644 --- a/tools/common/SdkVersions.cs.in +++ b/tools/common/SdkVersions.cs.in @@ -27,6 +27,11 @@ namespace Xamarin { public const string MinWatchOSCompanionSimulator = "@MIN_WATCHOS_COMPANION_SIMULATOR_VERSION@"; public const string MinTVOSSimulator = "@MIN_TVOS_SIMULATOR_VERSION@"; + public const string MaxiOSSimulator = "@MAX_IOS_VERSION@"; + public const string MaxWatchOSSimulator = "@MAX_WATCH_VERSION@"; + public const string MaxWatchOSCompanionSimulator = "@MAX_IOS_VERSION@"; + public const string MaxTVOSSimulator = "@MAX_TVOS_VERSION@"; + public static Version OSXVersion { get { return new Version (OSX); }} public static Version iOSVersion { get { return new Version (iOS); }} public static Version WatchOSVersion { get { return new Version (WatchOS); }} @@ -39,9 +44,14 @@ namespace Xamarin { public static Version MiniOSSimulatorVersion { get { return new Version (MiniOSSimulator); }} public static Version MinWatchOSSimulatorVersion { get { return new Version (MinWatchOSSimulator); }} - public static Version MinWatchOSCompanionSimulatorVersion { get { return new Version (MinWatchOSSimulator); }} + public static Version MinWatchOSCompanionSimulatorVersion { get { return new Version (MinWatchOSCompanionSimulator); }} public static Version MinTVOSSimulatorVersion { get { return new Version (MinTVOSSimulator); }} + public static Version MaxiOSSimulatorVersion { get { return new Version (MaxiOSSimulator); }} + public static Version MaxWatchOSSimulatorVersion { get { return new Version (MaxWatchOSSimulator); }} + public static Version MaxWatchOSCompanionSimulatorVersion { get { return new Version (MaxWatchOSCompanionSimulator); }} + public static Version MaxTVOSSimulatorVersion { get { return new Version (MaxTVOSSimulator); }} + public static Version XcodeVersion { get { return new Version (Xcode); }} #if MTOUCH || MMP From f7212e7dc5cd66dd3b99cd701d42d977e80b3984 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 20 Nov 2019 13:45:01 -0500 Subject: [PATCH 38/55] [introspection] UIMenuController's default ctor stopped working in iOS 13.3. Fixes xamarin/maccore#2067. (#7458) * [introspection] UIMenuController's default ctor stopped working in iOS 13.3. Fixes xamarin/maccore#2067. Fixes https://github.com/xamarin/maccore/issues/2067. * [tests] Add support for comparing 3-part system version strings to watchOS. --- src/ObjCRuntime/Runtime.cs | 24 +++++++++++++++- src/WatchKit/WKInterfaceDevice.cs | 5 ++++ tests/common/TestRuntime.cs | 28 +++++++++++++++++++ tests/introspection/iOS/iOSApiCtorInitTest.cs | 2 ++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 363149ffff..17fdd4fa3f 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -1595,8 +1595,14 @@ namespace ObjCRuntime { static int MajorVersion = -1; static int MinorVersion = -1; + static int BuildVersion = -1; internal static bool CheckSystemVersion (int major, int minor, string systemVersion) + { + return CheckSystemVersion (major, minor, 0, systemVersion); + } + + internal static bool CheckSystemVersion (int major, int minor, int build, string systemVersion) { if (MajorVersion == -1) { string[] version = systemVersion.Split (new char[] { '.' }); @@ -1606,9 +1612,25 @@ namespace ObjCRuntime { if (version.Length < 2 || !int.TryParse (version[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out MinorVersion)) MinorVersion = 0; + + if (version.Length < 3 || !int.TryParse (version[2], NumberStyles.Integer, CultureInfo.InvariantCulture, out BuildVersion)) + BuildVersion = 0; } - return MajorVersion > major || (MajorVersion == major && MinorVersion >= minor); + if (MajorVersion > major) + return true; + else if (MajorVersion < major) + return false; + + if (MinorVersion > minor) + return true; + else if (MinorVersion < minor) + return false; + + if (BuildVersion < build) + return false; + + return true; } internal static IntPtr CloneMemory (IntPtr source, nint length) diff --git a/src/WatchKit/WKInterfaceDevice.cs b/src/WatchKit/WKInterfaceDevice.cs index 4b3a92a6dd..a153781fdd 100644 --- a/src/WatchKit/WKInterfaceDevice.cs +++ b/src/WatchKit/WKInterfaceDevice.cs @@ -31,6 +31,11 @@ namespace WatchKit { { return Runtime.CheckSystemVersion (major, minor, SystemVersion); } + + public bool CheckSystemVersion (int major, int minor, int build) + { + return Runtime.CheckSystemVersion (major, minor, build, SystemVersion); + } } } diff --git a/tests/common/TestRuntime.cs b/tests/common/TestRuntime.cs index dba5f01ba9..460891a402 100644 --- a/tests/common/TestRuntime.cs +++ b/tests/common/TestRuntime.cs @@ -259,6 +259,18 @@ partial class TestRuntime return CheckMacSystemVersion (10, 15, 1); #else throw new NotImplementedException (); +#endif + case 3: +#if __WATCHOS__ + return CheckWatchOSSystemVersion (6, 1, 1); +#elif __TVOS__ + return ChecktvOSSystemVersion (13, 3); +#elif __IOS__ + return CheckiOSSystemVersion (13, 3); +#elif MONOMAC + return CheckMacSystemVersion (10, 15, 2); +#else + throw new NotImplementedException (); #endif default: throw new NotImplementedException (); @@ -644,6 +656,22 @@ partial class TestRuntime #endif } + // This method returns true if: + // system version >= specified version + // AND + // sdk version >= specified version + static bool CheckWatchOSSystemVersion (int major, int minor, int build, bool throwIfOtherPlatform = true) + { +#if __WATCHOS__ + return WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (major, minor, build); +#else + if (throwIfOtherPlatform) + throw new Exception ("Can't get watchOS System version on iOS/tvOS."); + // This is both iOS and tvOS + return true; +#endif + } + static void AssertWatchOSSystemVersion (int major, int minor, bool throwIfOtherPlatform = true) { if (CheckWatchOSSystemVersion (major, minor, throwIfOtherPlatform)) diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 5a5e0f7a71..5a6f1aed4e 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -239,6 +239,8 @@ namespace Introspection { return Runtime.Arch == Arch.SIMULATOR; case "AVAudioRecorder": // Stopped working with Xcode 11.2 beta 2 return TestRuntime.CheckXcodeVersion (11, 2); + case "UIMenuController": // Stopped working with Xcode 11.3 beta 1 + return TestRuntime.CheckXcodeVersion (11, 3); default: return base.Skip (type); } From 88dc8642f0061710ca9001adbe4ca5fad8c7efd9 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 22 Nov 2019 16:34:30 +0100 Subject: [PATCH 39/55] [xcode11.3] [Tests] Update tests.sln to include all the BCL tests. (#7482) Update the UUIDs of the projects to ensure that they are all present in the sln for developers to use. Fixes: https://github.com/xamarin/xamarin-macios/issues/7475 FIxes: https://github.com/xamarin/xamarin-macios/issues/7476 --- tests/tests.sln | 214 ++++++++++++++++++++++++++---------------------- 1 file changed, 115 insertions(+), 99 deletions(-) diff --git a/tests/tests.sln b/tests/tests.sln index 432cd1b00c..9c9981a2a1 100644 --- a/tests/tests.sln +++ b/tests/tests.sln @@ -17,18 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bindings-framework-test", " EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "fsharplibrary", "fsharplibrary\fsharplibrary.fsproj", "{C7212169-BA46-413B-91CD-A32C52AD5E0D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib", "bcl-test\mscorlib\mscorlib.csproj", "{34CB1751-E445-4E32-BFA7-03E6831C11EE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data", "bcl-test\System.Data\System.Data.csproj", "{BEF0140A-A6A6-4074-B55F-03856A6B5862}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http", "bcl-test\System.Net.Http\System.Net.Http.csproj", "{D7212E3D-CD1B-4E58-A11D-C7B7898168AA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Services", "bcl-test\System.Web.Services\System.Web.Services.csproj", "{DA061019-04C3-4221-AF04-63F2BFB5DA42}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Xml", "bcl-test\System.Xml\System.Xml.csproj", "{93268FFB-571C-4402-8899-027A7778D2C0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Data.Sqlite", "bcl-test\Mono.Data.Sqlite\Mono.Data.Sqlite.csproj", "{1ADF4F27-7610-4501-A62E-1157273AED7E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "introspection-ios", "introspection\iOS\introspection-ios.csproj", "{208744BD-504E-47D7-9A98-1CF02454A6DA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dont link", "linker\ios\dont link\dont link.csproj", "{839212D5-C25B-4284-AA96-59C3872B8184}" @@ -41,83 +29,21 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoTouch.NUnitLite", "..\s EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mtouch", "mtouch\mtouch.csproj", "{9A1177F5-16E6-45DE-AA69-DC9924EC39B8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib-0", "bcl-test\mscorlib\mscorlib-0.csproj", "{6F47C092-2F85-43D6-1111-E687426F6BF3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib-1", "bcl-test\mscorlib\mscorlib-1.csproj", "{6F47C092-2F85-43D6-2222-E687426F6BF3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testgenerator", "test-libraries\testgenerator.csproj", "{CD430449-8E59-4ECD-ADD9-ACF79E9E660B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXunit", "bcl-test\BCLTests\SystemXunit.csproj", "{3A835432-B054-32FD-07CB-F9A8FFCFB44D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampletester", "sampletester\sampletester.csproj", "{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXmlXunit", "bcl-test\BCLTests\SystemXmlXunit.csproj", "{E5B0BF8F-128E-8C1F-5A10-99D26AA71E76}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mscorlib", "bcl-test\mscorlib.csproj", "{8DE7D61C-03C1-AF93-F83A-30F620EB2229}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXmlTests", "bcl-test\BCLTests\SystemXmlTests.csproj", "{387EAD7C-3E00-6BEC-8914-586A0BE31907}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 1", "bcl-test\BCL tests group 1.csproj", "{3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemXmlLinqTests", "bcl-test\BCLTests\SystemXmlLinqTests.csproj", "{274328F1-9A35-ED63-A95C-D995076011DA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 2", "bcl-test\BCL tests group 2.csproj", "{CB005E01-C7E1-7045-FCEF-C82DC9A35A49}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemWebServicesTests", "bcl-test\BCLTests\SystemWebServicesTests.csproj", "{36263A92-DACE-4BB0-063E-CD7107CF788A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 3", "bcl-test\BCL tests group 3.csproj", "{03953BD6-975D-9196-D46E-402AED4663EC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemTransactionsTests", "bcl-test\BCLTests\SystemTransactionsTests.csproj", "{F8CFE6AE-81B3-C1D5-B6E3-881EFB19D8B6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 4", "bcl-test\BCL tests group 4.csproj", "{96EB9D05-2635-0FB3-43F9-9B74640CFE18}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemTests", "bcl-test\BCLTests\SystemTests.csproj", "{022B4AF2-F62F-8EF3-9375-7CCE2820C54C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemServiceModelWebTests", "bcl-test\BCLTests\SystemServiceModelWebTests.csproj", "{ECFE62D9-1BC5-C44F-4D47-9BBA5B2C7F36}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemServiceModelTests", "bcl-test\BCLTests\SystemServiceModelTests.csproj", "{569FFC00-3699-63C0-E0B7-9C2DA8F015D9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemSecurityXunit", "bcl-test\BCLTests\SystemSecurityXunit.csproj", "{7017DF4C-80ED-A7C3-7D44-F3A9CA5B4DF4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemSecurityTests", "bcl-test\BCLTests\SystemSecurityTests.csproj", "{ABACCDE0-14CC-8C9F-7044-CE101CA9D818}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeSerializationXunit", "bcl-test\BCLTests\SystemRuntimeSerializationXunit.csproj", "{E44B6A87-C5AF-DF76-B514-841F9DF59CDF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeSerializationTests", "bcl-test\BCLTests\SystemRuntimeSerializationTests.csproj", "{E76564D2-12A8-219F-F69C-6FE35B8BCDFC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeCompilerServicesUnsafeXunit", "bcl-test\BCLTests\SystemRuntimeCompilerServicesUnsafeXunit.csproj", "{3D2B8C63-52B0-C706-B745-95453F8B90D3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemNumericsXunit", "bcl-test\BCLTests\SystemNumericsXunit.csproj", "{0477B067-9914-2C4F-14C4-CBDFDC0653CF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemNumericsTests", "bcl-test\BCLTests\SystemNumericsTests.csproj", "{44F02498-1AF8-CB2B-5F52-83C74B4F8F9F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemNetHttpTests", "bcl-test\BCLTests\SystemNetHttpTests.csproj", "{0D2AC6C4-5EC1-0927-876B-0658DEC4FF94}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemLinqXunit", "bcl-test\BCLTests\SystemLinqXunit.csproj", "{C63F3DD4-EC06-1CE5-BA87-1D038C5A0BBD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemJsonXunit", "bcl-test\BCLTests\SystemJsonXunit.csproj", "{797B6029-DEFB-CEA8-B5D3-BDA6E5EC7B35}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemJsonTests", "bcl-test\BCLTests\SystemJsonTests.csproj", "{5A2B9BB6-B845-92E1-B036-677BECEABD46}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemIOCompressionTests", "bcl-test\BCLTests\SystemIOCompressionTests.csproj", "{ADF8645F-3737-8342-704B-006A887760CF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemIOCompressionFileSystemTests", "bcl-test\BCLTests\SystemIOCompressionFileSystemTests.csproj", "{CDD9B9BA-6E8C-CE0F-DF98-F198484EDAC6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemDataXunit", "bcl-test\BCLTests\SystemDataXunit.csproj", "{0E046C2E-0261-F92B-20AB-8E27CDC8F859}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemDataTests", "bcl-test\BCLTests\SystemDataTests.csproj", "{CB000449-11E5-37D7-C757-4180FA74275D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCoreXunit", "bcl-test\BCLTests\SystemCoreXunit.csproj", "{FB0374D9-4A15-4F14-BC79-A88406FC4966}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCoreTests", "bcl-test\BCLTests\SystemCoreTests.csproj", "{D348AA85-B644-2187-C237-34DA88BFCA77}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemComponentModelDataAnnotationsTests", "bcl-test\BCLTests\SystemComponentModelDataAnnotationsTests.csproj", "{2FD12269-09D5-AD2C-9E59-6A18FCB2241F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemComponentModelCompositionXunit", "bcl-test\BCLTests\SystemComponentModelCompositionXunit.csproj", "{D4AF3416-BC36-1522-41E9-43C85DB18D84}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoSecurityTests", "bcl-test\BCLTests\MonoSecurityTests.csproj", "{BA08B246-1AE4-F419-926F-2EA9ED5DAF90}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDataTdsTests", "bcl-test\BCLTests\MonoDataTdsTests.csproj", "{EA3885C2-6A88-1007-BE44-29E6997B9856}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDataSqliteTests", "bcl-test\BCLTests\MonoDataSqliteTests.csproj", "{C761790B-0C12-72AA-D4E3-671F2AA1719E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoCSharpTests", "bcl-test\BCLTests\MonoCSharpTests.csproj", "{01D5D6F0-C210-0165-D4AC-85B038CCC1D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicrosoftCSharpXunit", "bcl-test\BCLTests\MicrosoftCSharpXunit.csproj", "{89B53407-2C05-975F-A09F-F131D5312DAA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorlibXunit", "bcl-test\BCLTests\CorlibXunit.csproj", "{A823F088-0836-20BB-D955-8B26BD9057BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorlibTests", "bcl-test\BCLTests\CorlibTests.csproj", "{3D440BA8-29F8-EB17-6858-209114E79FD3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampletester", "sampletester\sampletester.csproj", "{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCL tests group 6", "bcl-test\BCL tests group 6.csproj", "{A47E9448-F269-CE74-8539-EF920B6F0836}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -328,24 +254,114 @@ Global {C7212169-BA46-413B-91CD-A32C52AD5E0D}.Release32|iPhone.Build.0 = Release|Any CPU {C7212169-BA46-413B-91CD-A32C52AD5E0D}.Release64|iPhone.ActiveCfg = Release|Any CPU {C7212169-BA46-413B-91CD-A32C52AD5E0D}.Release64|iPhone.Build.0 = Release|Any CPU - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhone.ActiveCfg = Debug|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhone.Build.0 = Debug|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhone.ActiveCfg = Release|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhone.Build.0 = Release|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug32|iPhone.ActiveCfg = Debug32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug64|iPhone.ActiveCfg = Debug64|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug32|iPhone.Build.0 = Debug32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Debug64|iPhone.Build.0 = Debug64|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release32|iPhone.ActiveCfg = Release32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release32|iPhone.Build.0 = Release32|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release64|iPhone.ActiveCfg = Release64|iPhone - {34CB1751-E445-4E32-BFA7-03E6831C11EE}.Release64|iPhone.Build.0 = Release64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhone.ActiveCfg = Debug|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhone.Build.0 = Debug|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhone.ActiveCfg = Release|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhone.Build.0 = Release|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug32|iPhone.Build.0 = Debug32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Debug64|iPhone.Build.0 = Debug64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release32|iPhone.ActiveCfg = Release32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release32|iPhone.Build.0 = Release32|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release64|iPhone.ActiveCfg = Release64|iPhone + {8DE7D61C-03C1-AF93-F83A-30F620EB2229}.Release64|iPhone.Build.0 = Release64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhone.ActiveCfg = Debug|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhone.Build.0 = Debug|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhone.ActiveCfg = Release|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhone.Build.0 = Release|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug32|iPhone.Build.0 = Debug32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Debug64|iPhone.Build.0 = Debug64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release32|iPhone.ActiveCfg = Release32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release32|iPhone.Build.0 = Release32|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release64|iPhone.ActiveCfg = Release64|iPhone + {3DACCAFC-72B5-4092-A7E6-95777B9FF2BB}.Release64|iPhone.Build.0 = Release64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhone.ActiveCfg = Debug|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhone.Build.0 = Debug|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhone.ActiveCfg = Release|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhone.Build.0 = Release|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {03953BD6-975D-9196-D46E-402AED4663EC}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug32|iPhone.Build.0 = Debug32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Debug64|iPhone.Build.0 = Debug64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release32|iPhone.ActiveCfg = Release32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release32|iPhone.Build.0 = Release32|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release64|iPhone.ActiveCfg = Release64|iPhone + {03953BD6-975D-9196-D46E-402AED4663EC}.Release64|iPhone.Build.0 = Release64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhone.ActiveCfg = Debug|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhone.Build.0 = Debug|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhone.ActiveCfg = Release|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhone.Build.0 = Release|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug32|iPhone.Build.0 = Debug32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Debug64|iPhone.Build.0 = Debug64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release32|iPhone.ActiveCfg = Release32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release32|iPhone.Build.0 = Release32|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release64|iPhone.ActiveCfg = Release64|iPhone + {96EB9D05-2635-0FB3-43F9-9B74640CFE18}.Release64|iPhone.Build.0 = Release64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhone.ActiveCfg = Debug|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhone.Build.0 = Debug|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhone.ActiveCfg = Release|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhone.Build.0 = Release|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug32|iPhone.Build.0 = Debug32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Debug64|iPhone.Build.0 = Debug64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release32|iPhone.ActiveCfg = Release32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release32|iPhone.Build.0 = Release32|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release64|iPhone.ActiveCfg = Release64|iPhone + {A47E9448-F269-CE74-8539-EF920B6F0836}.Release64|iPhone.Build.0 = Release64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhone.ActiveCfg = Debug|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhone.Build.0 = Debug|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhone.ActiveCfg = Release|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhone.Build.0 = Release|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release-bitcode|iPhone.ActiveCfg = Release-bitcode|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release-bitcode|iPhone.Build.0 = Release-bitcode|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug32|iPhone.ActiveCfg = Debug32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug64|iPhone.ActiveCfg = Debug64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug32|iPhone.Build.0 = Debug32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Debug64|iPhone.Build.0 = Debug64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release32|iPhone.ActiveCfg = Release32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release32|iPhone.Build.0 = Release32|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release64|iPhone.ActiveCfg = Release64|iPhone + {CB005E01-C7E1-7045-FCEF-C82DC9A35A49}.Release64|iPhone.Build.0 = Release64|iPhone {BEF0140A-A6A6-4074-B55F-03856A6B5862}.Debug|iPhone.ActiveCfg = Debug|iPhone {BEF0140A-A6A6-4074-B55F-03856A6B5862}.Debug|iPhone.Build.0 = Debug|iPhone {BEF0140A-A6A6-4074-B55F-03856A6B5862}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator From dadf69e97e7c24da8b9a4d217cd44952d35f4063 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 22 Nov 2019 15:21:39 -0500 Subject: [PATCH 40/55] [Networking] Add missing Mac OS X APIs. (#7426) Add missing APIs and complete the bindings for Xcode 11. --- src/Network/NWEthernetChannel.cs | 193 +++++++++++++++++++++++ src/Network/NWParameters.cs | 25 +++ src/frameworks.sources | 1 + tests/xtro-sharpie/common-Network.ignore | 3 + tests/xtro-sharpie/iOS-Network.todo | 1 - tests/xtro-sharpie/macOS-Network.todo | 9 -- tests/xtro-sharpie/tvOS-Network.todo | 1 - tests/xtro-sharpie/watchOS-Network.todo | 1 - 8 files changed, 222 insertions(+), 12 deletions(-) create mode 100644 src/Network/NWEthernetChannel.cs delete mode 100644 tests/xtro-sharpie/iOS-Network.todo delete mode 100644 tests/xtro-sharpie/macOS-Network.todo delete mode 100644 tests/xtro-sharpie/tvOS-Network.todo delete mode 100644 tests/xtro-sharpie/watchOS-Network.todo diff --git a/src/Network/NWEthernetChannel.cs b/src/Network/NWEthernetChannel.cs new file mode 100644 index 0000000000..9d954e6dbe --- /dev/null +++ b/src/Network/NWEthernetChannel.cs @@ -0,0 +1,193 @@ +// +// NWEthernetChannel.cs: Bindings the Network nw_ethernet_channel_t API. +// +// Authors: +// Manuel de la Pena (mandel@microsoft.com) +// +// Copyright 2019 Microsoft +// +#if MONOMAC +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using ObjCRuntime; +using Foundation; +using CoreFoundation; + +using OS_nw_ethernet_channel=System.IntPtr; +using OS_nw_interface=System.IntPtr; +using OS_dispatch_data=System.IntPtr; + +namespace Network { + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public delegate void NWEthernetChannelReceiveDelegate (DispatchData content, ushort vlanTag, string localAddress, string remoteAddress); + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public enum NWEthernetChannelState + { + Invalid = 0, + Waiting = 1, + Preparing = 2, + Ready = 3, + Failed = 4, + Cancelled = 5, + } + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public class NWEthernetChannel : NativeObject { + + internal NWEthernetChannel (IntPtr handle, bool owns) : base (handle, owns) {} + + [DllImport (Constants.NetworkLibrary)] + static extern OS_nw_ethernet_channel nw_ethernet_channel_create (ushort ether_type, OS_nw_interface networkInterface); + + // we cannot pass an enum! As per docs in the headers: + // The custom EtherType to be used for all Ethernet frames in this channel. The + // EtherType is the two-octet field in an Ethernet frame, indicating the protocol + // encapsulated in the payload of the frame. This parameter is in little-endian + // byte order. Only custom EtherType values are supported. This parameter cannot + // be an EtherType already handled by the system, such as IPv4, IPv6, ARP, VLAN Tag, + // or 802.1x. + // + // Calling processes must hold the "com.apple.developer.networking.custom-protocol" + // entitlement. + public NWEthernetChannel (ushort ethernetType, NWInterface networkInterface) + { + if (networkInterface == null) + throw new ArgumentNullException (nameof (networkInterface)); + + InitializeHandle (nw_ethernet_channel_create (ethernetType, networkInterface.Handle)); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_start (OS_nw_ethernet_channel ethernet_channel); + + public void Start () => nw_ethernet_channel_start (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_cancel (OS_nw_ethernet_channel ethernet_channel); + + public void Cancel () => nw_ethernet_channel_cancel (GetCheckedHandle ()); + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_set_queue (OS_nw_ethernet_channel ethernet_channel, IntPtr queue); + + public void SetQueue (DispatchQueue queue) + { + if (queue == null) + throw new ArgumentNullException (nameof (queue)); + nw_ethernet_channel_set_queue (GetCheckedHandle (), queue.Handle); + } + + [DllImport (Constants.NetworkLibrary)] + static extern void nw_ethernet_channel_send (OS_nw_ethernet_channel ethernet_channel, OS_dispatch_data content, ushort vlan_tag, string remote_address, ref BlockLiteral completion); + + delegate void nw_ethernet_channel_send_completion_t (IntPtr block, IntPtr error); + static nw_ethernet_channel_send_completion_t static_SendCompletion = TrampolineSendCompletion; + + [MonoPInvokeCallback (typeof (nw_ethernet_channel_send_completion_t))] + static void TrampolineSendCompletion (IntPtr block, IntPtr error) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var err = error == IntPtr.Zero ? null : new NWError (error, owns: false); + del (err); + err?.Dispose (); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void Send (ReadOnlySpan content, ushort vlanTag, string remoteAddress, Action callback) + { + if (callback == null) + throw new ArgumentNullException (nameof (callback)); + + using (var dispatchData = DispatchData.FromByteBuffer (content.ToArray (), 0, content.Length)) { + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_SendCompletion, callback); + + try { + nw_ethernet_channel_send (GetCheckedHandle (), dispatchData.GetHandle (), vlanTag, remoteAddress, ref block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_ethernet_channel_set_receive_handler (OS_nw_ethernet_channel ethernet_channel, /* [NullAllowed] */ BlockLiteral *handler); + + delegate void nw_ethernet_channel_receive_handler_t (IntPtr block, OS_dispatch_data content, ushort vlan_tag, byte[] local_address, byte[] remote_address); + static nw_ethernet_channel_receive_handler_t static_ReceiveHandler = TrampolineReceiveHandler; + + [MonoPInvokeCallback (typeof (nw_ethernet_channel_receive_handler_t))] + static void TrampolineReceiveHandler (IntPtr block, OS_dispatch_data content, ushort vlanTag, byte[] localAddress, byte[] remoteAddress) + { + var del = BlockLiteral.GetTarget (block); + if (del != null) { + + var dispatchData = (content == IntPtr.Zero) ? null : new DispatchData (content, owns: false); + var local = (localAddress == null) ? null : Encoding.UTF8.GetString (localAddress); + var remote = (remoteAddress == null) ? null : Encoding.UTF8.GetString (remoteAddress); + + del (dispatchData, vlanTag, local, remote); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetReceiveHandler (NWEthernetChannelReceiveDelegate handler) + { + unsafe { + if (handler == null) { + nw_ethernet_channel_set_receive_handler (GetCheckedHandle (), null); + return; + } + + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_ReceiveHandler, handler); + try { + nw_ethernet_channel_set_receive_handler (GetCheckedHandle (), &block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + + [DllImport (Constants.NetworkLibrary)] + unsafe static extern void nw_ethernet_channel_set_state_changed_handler (OS_nw_ethernet_channel ethernet_channel, /* [NullAllowed] */ BlockLiteral *handler); + + delegate void nw_ethernet_channel_state_changed_handler_t (IntPtr block, NWEthernetChannelState state, IntPtr error); + static nw_ethernet_channel_state_changed_handler_t static_StateChangesHandler = TrampolineStateChangesHandler; + + [MonoPInvokeCallback (typeof (nw_ethernet_channel_state_changed_handler_t))] + static void TrampolineStateChangesHandler (IntPtr block, NWEthernetChannelState state, IntPtr error) + { + var del = BlockLiteral.GetTarget> (block); + if (del != null) { + var nwError = (error == IntPtr.Zero) ? null : new NWError (error, owns: false); + del (state, nwError); + } + } + + [BindingImpl (BindingImplOptions.Optimizable)] + public void SetStateChangesHandler (Action handler) + { + unsafe { + if (handler == null) { + nw_ethernet_channel_set_state_changed_handler (GetCheckedHandle (), null); + return; + } + BlockLiteral block_handler = new BlockLiteral (); + block_handler.SetupBlockUnsafe (static_StateChangesHandler, handler); + try { + nw_ethernet_channel_set_state_changed_handler (GetCheckedHandle (), &block_handler); + } finally { + block_handler.CleanupBlock (); + } + } + } + } +} +#endif diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index 675647032e..9fd04278b8 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -177,6 +177,31 @@ namespace Network { return new NWParameters (ptr, owns: true); } +#if MONOMAC + [NoWatch, NoTV, NoiOS, Mac (10,15)] + [DllImport (Constants.NetworkLibrary)] + unsafe static extern IntPtr nw_parameters_create_custom_ip (byte custom_ip_protocol_number, BlockLiteral *configure_ip); + + [NoWatch, NoTV, NoiOS, Mac (10,15)] + public unsafe static NWParameters CreateCustomIP (byte protocolNumber, Action configureCustomIP = null) + { + var ipHandler = new BlockLiteral (); + + var ipPtr = &ipHandler; + if (configureCustomIP == null) + ipPtr = DEFAULT_CONFIGURATION (); + else + ipHandler.SetupBlockUnsafe (static_ConfigureHandler, configureCustomIP); + + var ptr = nw_parameters_create_custom_ip (protocolNumber, ipPtr); + + if (configureCustomIP != null) + ipPtr->CleanupBlock (); + + return new NWParameters (ptr, owns: true); + } +#endif + [DllImport (Constants.NetworkLibrary)] static extern nw_parameters_t nw_parameters_create (); diff --git a/src/frameworks.sources b/src/frameworks.sources index 74b95c1bc1..eb6a668279 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1173,6 +1173,7 @@ NETWORK_SOURCES = \ Network/NWConnection.cs \ Network/NWContentContext.cs \ Network/NWDataTransferReport.cs \ + Network/NWEthernetChannel.cs \ Network/NWEstablishmentReport.cs \ Network/NWEndpoint.cs \ Network/NWError.cs \ diff --git a/tests/xtro-sharpie/common-Network.ignore b/tests/xtro-sharpie/common-Network.ignore index 52def1405c..80bef65664 100644 --- a/tests/xtro-sharpie/common-Network.ignore +++ b/tests/xtro-sharpie/common-Network.ignore @@ -32,3 +32,6 @@ ## xcode 10.0 backlog !missing-pinvoke! nw_endpoint_get_address is not bound + +## no documentation from apple. So we do nothing, specially with the _ prefix. Leak? +!missing-field! _nw_data_transfer_report_all_paths not bound diff --git a/tests/xtro-sharpie/iOS-Network.todo b/tests/xtro-sharpie/iOS-Network.todo deleted file mode 100644 index dcad7c13cc..0000000000 --- a/tests/xtro-sharpie/iOS-Network.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-Network.todo b/tests/xtro-sharpie/macOS-Network.todo deleted file mode 100644 index b40d73ad49..0000000000 --- a/tests/xtro-sharpie/macOS-Network.todo +++ /dev/null @@ -1,9 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound -!missing-pinvoke! nw_ethernet_channel_cancel is not bound -!missing-pinvoke! nw_ethernet_channel_create is not bound -!missing-pinvoke! nw_ethernet_channel_send is not bound -!missing-pinvoke! nw_ethernet_channel_set_queue is not bound -!missing-pinvoke! nw_ethernet_channel_set_receive_handler is not bound -!missing-pinvoke! nw_ethernet_channel_set_state_changed_handler is not bound -!missing-pinvoke! nw_ethernet_channel_start is not bound -!missing-pinvoke! nw_parameters_create_custom_ip is not bound diff --git a/tests/xtro-sharpie/tvOS-Network.todo b/tests/xtro-sharpie/tvOS-Network.todo deleted file mode 100644 index dcad7c13cc..0000000000 --- a/tests/xtro-sharpie/tvOS-Network.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/watchOS-Network.todo b/tests/xtro-sharpie/watchOS-Network.todo deleted file mode 100644 index f5e825a6d9..0000000000 --- a/tests/xtro-sharpie/watchOS-Network.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! _nw_data_transfer_report_all_paths not bound From fd7a5360a52b1a59dba588b3610c2fd927dd6213 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 26 Nov 2019 14:32:02 +0100 Subject: [PATCH 41/55] [xcode11.3] [linker] Do not mark NSObject subclasses from Xamarin.Forms.Platform.iOS.dll assembly (#7483) Turn older #7165 prototype into an experimental feature. It can be enabled by adding `--optimize=experimental-xforms-product-type` to the **Additional mtouch arguments** of the project. ref: https://github.com/xamarin/xamarin-macios/pull/7165 --- docs/website/optimizations.md | 14 ++++++++++++++ tests/mmptest/src/MMPTest.cs | 2 +- tests/mtouch/MTouch.cs | 5 +++-- tools/common/Optimizations.cs | 7 +++++++ tools/linker/MarkNSObjects.cs | 11 +++++++++-- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/website/optimizations.md b/docs/website/optimizations.md index 18bf371fac..07baa6bf1a 100644 --- a/docs/website/optimizations.md +++ b/docs/website/optimizations.md @@ -755,3 +755,17 @@ disabling the managed linker. The default behavior can be overridden by passing `--optimize=[+|-]custom-attributes-removal` to `mtouch` or `mmp`. + +## Experimental Xamarin.Forms.Platform.iOS ProductType inclusion + +This optimization requires the linker to be enabled and is only applied +on `Xamarin.Forms.Platform.iOS.dll`. + +This is **experimental** and might be removed or replaced in future +versions of Xamarin.iOS. + +This optimization consider the assembly `Xamarin.Forms.Platform.iOS` as +a product assembly and does not automagically mark all `NSObject` +subclasses. This allows additional removes and optimizations to be +applied to the assembly, including the ability to remove `UIWebView` if +nothing else in the application requires it. diff --git a/tests/mmptest/src/MMPTest.cs b/tests/mmptest/src/MMPTest.cs index 7ee30c153f..e6a4489351 100644 --- a/tests/mmptest/src/MMPTest.cs +++ b/tests/mmptest/src/MMPTest.cs @@ -623,7 +623,7 @@ namespace Xamarin.MMP.Tests "Full", }; var rv = TI.TestUnifiedExecutable (test, shouldFail: false); - rv.Messages.AssertWarning (132, $"Unknown optimization: '{opt}'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, trim-architectures, inline-is-arm64-calling-convention, cctor-beforefieldinit, custom-attributes-removal."); + rv.Messages.AssertWarning (132, $"Unknown optimization: '{opt}'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, trim-architectures, inline-is-arm64-calling-convention, cctor-beforefieldinit, custom-attributes-removal, experimental-xforms-product-type."); rv.Messages.AssertErrorCount (0); }); } diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index 4d5e7e04cc..232d2d79d8 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -1752,7 +1752,7 @@ public class TestApp { mtouch.Linker = MTouchLinker.LinkSdk; mtouch.Optimize = new string [] { "foo" }; mtouch.AssertExecute (MTouchAction.BuildSim, "build"); - mtouch.AssertWarning (132, "Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, inline-runtime-arch, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, remove-dynamic-registrar, remove-unsupported-il-for-bitcode, inline-is-arm64-calling-convention, seal-and-devirtualize, cctor-beforefieldinit, custom-attributes-removal."); + mtouch.AssertWarning (132, "Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, inline-runtime-arch, blockliteral-setupblock, register-protocols, inline-dynamic-registration-supported, static-block-to-delegate-lookup, remove-dynamic-registrar, remove-unsupported-il-for-bitcode, inline-is-arm64-calling-convention, seal-and-devirtualize, cctor-beforefieldinit, custom-attributes-removal, experimental-xforms-product-type."); } } @@ -3646,7 +3646,8 @@ public partial class NotificationService : UNNotificationServiceExtension mtouch.AssertWarning (2003, "Option '--optimize=seal-and-devirtualize' will be ignored since linking is disabled"); mtouch.AssertWarning (2003, "Option '--optimize=cctor-beforefieldinit' will be ignored since linking is disabled"); mtouch.AssertWarning (2003, "Option '--optimize=custom-attributes-removal' will be ignored since linking is disabled"); - mtouch.AssertWarningCount (14); + mtouch.AssertWarning (2003, "Option '--optimize=experimental-xforms-product-type' will be ignored since linking is disabled"); + mtouch.AssertWarningCount (15); } using (var mtouch = new MTouchTool ()) { diff --git a/tools/common/Optimizations.cs b/tools/common/Optimizations.cs index b1d724f4c9..d600fd250a 100644 --- a/tools/common/Optimizations.cs +++ b/tools/common/Optimizations.cs @@ -42,6 +42,7 @@ namespace Xamarin.Bundler #endif "cctor-beforefieldinit", "custom-attributes-removal", + "experimental-xforms-product-type", }; enum Opt @@ -62,6 +63,7 @@ namespace Xamarin.Bundler SealAndDevirtualize, StaticConstructorBeforeFieldInit, CustomAttributesRemoval, + ExperimentalFormsProductType, } bool? all; @@ -145,6 +147,11 @@ namespace Xamarin.Bundler set { values [(int) Opt.CustomAttributesRemoval] = value; } } + public bool? ExperimentalFormsProductType { + get { return values [(int) Opt.ExperimentalFormsProductType]; } + set { values [(int) Opt.ExperimentalFormsProductType] = value; } + } + public Optimizations () { values = new bool? [opt_names.Length]; diff --git a/tools/linker/MarkNSObjects.cs b/tools/linker/MarkNSObjects.cs index af4c10942f..0ab2fcfe82 100644 --- a/tools/linker/MarkNSObjects.cs +++ b/tools/linker/MarkNSObjects.cs @@ -33,6 +33,7 @@ using System; using Mono.Cecil; using Mono.Linker; using Mono.Tuner; +using Xamarin.Bundler; namespace Xamarin.Linker.Steps { @@ -151,9 +152,15 @@ namespace Xamarin.Linker.Steps { return (method.DeclaringType.Module.Assembly.Name.Name == ProductAssembly); } - static bool IsProductType (TypeDefinition type) + bool IsProductType (TypeDefinition type) { - return type.Module.Assembly.Name.Name == ProductAssembly; + var name = type.Module.Assembly.Name.Name; + switch (name) { + case "Xamarin.Forms.Platform.iOS": + return LinkContext.App.Optimizations.ExperimentalFormsProductType == true; + default: + return name == ProductAssembly; + } } } } From bcf3899893c0ee1a0bbcd814164a08423f0d543a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 26 Nov 2019 19:38:58 +0100 Subject: [PATCH 42/55] [generator] If forcing a managed type, we must do so even if there's another managed instance of an incompatible type. Fixes #7441. (#7460) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If forcing a managed type for a particular native handle, we must ensure we're always successful. This means creating another managed instance even if there already is an existing instance for the native handle. This is not optimal, but the alternative is worse: some functionality can be completely broken otherwise (such as NSSavePanel⁄NSOpenPanel may stop working). If creating multiple managed instances for the same native handle ends up being too problematic, we'll probably have to add full support for this scenario (see #7442). Fixes https://github.com/xamarin/xamarin-macios/issues/7441. --- src/ObjCRuntime/Runtime.cs | 12 ++++++++++-- src/generator.cs | 6 +++--- .../monotouch-test/ObjCRuntime/RuntimeTest.cs | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 17fdd4fa3f..8bd0ab9110 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -1422,6 +1422,11 @@ namespace ObjCRuntime { // this method is identical in behavior to the non-generic one. public static T GetINativeObject (IntPtr ptr, bool owns) where T : class, INativeObject + { + return GetINativeObject (ptr, false, owns); + } + + public static T GetINativeObject (IntPtr ptr, bool forced_type, bool owns) where T : class, INativeObject { if (ptr == IntPtr.Zero) return null; @@ -1433,7 +1438,10 @@ namespace ObjCRuntime { return t; } - if (o != null) { + // If forced type is true, we ignore any existing instances if the managed type of the existing instance isn't compatible with T. + // This may end up creating multiple managed wrapper instances for the same native handle, + // which is not optimal, but sometimes the alternative can be worse :/ + if (o != null && !forced_type) { // found an existing object, but with an incompatible type. if (!typeof (T).IsInterface && typeof(NSObject).IsAssignableFrom (typeof (T))) { // if the target type is another NSObject subclass, there's nothing we can do. @@ -1445,7 +1453,7 @@ namespace ObjCRuntime { var implementation = LookupINativeObjectImplementation (ptr, typeof (T)); if (implementation.IsSubclassOf (typeof (NSObject))) { - if (o != null) { + if (o != null && !forced_type) { // We already have an instance of an NSObject-subclass for this ptr. // Creating another will break the one-to-one assumption we have between // native objects and NSObject instances. diff --git a/src/generator.cs b/src/generator.cs index c665781dce..9b8eed3e1b 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -1649,7 +1649,7 @@ public partial class Generator : IMemberGatherer { if (IsProtocolInterface (pi.ParameterType)) { invoke.AppendFormat (" Runtime.GetINativeObject<{1}> ({0}, false)", pi.Name.GetSafeParamName (), pi.ParameterType); } else if (isForced) { - invoke.AppendFormat (" Runtime.GetINativeObject<{1}> ({0}, {2})", pi.Name.GetSafeParamName (), RenderType (pi.ParameterType), isForcedOwns); + invoke.AppendFormat (" Runtime.GetINativeObject<{1}> ({0}, true, {2})", pi.Name.GetSafeParamName (), RenderType (pi.ParameterType), isForcedOwns); } else { invoke.AppendFormat (" Runtime.GetNSObject<{1}> ({0})", pi.Name.GetSafeParamName (), RenderType (pi.ParameterType)); } @@ -3611,7 +3611,7 @@ public partial class Generator : IMemberGatherer { cast_b = ", false)"; } else if (minfo != null && minfo.is_forced) { cast_a = " Runtime.GetINativeObject<" + FormatType (declaringType, GetCorrectGenericType (mi.ReturnType)) + "> ("; - cast_b = $", {minfo.is_forced_owns})"; + cast_b = $", true, {minfo.is_forced_owns})"; } else if (minfo != null && minfo.is_bindAs) { var bindAs = GetBindAsAttribute (minfo.mi); var nullableBindAsType = TypeManager.GetUnderlyingNullableType (bindAs.Type); @@ -4138,7 +4138,7 @@ public partial class Generator : IMemberGatherer { } else if (isINativeObjectSubclass) { if (!pi.IsOut) by_ref_processing.AppendFormat ("if ({0}Value != ({0} == null ? IntPtr.Zero : {0}.Handle))\n\t", pi.Name.GetSafeParamName ()); - by_ref_processing.AppendFormat ("{0} = Runtime.GetINativeObject<{1}> ({0}Value, {2});\n", pi.Name.GetSafeParamName (), RenderType (elementType), isForcedType ? isForcedOwns : "false"); + by_ref_processing.AppendFormat ("{0} = Runtime.GetINativeObject<{1}> ({0}Value, {2}, {3});\n", pi.Name.GetSafeParamName (), RenderType (elementType), isForcedType ? "true" : "false", isForcedType ? isForcedOwns : "false"); } else { throw ErrorHelper.CreateError (99, $"Internal error: don't know how to create ref/out (output) code for {mai.Type} in {mi}. Please file a bug report with a test case (https://github.com/xamarin/xamarin-macios/issues/new)."); } diff --git a/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs b/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs index 124a938693..d6193148bd 100644 --- a/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs +++ b/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs @@ -699,5 +699,24 @@ Additional information: } #endif } + + [Test] + public void GetINativeObject_ForcedType () + { + using (var str = new NSString ("hello world")) { + NSDate date; + + Assert.Throws (() => Runtime.GetINativeObject (str.Handle, false), "EX1"); // + Assert.Throws (() => Runtime.GetINativeObject (str.Handle, false, false), "EX2"); // + + // Making a string quack like a date. + // This is a big hack, but hopefully it works well enough for this particular test case. + // Just don't inspect the date variable in a debugger (it will most likely crash the app). + date = Runtime.GetINativeObject (str.Handle, true, false); + Assert.AreEqual (date.Handle, str.Handle, "Same native pointer"); + date.Dispose (); + date = null; + } + } } } From 44d411b8de183a370d4b5e723b4dfe2bee65b068 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 2 Dec 2019 21:48:22 +0100 Subject: [PATCH 43/55] [xharness] Add a timeout to the periodic command. (#7504) This will hopefully prevent the periodic command from keeping xharness alive longer than it should. --- tests/xharness/Jenkins.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index c09bd12cc9..3ea5431199 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1120,14 +1120,13 @@ namespace xharness async Task ExecutePeriodicCommandAsync (Log periodic_loc) { - //await Task.Delay (Harness.UploadInterval); periodic_loc.WriteLine ($"Starting periodic task with interval {Harness.PeriodicCommandInterval.TotalMinutes} minutes."); while (true) { var watch = Stopwatch.StartNew (); using (var process = new Process ()) { process.StartInfo.FileName = Harness.PeriodicCommand; process.StartInfo.Arguments = Harness.PeriodicCommandArguments; - var rv = await process.RunAsync (periodic_loc, null); + var rv = await process.RunAsync (periodic_loc, timeout: Harness.PeriodicCommandInterval); if (!rv.Succeeded) periodic_loc.WriteLine ($"Periodic command failed with exit code {rv.ExitCode} (Timed out: {rv.TimedOut})"); } From e808ad48aa22400f93293a13845cfd980ebaff34 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 2 Dec 2019 21:54:07 +0100 Subject: [PATCH 44/55] [xharness] Make sure to always stop log and system capture. (#7506) This will hopefully stop the runaway mlaunch processes we've seen on the bots. Ref: https://github.com/xamarin/maccore/issues/1965. --- tests/xharness/AppRunner.cs | 66 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 60efb9f497..5978ab088a 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -837,45 +837,47 @@ namespace xharness }; logdev.StartCapture (); - await crash_reports.StartCaptureAsync (); + try { + await crash_reports.StartCaptureAsync (); - main_log.WriteLine ("Starting test run"); + main_log.WriteLine ("Starting test run"); - bool waitedForExit = true; - // We need to check for MT1111 (which means that mlaunch won't wait for the app to exit). - var callbackLog = new CallbackLog ((line) => { - // MT1111: Application launched successfully, but it's not possible to wait for the app to exit as requested because it's not possible to detect app termination when launching using gdbserver - waitedForExit &= line?.Contains ("MT1111: ") != true; - if (line?.Contains ("error MT1007") == true) - launch_failure = true; - }); - var runLog = Log.CreateAggregatedLog (callbackLog, main_log); - var timeoutWatch = Stopwatch.StartNew (); - var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, args.ToString (), runLog, timeout, cancellation_token: cancellation_source.Token); + bool waitedForExit = true; + // We need to check for MT1111 (which means that mlaunch won't wait for the app to exit). + var callbackLog = new CallbackLog ((line) => { + // MT1111: Application launched successfully, but it's not possible to wait for the app to exit as requested because it's not possible to detect app termination when launching using gdbserver + waitedForExit &= line?.Contains ("MT1111: ") != true; + if (line?.Contains ("error MT1007") == true) + launch_failure = true; + }); + var runLog = Log.CreateAggregatedLog (callbackLog, main_log); + var timeoutWatch = Stopwatch.StartNew (); + var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, args.ToString (), runLog, timeout, cancellation_token: cancellation_source.Token); - if (!waitedForExit && !result.TimedOut) { - // mlaunch couldn't wait for exit for some reason. Let's assume the app exits when the test listener completes. - main_log.WriteLine ("Waiting for listener to complete, since mlaunch won't tell."); - if (!await listener.CompletionTask.TimeoutAfter (timeout - timeoutWatch.Elapsed)) { - result.TimedOut = true; + if (!waitedForExit && !result.TimedOut) { + // mlaunch couldn't wait for exit for some reason. Let's assume the app exits when the test listener completes. + main_log.WriteLine ("Waiting for listener to complete, since mlaunch won't tell."); + if (!await listener.CompletionTask.TimeoutAfter (timeout - timeoutWatch.Elapsed)) { + result.TimedOut = true; + } } - } - if (result.TimedOut) { - timed_out = true; - success = false; - main_log.WriteLine ("Test run timed out after {0} minute(s).", timeout.TotalMinutes); - } else if (result.Succeeded) { - main_log.WriteLine ("Test run completed"); - success = true; - } else { - main_log.WriteLine ("Test run failed"); - success = false; + if (result.TimedOut) { + timed_out = true; + success = false; + main_log.WriteLine ("Test run timed out after {0} minute(s).", timeout.TotalMinutes); + } else if (result.Succeeded) { + main_log.WriteLine ("Test run completed"); + success = true; + } else { + main_log.WriteLine ("Test run failed"); + success = false; + } + } finally { + logdev.StopCapture (); + device_system_log.Dispose (); } - logdev.StopCapture (); - device_system_log.Dispose (); - // Upload the system log if (File.Exists (device_system_log.FullPath)) { main_log.WriteLine ("A capture of the device log is: {0}", device_system_log.FullPath); From 2c02cf7a038bb1f584847b540ee22056eae48533 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 2 Dec 2019 21:54:26 +0100 Subject: [PATCH 45/55] [xcode11.3] Bump macios-binaries to get fix for xamarin/maccore#2068. (#7512) * Bump macios-binaries to get fix for xamarin/maccore#2068. New commits in xamarin/macios-binaries: * xamarin/macios-binaries@eb6980e Bump mlaunch to xamarin/maccore@92433b7757 (#28) Diff: https://github.com/xamarin/macios-binaries/compare/6f488dd1322706a319c674ac35a4988c3f6ea89e..eb6980e8b6ee7bcd6edfd514e606b664bd93f33d * Update submodule branch for macios-binaries. --- .gitmodules | 2 +- external/macios-binaries | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index ffa97de533..656f6c196e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,7 +4,7 @@ [submodule "external/macios-binaries"] path = external/macios-binaries url = ../../xamarin/macios-binaries - branch = d16-4 + branch = xcode11.3 [submodule "external/opentk"] path = external/opentk url = ../../mono/opentk.git diff --git a/external/macios-binaries b/external/macios-binaries index 6f488dd132..eb6980e8b6 160000 --- a/external/macios-binaries +++ b/external/macios-binaries @@ -1 +1 @@ -Subproject commit 6f488dd1322706a319c674ac35a4988c3f6ea89e +Subproject commit eb6980e8b6ee7bcd6edfd514e606b664bd93f33d From 74a94c35d101a803540fb1518ccc20ee17b19aee Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 2 Dec 2019 21:54:33 +0100 Subject: [PATCH 46/55] [monotouch-test] Make NetworkReachabilityTest.CtorIPAddressPair a bit more permissive. Fixes xamarin/maccore#2047. (#7521) Try to fix https://github.com/xamarin/maccore/issues/2047 by making the test accept NetworkReachabilityFlags.Reachable for the loopback address on device. Fixes https://github.com/xamarin/maccore/issues/2047. --- .../SystemConfiguration/NetworkReachabilityTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs index 0bbeaf1ce3..19dee2b289 100644 --- a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs +++ b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs @@ -101,9 +101,10 @@ namespace MonoTouchFixtures.SystemConfiguration { Assert.IsTrue (nr.TryGetFlags (out flags), "#1"); // using Loopback iOS 10 / tvOS 10 returns no flags (0) on devices + // but only sometimes... so check for Reachable as well (as a flag). #if !MONOMAC if ((Runtime.Arch == Arch.DEVICE) && TestRuntime.CheckXcodeVersion (8, 0)) - Assert.That ((int)flags, Is.EqualTo (0), "#1 Reachable"); + Assert.That ((flags == (NetworkReachabilityFlags) 0) || ((flags & NetworkReachabilityFlags.Reachable) == NetworkReachabilityFlags.Reachable) , $"#1 Reachable: {flags.ToString ()}"); else #endif Assert.That (flags, Is.EqualTo (NetworkReachabilityFlags.Reachable), "#1 Reachable"); From 917041448ecb1387068c6db0e7fea9f0ff3088fd Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 4 Dec 2019 10:38:01 -0500 Subject: [PATCH 47/55] Bump mono to HEAD of 2019-08 (#7538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New commits in mono/mono: * mono/mono@bef1e633581 [interp] track valuetype stack for CEE_RET too (#17998) * mono/mono@56325f4097f [arm] if mtriple is provided, do not set -march * mono/mono@c4a1b40fbda [2019-08] [runtime] Treat calling a non-virtual method through… (#17961) * mono/mono@0c9250280da [2019-08] bump msbuild+roslyn to track mono-2019-08 (#17954) * mono/mono@14aac0c541c Bump msbuild to track mono-2019-08 (#17854) * mono/mono@a77128ca793 [merp] Remove extraneous waitpid invocation (#17762) * mono/mono@296a9afdb24 [MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild (#17786) * mono/mono@e59c3fbb688 Bump msbuild packages to 1e1d0f2caad3731357cca18b298536e514f5519b (#17724) Diff: https://github.com/mono/mono/compare/062f0ab8cae60d1d347e4d722884c065c9f34484..bef1e6335812d32f8eab648c0228fc624b9f8357 --- mk/mono.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/mono.mk b/mk/mono.mk index b6818f60c5..fa8330f7d5 100644 --- a/mk/mono.mk +++ b/mk/mono.mk @@ -1,4 +1,4 @@ -NEEDED_MONO_VERSION := 062f0ab8cae60d1d347e4d722884c065c9f34484 +NEEDED_MONO_VERSION := bef1e6335812d32f8eab648c0228fc624b9f8357 NEEDED_MONO_BRANCH := 2019-08 MONO_DIRECTORY := mono From 8abcd9c60c4c3ba702f5f8f31b3ba5ec9a2b9ec8 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 4 Dec 2019 11:41:29 -0500 Subject: [PATCH 48/55] [Network] Add missing BindingImplAttr. (#7530) Fixes: https://github.com/xamarin/xamarin-macios/issues/7513 --- src/Network/NWParameters.cs | 1 + tests/monotouch-test/Network/NWParametersTest.cs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index 9fd04278b8..bd8b3d8f05 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -183,6 +183,7 @@ namespace Network { unsafe static extern IntPtr nw_parameters_create_custom_ip (byte custom_ip_protocol_number, BlockLiteral *configure_ip); [NoWatch, NoTV, NoiOS, Mac (10,15)] + [BindingImpl (BindingImplOptions.Optimizable)] public unsafe static NWParameters CreateCustomIP (byte protocolNumber, Action configureCustomIP = null) { var ipHandler = new BlockLiteral (); diff --git a/tests/monotouch-test/Network/NWParametersTest.cs b/tests/monotouch-test/Network/NWParametersTest.cs index 1cdc251c04..aeb1246bc8 100644 --- a/tests/monotouch-test/Network/NWParametersTest.cs +++ b/tests/monotouch-test/Network/NWParametersTest.cs @@ -199,6 +199,21 @@ namespace MonoTouchFixtures.Network { } } +#if MONOMAC + [Test] + public void CreateCustomIP () + { + TestRuntime.AssertXcodeVersion (11, 0); + byte ipVersion = 10; + var setUpProtocol = CreateConfigureProtocolHandler (); + using (var parameters = NWParameters.CreateCustomIP (ipVersion, setUpProtocol)) + using (var endpoint = NWEndpoint.Create ("wwww.google.com", "80")) { + configureEvent.WaitOne (); + Assert.True (protocolConfigured, "Protocol configure handler was not called."); + } + } +#endif + [Test] public void MultiPathServicePropertyTest () { From 0d8fe219c727fc68d495c26823070b510a4aa474 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 4 Dec 2019 12:59:57 -0500 Subject: [PATCH 49/55] Bump version number for d16.4 service release 1 (#7543) --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index 64a3fd2b88..07daee226b 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.8.2.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.8.2.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.8.3.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.8.3.$(MAC_COMMIT_DISTANCE) From 889705c2ee10f668ff00492ca14e40ad338f6d5a Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 11 Dec 2019 03:11:17 -0500 Subject: [PATCH 50/55] Bump for Xcode 11.3 final (#7568) --- Make.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.config b/Make.config index 4df0124126..a4720b3fa7 100644 --- a/Make.config +++ b/Make.config @@ -60,8 +60,8 @@ IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_M # Xcode version should have both a major and a minor version (even if the minor version is 0) XCODE_VERSION=11.3 -XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.3_beta.xip -XCODE_DEVELOPER_ROOT=/Applications/Xcode113-beta1.app/Contents/Developer +XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_11.3.xip +XCODE_DEVELOPER_ROOT=/Applications/Xcode113.app/Contents/Developer XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist) # Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk From fc51536ced1be955a019a3dd698499fcf6aae5fe Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Wed, 11 Dec 2019 12:31:55 -0500 Subject: [PATCH 51/55] [xcode11.3] Bump version number now that Xcode 11.3 is out (#7573) --- Make.versions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.versions b/Make.versions index e3e852e1e2..bb1921e826 100644 --- a/Make.versions +++ b/Make.versions @@ -43,5 +43,5 @@ # line changed in git). # -IOS_PACKAGE_VERSION=13.9.0.$(IOS_COMMIT_DISTANCE) -MAC_PACKAGE_VERSION=6.9.0.$(MAC_COMMIT_DISTANCE) +IOS_PACKAGE_VERSION=13.10.0.$(IOS_COMMIT_DISTANCE) +MAC_PACKAGE_VERSION=6.10.0.$(MAC_COMMIT_DISTANCE) From b0f99834b94cb8d9323e6fe81eacf2d010f8c66b Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 12 Dec 2019 22:31:59 +0100 Subject: [PATCH 52/55] [runtime] Don't zero-terminate after the string buffer. Fixes #7564. (#7585) Fixes https://github.com/xamarin/xamarin-macios/issues/7564. --- runtime/trampolines.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/trampolines.m b/runtime/trampolines.m index cc3ffc8795..043589b88e 100644 --- a/runtime/trampolines.m +++ b/runtime/trampolines.m @@ -440,6 +440,12 @@ xamarin_collapse_struct_name (const char *type, char struct_name[], int max_char type++; } + if (c == max_char) { + LOGZ (" xamarin_collapse_struct_name (%s, %i) => failed (too long)!\n", input, max_char); + struct_name [0] = 0; // return an empty string + return false; + } + struct_name [c] = 0; // Zero-terminate. LOGZ (" xamarin_collapse_struct_name (%s, %i) => %s (succeeded)\n", input, max_char, struct_name); return true; From 380ad56e4d46ab82c2df47b0cd6c73e830cce85a Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 13 Dec 2019 16:22:16 +0100 Subject: [PATCH 53/55] [introspection] Update according to changes that seem to have occurred in macOS 10.15.2. (#7592) --- tests/introspection/Mac/MacApiCtorInitTest.cs | 3 +++ tests/introspection/Mac/MacApiProtocolTest.cs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tests/introspection/Mac/MacApiCtorInitTest.cs b/tests/introspection/Mac/MacApiCtorInitTest.cs index 0984a6801f..55b781d633 100644 --- a/tests/introspection/Mac/MacApiCtorInitTest.cs +++ b/tests/introspection/Mac/MacApiCtorInitTest.cs @@ -206,6 +206,9 @@ namespace Introspection { due to a privacy violation (even if the required entry is present in the Info.plist). */ return true; + case "AVFoundation.AVAudioRecorder": // Stopped working in macOS 10.15.2 + return TestRuntime.CheckXcodeVersion (11, 2); + } switch (type.Namespace) { diff --git a/tests/introspection/Mac/MacApiProtocolTest.cs b/tests/introspection/Mac/MacApiProtocolTest.cs index 1341f9fb61..3d7acbea4b 100644 --- a/tests/introspection/Mac/MacApiProtocolTest.cs +++ b/tests/introspection/Mac/MacApiProtocolTest.cs @@ -86,6 +86,10 @@ namespace Introspection { case "NSFileProviderDomain": // Conformance not in headers case "FPUIActionExtensionContext": // Conformance not in headers return true; + // macOS 10.15.2 + case "NSPrintInfo": // Conformance not in headers + case "NSPrinter": // Conformance not in headers + return true; #if !UNIFIED // existing classic/old binary is not updated case "NSAppearance": From a6c714fa8406aa753caa79fe7a8166da53479663 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 17 Dec 2019 22:07:22 +0100 Subject: [PATCH 54/55] [xcode11.3] [monotouch-test] Simplify NetworkReachabilityTest.CtorIPAddressPair test. (#7613) * [monotouch-test] Improve reachability test. Tested on: * All macOS versions we support (10.9 -> 10.15). * tvOS device: 13.2 * iOS devices: 8.2, 9.3.5, 10.3.3, 11.4.1, 12.4.1, 13.3 * iOS simulators: 10.3, 11.0, 12.0, 13.2. * tvOS simulators: 10.2, 13.2 * Yay Apple! * Give up. * Revert unneeded change. --- .../NetworkReachabilityTest.cs | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs index 19dee2b289..3815982e8c 100644 --- a/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs +++ b/tests/monotouch-test/SystemConfiguration/NetworkReachabilityTest.cs @@ -100,14 +100,7 @@ namespace MonoTouchFixtures.SystemConfiguration { NetworkReachabilityFlags flags; Assert.IsTrue (nr.TryGetFlags (out flags), "#1"); - // using Loopback iOS 10 / tvOS 10 returns no flags (0) on devices - // but only sometimes... so check for Reachable as well (as a flag). -#if !MONOMAC - if ((Runtime.Arch == Arch.DEVICE) && TestRuntime.CheckXcodeVersion (8, 0)) - Assert.That ((flags == (NetworkReachabilityFlags) 0) || ((flags & NetworkReachabilityFlags.Reachable) == NetworkReachabilityFlags.Reachable) , $"#1 Reachable: {flags.ToString ()}"); - else -#endif - Assert.That (flags, Is.EqualTo (NetworkReachabilityFlags.Reachable), "#1 Reachable"); + CheckLoopbackFlags (flags, "1", true); } using (var nr = new NetworkReachability (null, address)) @@ -123,27 +116,22 @@ namespace MonoTouchFixtures.SystemConfiguration { NetworkReachabilityFlags flags; Assert.IsTrue (nr.TryGetFlags (out flags), "#3"); - // using Loopback iOS 10 / tvOS 10 / macOS 10.12 returns no flags (0) on devices - var expected = (NetworkReachabilityFlags) 0; -#if MONOMAC - if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 12)) { - expected = NetworkReachabilityFlags.Reachable; - if (!TestRuntime.CheckSystemVersion (PlatformName.MacOSX, 10, 11)) - expected |= NetworkReachabilityFlags.IsLocalAddress; - } -#else - if ((Runtime.Arch == Arch.DEVICE) && TestRuntime.CheckXcodeVersion (8, 0)) { - // - } else { - expected = NetworkReachabilityFlags.Reachable; - if (!TestRuntime.CheckXcodeVersion (7, 0)) - expected |= NetworkReachabilityFlags.IsLocalAddress; - } -#endif - Assert.That (flags, Is.EqualTo (expected), "#3 Reachable"); + CheckLoopbackFlags (flags, "3", false); } } + void CheckLoopbackFlags (NetworkReachabilityFlags flags, string number, bool has_address) + { + var noFlags = (NetworkReachabilityFlags) 0; + var otherFlags = (flags & ~(NetworkReachabilityFlags.Reachable | NetworkReachabilityFlags.IsLocalAddress | NetworkReachabilityFlags.IsDirect)); + + // Different versions of OSes report different flags. Trying to + // figure out which OS versions have which flags set turned out to + // be a never-ending game of whack-a-mole, so just don't assert + // that any specific flags are set. + Assert.AreEqual (noFlags, otherFlags, $"#{number} No other flags: {flags.ToString ()}"); + } + [Test] public void Ctor_Invalid () { From aaafa2df6f6449caf0672b20e289cd1d809a9da7 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 17 Dec 2019 23:04:00 +0100 Subject: [PATCH 55/55] [xharness] Don't try to parse log files that don't exist. (#7614) Makes xharness throw fewer exceptions, which makes tracing output simpler to read. --- tests/xharness/Jenkins.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 3ea5431199..4fbde47ae9 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -2105,6 +2105,7 @@ namespace xharness if (logs.Count () > 0) { foreach (var log in logs) { log.Flush (); + var exists = File.Exists (log.FullPath); string log_type = System.Web.MimeMapping.GetMimeMapping (log.FullPath); string log_target; switch (log_type) { @@ -2115,7 +2116,9 @@ namespace xharness log_target = "_self"; break; } - if (log.Description == "Build log") { + if (!exists) { + writer.WriteLine ("{1} (does not exist)
", LinkEncode (log.FullPath.Substring (LogDirectory.Length + 1)), log.Description, log_type, log_target); + } else if (log.Description == "Build log") { var binlog = log.FullPath.Replace (".txt", ".binlog"); if (File.Exists (binlog)) { var textLink = string.Format ("{1}", LinkEncode (log.FullPath.Substring (LogDirectory.Length + 1)), log.Description, log_type, log_target); @@ -2127,7 +2130,9 @@ namespace xharness } else { writer.WriteLine ("{1}
", LinkEncode (log.FullPath.Substring (LogDirectory.Length + 1)), log.Description, log_type, log_target); } - if (log.Description == "Test log" || log.Description == "Extension test log" || log.Description == "Execution log") { + if (!exists) { + // Don't try to parse files that don't exist + } else if (log.Description == "Test log" || log.Description == "Extension test log" || log.Description == "Execution log") { string summary; List fails; try {