diff --git a/Make.config b/Make.config index 01c118604f..fdb3cbb903 100644 --- a/Make.config +++ b/Make.config @@ -29,7 +29,7 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) # on wrench, because wrench technically builds hashes, not branches) # # -PACKAGE_HEAD_BRANCH=master +PACKAGE_HEAD_BRANCH=cycle8 ifeq ($(BUILD_REVISION),) CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD) else diff --git a/external/mono b/external/mono index 765d709d24..d0b2dacbe4 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 765d709d24b3a2014c4f3d4faeeb193f2b7fef0c +Subproject commit d0b2dacbe4ab297d74043071b2db60f3d95ec8fe diff --git a/external/watch-mono b/external/watch-mono index 4239ddd9f1..d0b2dacbe4 160000 --- a/external/watch-mono +++ b/external/watch-mono @@ -1 +1 @@ -Subproject commit 4239ddd9f18d778e03cc979c9d15135e47fb0e28 +Subproject commit d0b2dacbe4ab297d74043071b2db60f3d95ec8fe diff --git a/jenkins.sh b/jenkins.sh index 2c6613fe96..c567810365 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -4,4 +4,4 @@ time make world make -j8 -C tools/apidiff jenkins-api-diff -make -C tests jenkins || true +make -C tests jenkins diff --git a/mk/xamarin.mk b/mk/xamarin.mk index ea1dd77fc8..dcb1ab4bb1 100644 --- a/mk/xamarin.mk +++ b/mk/xamarin.mk @@ -1,5 +1,5 @@ ifdef ENABLE_XAMARIN -NEEDED_MACCORE_VERSION := ab2150625edc341a4de4c6b57164a41baa8fb6a4 +NEEDED_MACCORE_VERSION := 4b656b2ae80da9ea0c604d12d37195cb70ac1816 NEEDED_MACCORE_BRANCH := xcode8 MACCORE_DIRECTORY := maccore diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets index 8fb3c846d0..5587503122 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets @@ -1623,6 +1623,10 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. + + $([System.Path]::GetDirectoryName('$(IpaPackagePath)')) + $([System.Path]::GetFileName('$(IpaPackagePath)')) + $(DeviceSpecificOutputPath)$(_AppBundleName) $([System.DateTime]::Now.ToString('yyyy-MM-dd HH-mm-ss')) @@ -1726,8 +1730,8 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. ExtraArgs="$(CodesignExtraArgs)" /> - - + + - - + + 0) total += res; } while ((res > 0 && total < len) || (res == -1 && errno == EINTR)); - MONO_EXIT_GC_SAFE; - return total; } gboolean sdb_send (void *buf, int len) { - return send_uninterrupted (sdb_fd, buf, len); + gboolean rv; + + if (debugging_configured) { + MONO_ENTER_GC_SAFE; + rv = send_uninterrupted (sdb_fd, buf, len); + MONO_EXIT_GC_SAFE; + } else { + rv = send_uninterrupted (sdb_fd, buf, len); + } + + return rv; } int sdb_recv (void *buf, int len) { - return recv_uninterrupted (sdb_fd, buf, len); + int rv; + + if (debugging_configured) { + MONO_ENTER_GC_SAFE; + rv = recv_uninterrupted (sdb_fd, buf, len); + MONO_EXIT_GC_SAFE; + } else { + rv = recv_uninterrupted (sdb_fd, buf, len); + } + + return rv; } int monotouch_connect_wifi (NSMutableArray *ips) @@ -776,11 +788,9 @@ monotouch_load_debugger () transport.send = sdb_send; transport.recv = sdb_recv; - MONO_ENTER_GC_UNSAFE; mono_debugger_agent_register_transport (&transport); mono_debugger_agent_parse_options ("transport=custom_transport,address=dummy,embedding=1"); - MONO_EXIT_GC_UNSAFE; LOG (PRODUCT ": Debugger loaded with custom transport (fd: %i)\n", sdb_fd); } else { @@ -797,9 +807,7 @@ monotouch_load_profiler () // TODO: make this generic enough for other profilers to work too // Main thread only if (profiler_description != NULL) { - MONO_ENTER_GC_UNSAFE; mono_profiler_load (profiler_description); - MONO_EXIT_GC_UNSAFE; LOG (PRODUCT ": Profiler loaded: %s\n", profiler_description); free (profiler_description); diff --git a/src/CoreGraphics/CGFont.cs b/src/CoreGraphics/CGFont.cs index 39ffe983fe..217a2a98a7 100644 --- a/src/CoreGraphics/CGFont.cs +++ b/src/CoreGraphics/CGFont.cs @@ -139,20 +139,12 @@ namespace XamCore.CoreGraphics { } } - string GetNullableString (IntPtr handle) - { - if (handle == IntPtr.Zero) - return null; - using (var s = new CFString (handle, true)) - return (string) s; - } - [DllImport (Constants.CoreGraphicsLibrary)] extern static /* CFStringRef __nullable */ IntPtr CGFontCopyPostScriptName (/* CGFontRef __nullable */ IntPtr font); public string PostScriptName { get { - return GetNullableString (CGFontCopyPostScriptName (handle)); + return CFString.FetchString (CGFontCopyPostScriptName (handle)); } } @@ -161,7 +153,7 @@ namespace XamCore.CoreGraphics { public string FullName { get { - return GetNullableString (CGFontCopyFullName (handle)); + return CFString.FetchString (CGFontCopyFullName (handle)); } } @@ -266,7 +258,7 @@ namespace XamCore.CoreGraphics { public string GlyphNameForGlyph (ushort glyph) { - return GetNullableString (CGFontCopyGlyphNameForGlyph (handle, glyph)); + return CFString.FetchString (CGFontCopyGlyphNameForGlyph (handle, glyph)); } //[DllImport (Constants.CoreGraphicsLibrary)] diff --git a/src/foundation.cs b/src/foundation.cs index b54c9ac66b..fbe34a8ea6 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -4072,6 +4072,9 @@ namespace XamCore.Foundation [Since (5,0)] [BaseType (typeof (NSObject))] +#if WATCH + [DisableDefaultCtor] // "NSUbiquitousKeyValueStore is unavailable" is printed to the log. +#endif interface NSUbiquitousKeyValueStore { [Static] [Export ("defaultStore")] diff --git a/tests/apitest/Info.plist b/tests/apitest/Info.plist index 803c7af5e1..7198d0c5b8 100644 --- a/tests/apitest/Info.plist +++ b/tests/apitest/Info.plist @@ -14,5 +14,7 @@ 10.7 NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/dontlink-mac/Info.plist b/tests/dontlink-mac/Info.plist index 7de8f9e319..2309ee167e 100644 --- a/tests/dontlink-mac/Info.plist +++ b/tests/dontlink-mac/Info.plist @@ -14,5 +14,7 @@ 10.7 NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/introspection/Mac/Info.plist b/tests/introspection/Mac/Info.plist index af788969bc..990daff808 100644 --- a/tests/introspection/Mac/Info.plist +++ b/tests/introspection/Mac/Info.plist @@ -16,5 +16,7 @@ public.app-category.developer-tools CFBundleName introspection + LSUIElement + 1 diff --git a/tests/linker-ios/link all/LinkAllTest.cs b/tests/linker-ios/link all/LinkAllTest.cs index 4e74e8ee8b..b4cbbdf3de 100644 --- a/tests/linker-ios/link all/LinkAllTest.cs +++ b/tests/linker-ios/link all/LinkAllTest.cs @@ -160,6 +160,9 @@ namespace LinkAll { [Test] public void TrustUsingOldPolicy () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif // Three similar tests exists in dontlink, linkall and linksdk to test 3 different cases // untrusted, custom ICertificatePolicy and ServerCertificateValidationCallback without // having caching issues (in S.Net or the SSL handshake cache) diff --git a/tests/linker-ios/link sdk/AsyncTest.cs b/tests/linker-ios/link sdk/AsyncTest.cs index 9776afb5d8..021503d5e6 100644 --- a/tests/linker-ios/link sdk/AsyncTest.cs +++ b/tests/linker-ios/link sdk/AsyncTest.cs @@ -22,6 +22,9 @@ namespace LinkSdk { [Test] public void Bug12221 () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif LoadCategories ().Wait (); } } diff --git a/tests/linker-ios/link sdk/CryptoTest.cs b/tests/linker-ios/link sdk/CryptoTest.cs index dcdd431ed3..911f5f0b2a 100644 --- a/tests/linker-ios/link sdk/CryptoTest.cs +++ b/tests/linker-ios/link sdk/CryptoTest.cs @@ -41,6 +41,9 @@ namespace LinkSdk { [Test] public void TrustUsingNewCallback () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif // Three similar tests exists in dontlink, linkall and linksdk to test 3 different cases // untrusted, custom ICertificatePolicy and ServerCertificateValidationCallback without // having caching issues (in S.Net or the SSL handshake cache) @@ -67,6 +70,9 @@ namespace LinkSdk { [Test] public void SSL_IP_5706 () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif WebClient wc = new WebClient (); // the certificate contains (several rules) the host name Assert.NotNull (wc.DownloadString ("https://www.google.com")); @@ -88,6 +94,9 @@ namespace LinkSdk { [Test] public void TLS1_ServerNameExtension () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif // without support for the "server_name" TLS extension (RFC3546) we receive the "general" // certificate of a server, which might not be the right one if a single server instance // is used for many hosts (without a common name) diff --git a/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs b/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs index a8a13763ef..e6de958294 100644 --- a/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs +++ b/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs @@ -650,6 +650,9 @@ namespace LinkSdk { [Test] public void WebClient_SSL_Leak () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif WebClient wc = new WebClient (); // note: needs to be executed under Instrument to verify it does not leak string s = wc.DownloadString ("https://developers.google.com"); @@ -902,7 +905,7 @@ namespace LinkSdk { path = TestFolder (Environment.SpecialFolder.UserProfile, readOnly: device); if (Runtime.Arch == Arch.DEVICE) { #if __WATCHOS__ - Assert.True (path.StartsWith ("/private/var/mobile/Containers/Data/Application/", StringComparison.Ordinal), "Containers-ios8"); + Assert.That (path, Is.StringStarting ("/private/var/mobile/Containers/Data/PluginKitPlugin/"), "Containers-ios8"); #else if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0)) Assert.True (path.StartsWith ("/private/var/mobile/Containers/Data/Application/", StringComparison.Ordinal), "Containers-ios8"); diff --git a/tests/linker-ios/link sdk/PclTest.cs b/tests/linker-ios/link sdk/PclTest.cs index afbc354dd0..cc4ed67c95 100644 --- a/tests/linker-ios/link sdk/PclTest.cs +++ b/tests/linker-ios/link sdk/PclTest.cs @@ -29,6 +29,9 @@ namespace LinkSdk { [Test] public void System () { +#if __WATCHOS__ + Assert.Ignore ("WatchOS doesn't support BSD sockets, which our network stack currently requires."); +#endif const string url = "http://www.google.com"; Uri uri = new Uri (url); diff --git a/tests/mmptest/Info.plist b/tests/mmptest/Info.plist index 803c7af5e1..7198d0c5b8 100644 --- a/tests/mmptest/Info.plist +++ b/tests/mmptest/Info.plist @@ -14,5 +14,7 @@ 10.7 NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/custom-bundle-name/Info.plist b/tests/mmptest/regression/custom-bundle-name/Info.plist index 9fe30d5a06..3ac803d483 100644 --- a/tests/mmptest/regression/custom-bundle-name/Info.plist +++ b/tests/mmptest/regression/custom-bundle-name/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/embedded-mono-profile/Info.plist b/tests/mmptest/regression/embedded-mono-profile/Info.plist index 9fe30d5a06..3ac803d483 100644 --- a/tests/mmptest/regression/embedded-mono-profile/Info.plist +++ b/tests/mmptest/regression/embedded-mono-profile/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/embedded-mono/Info.plist b/tests/mmptest/regression/embedded-mono/Info.plist index 9fe30d5a06..3ac803d483 100644 --- a/tests/mmptest/regression/embedded-mono/Info.plist +++ b/tests/mmptest/regression/embedded-mono/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-aes-1/Info.plist b/tests/mmptest/regression/link-aes-1/Info.plist index 5bf17be0d9..175ad6dafd 100644 --- a/tests/mmptest/regression/link-aes-1/Info.plist +++ b/tests/mmptest/regression/link-aes-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-blocks-1/Info.plist b/tests/mmptest/regression/link-blocks-1/Info.plist index 12c0e49008..4256b9e6d4 100644 --- a/tests/mmptest/regression/link-blocks-1/Info.plist +++ b/tests/mmptest/regression/link-blocks-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-callfilepath-45/Info.plist b/tests/mmptest/regression/link-callfilepath-45/Info.plist index 5063a80561..ac9fa7b4d7 100644 --- a/tests/mmptest/regression/link-callfilepath-45/Info.plist +++ b/tests/mmptest/regression/link-callfilepath-45/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-data-contract-1/Info.plist b/tests/mmptest/regression/link-data-contract-1/Info.plist index 9a91e66604..2c1e53c3ba 100644 --- a/tests/mmptest/regression/link-data-contract-1/Info.plist +++ b/tests/mmptest/regression/link-data-contract-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-frameworks-1/Info.plist b/tests/mmptest/regression/link-frameworks-1/Info.plist index 04ad310150..14b2062cd6 100644 --- a/tests/mmptest/regression/link-frameworks-1/Info.plist +++ b/tests/mmptest/regression/link-frameworks-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-gdiplus-1/Info.plist b/tests/mmptest/regression/link-gdiplus-1/Info.plist index d3d96cfcec..02e37bced9 100644 --- a/tests/mmptest/regression/link-gdiplus-1/Info.plist +++ b/tests/mmptest/regression/link-gdiplus-1/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-gdiplus-2/Info.plist b/tests/mmptest/regression/link-gdiplus-2/Info.plist index e618844f63..9f90332c5a 100644 --- a/tests/mmptest/regression/link-gdiplus-2/Info.plist +++ b/tests/mmptest/regression/link-gdiplus-2/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-httpclient-async/Info.plist b/tests/mmptest/regression/link-httpclient-async/Info.plist index 822ba78dee..92eefb26f7 100644 --- a/tests/mmptest/regression/link-httpclient-async/Info.plist +++ b/tests/mmptest/regression/link-httpclient-async/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-keep-resources-1/Info.plist b/tests/mmptest/regression/link-keep-resources-1/Info.plist index c86c2fcff0..f626118dc3 100644 --- a/tests/mmptest/regression/link-keep-resources-1/Info.plist +++ b/tests/mmptest/regression/link-keep-resources-1/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-keep-resources-2/Info.plist b/tests/mmptest/regression/link-keep-resources-2/Info.plist index 5808ea2130..f0790a016d 100644 --- a/tests/mmptest/regression/link-keep-resources-2/Info.plist +++ b/tests/mmptest/regression/link-keep-resources-2/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-posix-1/Info.plist b/tests/mmptest/regression/link-posix-1/Info.plist index 6271ab2e8d..9998980f25 100644 --- a/tests/mmptest/regression/link-posix-1/Info.plist +++ b/tests/mmptest/regression/link-posix-1/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-posix-2/Info.plist b/tests/mmptest/regression/link-posix-2/Info.plist index 06f6344143..4ae5945df1 100644 --- a/tests/mmptest/regression/link-posix-2/Info.plist +++ b/tests/mmptest/regression/link-posix-2/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-preserve-assembly/Info.plist b/tests/mmptest/regression/link-preserve-assembly/Info.plist index 82bbda9348..34e8b333a5 100644 --- a/tests/mmptest/regression/link-preserve-assembly/Info.plist +++ b/tests/mmptest/regression/link-preserve-assembly/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-preserve-calendar-1/Info.plist b/tests/mmptest/regression/link-preserve-calendar-1/Info.plist index ca320a33ff..bf8e024a7d 100644 --- a/tests/mmptest/regression/link-preserve-calendar-1/Info.plist +++ b/tests/mmptest/regression/link-preserve-calendar-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-preserve-calendar-2/Info.plist b/tests/mmptest/regression/link-preserve-calendar-2/Info.plist index b61aa72cb5..3db685c689 100644 --- a/tests/mmptest/regression/link-preserve-calendar-2/Info.plist +++ b/tests/mmptest/regression/link-preserve-calendar-2/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-remove-attributes-1/Info.plist b/tests/mmptest/regression/link-remove-attributes-1/Info.plist index cda5b19e17..916db3b207 100644 --- a/tests/mmptest/regression/link-remove-attributes-1/Info.plist +++ b/tests/mmptest/regression/link-remove-attributes-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-safe-1/Info.plist b/tests/mmptest/regression/link-safe-1/Info.plist index f4386018e4..99b785cce5 100644 --- a/tests/mmptest/regression/link-safe-1/Info.plist +++ b/tests/mmptest/regression/link-safe-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-system.web-icalls/Info.plist b/tests/mmptest/regression/link-system.web-icalls/Info.plist index 0ab4aefc6e..22307f5333 100644 --- a/tests/mmptest/regression/link-system.web-icalls/Info.plist +++ b/tests/mmptest/regression/link-system.web-icalls/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-typedescriptor-1/Info.plist b/tests/mmptest/regression/link-typedescriptor-1/Info.plist index a5ab157036..cb9124a4af 100644 --- a/tests/mmptest/regression/link-typedescriptor-1/Info.plist +++ b/tests/mmptest/regression/link-typedescriptor-1/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-typedescriptor-2/Info.plist b/tests/mmptest/regression/link-typedescriptor-2/Info.plist index f2f7ec2155..32d5eda744 100644 --- a/tests/mmptest/regression/link-typedescriptor-2/Info.plist +++ b/tests/mmptest/regression/link-typedescriptor-2/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-uithread-1/Info.plist b/tests/mmptest/regression/link-uithread-1/Info.plist index 89158585b8..c965f600d0 100644 --- a/tests/mmptest/regression/link-uithread-1/Info.plist +++ b/tests/mmptest/regression/link-uithread-1/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-uithread-2/Info.plist b/tests/mmptest/regression/link-uithread-2/Info.plist index 2b46663ae1..e4bc680865 100644 --- a/tests/mmptest/regression/link-uithread-2/Info.plist +++ b/tests/mmptest/regression/link-uithread-2/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-webclient-1/Info.plist b/tests/mmptest/regression/link-webclient-1/Info.plist index fe90ee60ad..eb48798d12 100644 --- a/tests/mmptest/regression/link-webclient-1/Info.plist +++ b/tests/mmptest/regression/link-webclient-1/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-webclient-2/Info.plist b/tests/mmptest/regression/link-webclient-2/Info.plist index 1171e1671c..13ef6f4d6d 100644 --- a/tests/mmptest/regression/link-webclient-2/Info.plist +++ b/tests/mmptest/regression/link-webclient-2/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-webclient-3/Info.plist b/tests/mmptest/regression/link-webclient-3/Info.plist index a7b425d914..f6a2a9a156 100644 --- a/tests/mmptest/regression/link-webclient-3/Info.plist +++ b/tests/mmptest/regression/link-webclient-3/Info.plist @@ -14,5 +14,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/link-xml-serialization/Info.plist b/tests/mmptest/regression/link-xml-serialization/Info.plist index 01d7b902cb..9604af2ed1 100644 --- a/tests/mmptest/regression/link-xml-serialization/Info.plist +++ b/tests/mmptest/regression/link-xml-serialization/Info.plist @@ -12,5 +12,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/system-mono-profile/Info.plist b/tests/mmptest/regression/system-mono-profile/Info.plist index 9fe30d5a06..3ac803d483 100644 --- a/tests/mmptest/regression/system-mono-profile/Info.plist +++ b/tests/mmptest/regression/system-mono-profile/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/mmptest/regression/system-mono/Info.plist b/tests/mmptest/regression/system-mono/Info.plist index 9fe30d5a06..3ac803d483 100644 --- a/tests/mmptest/regression/system-mono/Info.plist +++ b/tests/mmptest/regression/system-mono/Info.plist @@ -16,5 +16,7 @@ MainMenu NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/monotouch-test/Foundation/UbiquitousKeyValueStoreTest.cs b/tests/monotouch-test/Foundation/UbiquitousKeyValueStoreTest.cs index 5a64c8ab94..7d355fd0e0 100644 --- a/tests/monotouch-test/Foundation/UbiquitousKeyValueStoreTest.cs +++ b/tests/monotouch-test/Foundation/UbiquitousKeyValueStoreTest.cs @@ -25,15 +25,14 @@ namespace MonoTouchFixtures.Foundation { [TestFixture] [Preserve (AllMembers = true)] public class NSUbiquitousKeyValueStoreTest { +#if !__WATCHOS__ + // Looks like NSUbiquitousKeyValueStore doesn't work on watchOS: + // http://stackoverflow.com/questions/37412775/nsubiquitouskeyvaluestore-is-unavailable-watchos-2 + // https://forums.developer.apple.com/thread/47564 [Test] public void Indexer () { -#if __WATCHOS__ - // Looks like NSUbiquitousKeyValueStore doesn't work on watchOS: - // http://stackoverflow.com/questions/37412775/nsubiquitouskeyvaluestore-is-unavailable-watchos-2 - // https://forums.developer.apple.com/thread/47564 Assert.Ignore ("Doesn't work on watchOS"); -#endif using (var store = new NSUbiquitousKeyValueStore ()) { using (var key = new NSString ("key")) { @@ -48,5 +47,6 @@ namespace MonoTouchFixtures.Foundation { } } } +#endif } } diff --git a/tests/msbuild-mac/Info.plist b/tests/msbuild-mac/Info.plist index 4689b4537d..fa0863b6e9 100644 --- a/tests/msbuild-mac/Info.plist +++ b/tests/msbuild-mac/Info.plist @@ -24,5 +24,7 @@ donblas NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 441d2d9f3d..feec39977f 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -311,7 +311,7 @@ namespace xharness public async Task RunAsync () { - HashSet start_crashes = null; + CrashReportSnapshot crash_reports = new CrashReportSnapshot () { Device = !isSimulator, Harness = Harness, Log = main_log, Logs = Logs, LogDirectory = LogDirectory }; LogStream device_system_log = null; LogStream listener_log = null; Log run_log = main_log; @@ -403,7 +403,7 @@ namespace xharness args.AppendFormat (" \"{0}\" ", launchAppPath); args.Append (" --device=:v2:udid=").Append (simulator.UDID).Append (" "); - start_crashes = await Harness.CreateCrashReportsSnapshotAsync (main_log, true); + await crash_reports.StartCaptureAsync (); listener.StartAsync (); main_log.WriteLine ("Starting test run"); @@ -482,7 +482,7 @@ namespace xharness }; logdev.StartCapture (); - start_crashes = await Harness.CreateCrashReportsSnapshotAsync (main_log, false); + await crash_reports.StartCaptureAsync (); listener.StartAsync (); main_log.WriteLine ("Starting test run"); @@ -556,62 +556,11 @@ namespace xharness crashed = true; } - // Check for crash reports - var crash_report_search_done = false; - var crash_report_search_timeout = 5; - var watch = new Stopwatch (); - watch.Start (); - do { - var end_crashes = await Harness.CreateCrashReportsSnapshotAsync (main_log, isSimulator); - end_crashes.ExceptWith (start_crashes); - if (end_crashes.Count > 0) { - main_log.WriteLine ("Found {0} new crash report(s)", end_crashes.Count); - List crash_reports; - if (isSimulator) { - crash_reports = new List (end_crashes.Count); - foreach (var path in end_crashes) { - var logPath = Path.Combine (LogDirectory, Path.GetFileName (path)); - File.Copy (path, logPath, true); - crash_reports.Add (Logs.CreateFile ("Crash report: " + Path.GetFileName (path), logPath)); - } - } else { - // Download crash reports from the device. We put them in the project directory so that they're automatically deleted on wrench - // (if we put them in /tmp, they'd never be deleted). - var downloaded_crash_reports = new List (); - foreach (var file in end_crashes) { - var crash_report_target = Logs.CreateFile ("Crash report: " + Path.GetFileName (file), Path.Combine (LogDirectory, Path.GetFileName (file))); - var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, "--download-crash-report=" + file + " --download-crash-report-to=" + crash_report_target.Path + " --sdkroot " + Harness.XcodeRoot, main_log, TimeSpan.FromMinutes (1)); - if (result.Succeeded) { - main_log.WriteLine ("Downloaded crash report {0} to {1}", file, crash_report_target.Path); - crash_report_target = await Harness.SymbolicateCrashReportAsync (main_log, crash_report_target); - Logs.Add (crash_report_target); - downloaded_crash_reports.Add (crash_report_target); - } else { - main_log.WriteLine ("Could not download crash report {0}", file); - } - } - crash_reports = downloaded_crash_reports; - } - foreach (var cp in crash_reports) { - Harness.LogWrench ("@MonkeyWrench: AddFile: {0}", cp.Path); - main_log.WriteLine (" {0}", cp.Path); - } - crash_report_search_done = true; - } else if (!crashed && !timed_out) { - crash_report_search_done = true; - } else { - if (watch.Elapsed.TotalSeconds > crash_report_search_timeout) { - crash_report_search_done = true; - } else { - main_log.WriteLine ("No crash reports, waiting a second to see if the crash report service just didn't complete in time ({0})", (int) (crash_report_search_timeout - watch.Elapsed.TotalSeconds)); - Thread.Sleep (TimeSpan.FromSeconds (1)); - } - } - } while (!crash_report_search_done); - if (!success.HasValue) success = false; - + + await crash_reports.EndCaptureAsync (TimeSpan.FromSeconds (success.Value ? 0 : 5)); + if (timed_out) { Result = TestExecutingResult.TimedOut; } else if (crashed) { diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index 1339e02bb1..b3b3fe8a99 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -635,11 +635,11 @@ namespace xharness } } - public async Task> CreateCrashReportsSnapshotAsync (Log log, bool simulator) + public async Task> CreateCrashReportsSnapshotAsync (Log log, bool simulatorOrDesktop) { var rv = new HashSet (); - if (simulator) { + if (simulatorOrDesktop) { var dir = Path.Combine (Environment.GetEnvironmentVariable ("HOME"), "Library", "Logs", "DiagnosticReports"); if (Directory.Exists (dir)) rv.UnionWith (Directory.EnumerateFiles (dir)); @@ -657,4 +657,76 @@ namespace xharness return rv; } } + + public class CrashReportSnapshot + { + public Harness Harness { get; set; } + public Log Log { get; set; } + public Logs Logs { get; set; } + public string LogDirectory { get; set; } + public bool Device { get; set; } + + public HashSet InitialSet { get; private set; } + public IEnumerable Reports { get; private set; } + + public async Task StartCaptureAsync () + { + InitialSet = await Harness.CreateCrashReportsSnapshotAsync (Log, !Device); + } + + public async Task EndCaptureAsync (TimeSpan timeout) + { + // Check for crash reports + var crash_report_search_done = false; + var crash_report_search_timeout = timeout.TotalSeconds; + var watch = new Stopwatch (); + watch.Start (); + do { + var end_crashes = await Harness.CreateCrashReportsSnapshotAsync (Log, !Device); + end_crashes.ExceptWith (InitialSet); + Reports = end_crashes; + if (end_crashes.Count > 0) { + Log.WriteLine ("Found {0} new crash report(s)", end_crashes.Count); + List crash_reports; + if (!Device) { + crash_reports = new List (end_crashes.Count); + foreach (var path in end_crashes) { + var logPath = Path.Combine (LogDirectory, Path.GetFileName (path)); + File.Copy (path, logPath, true); + crash_reports.Add (Logs.CreateFile ("Crash report: " + Path.GetFileName (path), logPath)); + } + } else { + // Download crash reports from the device. We put them in the project directory so that they're automatically deleted on wrench + // (if we put them in /tmp, they'd never be deleted). + var downloaded_crash_reports = new List (); + foreach (var file in end_crashes) { + var crash_report_target = Logs.CreateFile ("Crash report: " + Path.GetFileName (file), Path.Combine (LogDirectory, Path.GetFileName (file))); + var result = await ProcessHelper.ExecuteCommandAsync (Harness.MlaunchPath, "--download-crash-report=" + file + " --download-crash-report-to=" + crash_report_target.Path + " --sdkroot " + Harness.XcodeRoot, Log, TimeSpan.FromMinutes (1)); + if (result.Succeeded) { + Log.WriteLine ("Downloaded crash report {0} to {1}", file, crash_report_target.Path); + crash_report_target = await Harness.SymbolicateCrashReportAsync (Log, crash_report_target); + Logs.Add (crash_report_target); + downloaded_crash_reports.Add (crash_report_target); + } else { + Log.WriteLine ("Could not download crash report {0}", file); + } + } + crash_reports = downloaded_crash_reports; + } + foreach (var cp in crash_reports) { + Harness.LogWrench ("@MonkeyWrench: AddFile: {0}", cp.Path); + Log.WriteLine (" {0}", cp.Path); + } + crash_report_search_done = true; + } else { + if (watch.Elapsed.TotalSeconds > crash_report_search_timeout) { + crash_report_search_done = true; + } else { + Log.WriteLine ("No crash reports, waiting a second to see if the crash report service just didn't complete in time ({0})", (int) (crash_report_search_timeout - watch.Elapsed.TotalSeconds)); + Thread.Sleep (TimeSpan.FromSeconds (1)); + } + } + } while (!crash_report_search_done); + } + } } diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 7d132bea5a..c7cdc43009 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -89,7 +89,7 @@ namespace xharness var companion = Simulators.AvailableDevices. FirstOrDefault ((SimDevice v) => pair.Companion == v.UDID); - runtasks.Add (new RunSimulatorTask (buildTask, device, companion) { Platform = TestPlatform.watchOS, ExecutionResult = TestExecutingResult.Ignored }); + runtasks.Add (new RunSimulatorTask (buildTask, device, companion) { Platform = TestPlatform.watchOS }); } else { var latestiOSRuntime = Simulators.SupportedRuntimes. @@ -276,7 +276,7 @@ namespace xharness tasks.Add (task.RunAsync ()); Task.WaitAll (tasks.ToArray ()); GenerateReport (); - return Tasks.Any ((v) => v.ExecutionResult == TestExecutingResult.Failed || v.ExecutionResult == TestExecutingResult.Crashed) ? 1 : 0; + return Tasks.Any ((v) => v.Failed) ? 1 : 0; } catch (Exception ex) { MainLog.WriteLine ("Unexpected exception: {0}", ex); return 2; @@ -939,8 +939,13 @@ function toggleContainerVisibility (containerName) log.WriteLine ("{0} {1}", proc.StartInfo.FileName, proc.StartInfo.Arguments); if (!Harness.DryRun) { ExecutionResult = TestExecutingResult.Running; + + var snapshot = new CrashReportSnapshot () { Device = false, Harness = Harness, Log = log, Logs = Logs, LogDirectory = LogDirectory }; + await snapshot.StartCaptureAsync (); + try { var timeout = TimeSpan.FromMinutes (10); + var result = await proc.RunAsync (log, true, timeout); if (result.TimedOut) { log.WriteLine ("Execution timed out after {0} seconds.", timeout.TotalSeconds); @@ -954,6 +959,8 @@ function toggleContainerVisibility (containerName) log.WriteLine (e.ToString ()); ExecutionResult = TestExecutingResult.HarnessException; } + + await snapshot.EndCaptureAsync (TimeSpan.FromSeconds (Succeeded ? 0 : 5)); } Jenkins.MainLog.WriteLine ("Executed {0} ({1})", TestName, Mode); } @@ -1150,7 +1157,11 @@ function toggleContainerVisibility (containerName) run_timer.Stop (); } - ExecutionResult = Tasks.Any ((v) => !v.Succeeded) ? TestExecutingResult.Failed : TestExecutingResult.Succeeded; + if (Tasks.All ((v) => v.Ignored)) { + ExecutionResult = TestExecutingResult.Ignored; + } else { + ExecutionResult = Tasks.Any ((v) => v.Failed) ? TestExecutingResult.Failed : TestExecutingResult.Succeeded; + } } } diff --git a/tests/xharness/Log.cs b/tests/xharness/Log.cs index 04a7486902..ccd152db2c 100644 --- a/tests/xharness/Log.cs +++ b/tests/xharness/Log.cs @@ -107,7 +107,7 @@ namespace xharness public override TextWriter GetWriter () { - return writer ?? (writer = new StreamWriter (new FileStream (Path, FileMode.Open, FileAccess.Write, FileShare.Read))); + return writer ?? (writer = new StreamWriter (new FileStream (Path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read))); } protected override void Dispose (bool disposing) diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs index 5fd7b5e9c7..c7cdaeb2bf 100644 --- a/tools/common/StaticRegistrar.cs +++ b/tools/common/StaticRegistrar.cs @@ -3234,7 +3234,7 @@ namespace XamCore.Registrar { body.WriteLine ("if (exception_gchandle != 0) goto exception_handling;"); body.WriteLine ("if (has_nsobject) {"); body.WriteLine ("*call_super = true;"); - body.WriteLine ("return self;"); + body.WriteLine ("goto exception_handling;"); body.WriteLine ("}"); } diff --git a/tools/mmp/linker/Descriptors/mscorlib.xml b/tools/mmp/linker/Descriptors/mscorlib.xml index e8db9b86b2..642e16a009 100644 --- a/tools/mmp/linker/Descriptors/mscorlib.xml +++ b/tools/mmp/linker/Descriptors/mscorlib.xml @@ -773,9 +773,12 @@ - + + + + + + diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index 7952c5b506..5054eec6cf 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -627,9 +627,24 @@ namespace Xamarin.Bundler sw.WriteLine ("();"); } } + + // Burn in a reference to the profiling symbol so that the native linker doesn't remove it + // On iOS we can pass -u to the native linker, but that doesn't work on tvOS, where + // we're building with bitcode (even when bitcode is disabled, we still build with the + // bitcode marker, which makes the linker reject -u). + if (App.EnableProfiling) { + sw.WriteLine ("extern \"C\" { void mono_profiler_startup_log (); }"); + sw.WriteLine ("typedef void (*xamarin_profiler_symbol_def)();"); + sw.WriteLine ("extern xamarin_profiler_symbol_def xamarin_profiler_symbol;"); + sw.WriteLine ("xamarin_profiler_symbol_def xamarin_profiler_symbol = NULL;"); + } + sw.WriteLine ("void xamarin_setup_impl ()"); sw.WriteLine ("{"); + if (App.EnableProfiling) + sw.WriteLine ("\txamarin_profiler_symbol = mono_profiler_startup_log;"); + if (App.EnableLLVMOnlyBitCode) sw.WriteLine ("\tmono_jit_set_aot_mode (MONO_AOT_MODE_LLVMONLY);");