Граф коммитов

1516 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 0b3ab9cc15 [mtouch] Copy third-party frameworks from extensions to the main app's Frameworks directory. Fixes #45800. (#1069)
The container app may not reference the same third-party frameworks as
extensions, which means that we must make sure the extension's frameworks are
also included in the app bundle.

So when building extensions save a list of all third-party frameworks, and
then read that list and include those frameworks when building the main app.

https://bugzilla.xamarin.com/show_bug.cgi?id=45800
2016-10-31 12:36:06 +01:00
Chris Hamons 612f52bd80 Fix binding project LinkWithAttributes generation to prevent unnecess… (#1029)
* Fix binding project LinkWithAttributes generation to prevent unnecessary rebuilds

- https://bugzilla.xamarin.com/show_bug.cgi?id=45762

* Remove duplicate ToString call
2016-10-31 10:37:10 +01:00
Rolf Bjarne Kvinge f1af70998f [tests] Fix test compilation. (#1065) 2016-10-31 10:09:57 +01:00
Chris Hamons 0443d38028 [xm] Fix multiple NullAllowed issues in NSMenu (#1068)
- https://bugzilla.xamarin.com/show_bug.cgi?id=46162
2016-10-28 20:49:33 -04:00
Sebastien Pouliot e6b65f2a7e Bump Xcode 8.1 to the final version (#1062) 2016-10-28 20:48:29 -04:00
Rolf Bjarne Kvinge 1ca1c3a004 Bump mono requirement to fix mmp tests. (#1066)
This fixes the following mmptests:

1) Classic_NewRefCount_Warns (Xamarin.MMP.Tests.MMPTests.Classic_NewRefCount_Warns)
2) SystemMono_SmokeTest (Xamarin.MMP.Tests.MMPTests.SystemMono_SmokeTest)

That fails like this with earlier versions of Mono 4.8:

    Undefined symbols for architecture i386:
      "_mono_btls_x509_lookup_method_mono_init", referenced from:
         -u command line option
      "_mono_btls_x509_name_list_add", referenced from:
         -u command line option
      "_mono_btls_x509_name_list_free", referenced from:
         -u command line option
      "_mono_btls_x509_name_list_get_count", referenced from:
         -u command line option
      "_mono_btls_x509_name_list_get_item", referenced from:
         -u command line option
      "_mono_btls_x509_name_list_new", referenced from:
         -u command line option
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    error MM5109: Native linking failed with error code 1.  Check build log for details.
2016-10-28 14:22:58 -04:00
Rolf Bjarne Kvinge 0c43ddc615 Disable managed exception marshaling when the debugger is attached. Fixes #45116. (#1055)
Managed exception marshaling interferes with the debugger, because it adds
exception handlers to executing code, which makes the Mono runtime think an
exception is handled when logically it's not (although technically it is).

The consequence is that the IDEs will only be notified when we re-throw the
exception after catching it, making it impossible for the IDEs to stop when
the exception is thrown (they will instead stop when we re-throw the
exception).

So disable managed exception marshaling (unless the user changed the default
behavior) when a debugger is attached.

This is the same behavior as Xamarin.Android.

https://bugzilla.xamarin.com/show_bug.cgi?id=45116
2016-10-28 19:07:01 +02:00
Rolf Bjarne Kvinge 4371ea4540 [static registrar] Fix registration of generic types. Fixes #44926. (#1063)
https://bugzilla.xamarin.com/show_bug.cgi?id=44926
2016-10-28 18:42:45 +02:00
Manuel de la Pena 31a07e3bf1 [AVFoundation] Add new constructor for AVAssetExportSession. (#1037)
* [AVFoundation] Add new constructor for AVAssetExportSession.

Add a new constructor that takes an enum instead of a string to have
a strong typed version of the default constructor to reduce possible
errors when passing a random string.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=44443

* Use smart enums as requested in the PR review.

* Set manually the enum int values.
2016-10-28 17:52:34 +02:00
Rolf Bjarne Kvinge dde242c32a Allow using LinkWith attribute without a native library. (#997)
This makes it possible to set linker flags per assembly:

    [assembly: LinkWith (LinkerFlags = "-lsqlite3")]

Which is required when incremental builds is enabled and a particular assembly
needs special linker flags (because we don't propagate the global -gcc_flags
to each dylib we build when doing incremental builds).

Also add an option to set the dlsym mode for an assembly (using the LinkWith
attribute).
2016-10-28 10:50:42 -04:00
Rolf Bjarne Kvinge b6a0d06143 [tests] Remove dead code. (#1056) 2016-10-28 10:15:12 -04:00
Rolf Bjarne Kvinge bdbbea962a [tests] Unifiy namespaces in mtouch tests. (#1057) 2016-10-28 10:15:00 -04:00
Rolf Bjarne Kvinge f6d7ddb9f1 [docs] Remove mention of old Xamarin.iOS version. (#1059)
There's no need to mention that something was introduced in Xamarin.iOS 5.2.
2016-10-28 10:11:50 -04:00
Rolf Bjarne Kvinge 7e3cdb35f4 [docs] Document that the LinkWith.LinkTarget property is ignored. (#1060) 2016-10-28 10:11:42 -04:00
Rolf Bjarne Kvinge 6104a514fc [registrar] Cache the System.Void type. (#1024)
Duration before: 1,60s
Duration after:  1,54s
Difference:     -0,06s = -3,8%

Memory usage hardly changed (-21 kb of 540 MB), but the number of method calls
shrunk significantly.

Method calls before: 86.720.379
Method calls after:  74.390.061
Difference:         -12.330.318 = -14,2%

The call to `GetSystemVoidType` was #2 on the list of method calls (whens
sorted by 'self'), called 1072 times taking 1429 ms each time. After this
change it's only called once (and obviously pushed way down the list).
2016-10-28 09:52:58 -04:00
Rolf Bjarne Kvinge ea1a08785d [mtouch] Verify the correct SDK version when referencing frameworks from watchOS projects. (#1058) 2016-10-28 09:16:35 -04:00
Vincent Dondain 5d25bdc754 [mtouch/tests] BuildAndLaunchTime + RegistrarTime test (#1051)
- BuildAndLaunchTime is replacing AppLaunchTime as it calculates both
  build time and launch time for different linker modes.

* [mtouch/tests] Add RegistrarTime test

- Also fix MTouchTool --registrar:dynamic
2016-10-28 08:44:13 -04:00
Rolf Bjarne Kvinge 4e62423fcd [system-dependencies] Add support for installing Xcode's first-launch installs, and fix xip extraction. (#1041)
* [system-dependencies] Add support for installing Xcode's first-launch installs.

* [system-dependencies] Use the Archive Utility to extract Xcode xips.

Apple changed their format (again), so don't try to process the xip manually,
just invoke Apple's Archive Utility.

Another advantage is that the Archive Utility compresses the output (to about
half), saving multiple GB of hard disk space (from ~10 GB to ~5 GB).

* [system-dependencies] Add Xcode testing comment.

* [system-dependencies] Check if an Xcode package is in ~/Downloads, and if so use it.

This makes it easier to verify that provisioning works correctly whenever a new Xcode comes out.
2016-10-28 08:42:25 -04:00
Rolf Bjarne Kvinge 852209e72e [src] Fix project templates. (#1045) 2016-10-28 08:39:07 -04:00
Rolf Bjarne Kvinge a1644f6e13 [registrar] Improve an error message. (#1047) 2016-10-28 08:38:38 -04:00
Rolf Bjarne Kvinge 8cca6171cb [ObjCRuntime] Remove dead code. (#1046) 2016-10-28 08:37:47 -04:00
Rolf Bjarne Kvinge d1df84e01e [docs] Show bugzilla links (and to the right product) whenever it makes sense. (#1048) 2016-10-28 08:37:16 -04:00
Rolf Bjarne Kvinge 21eb5d5355 [ObjCRuntime] Simplify dynamic registrar creation a little bit. (#1044)
There's only one dynamic registrar now, so no need to make it complicated (nor
does the linker process this code anymore).
2016-10-28 08:33:57 -04:00
Rolf Bjarne Kvinge 23a0186a99 [registrar] Fix compiler warning. (#1054) 2016-10-28 08:33:18 -04:00
Chris Hamons b5edf16711 [XM] Teach XM resolver to load all of assemblies into memory (#1034)
- Profiling suggesting that loading all of sub-100 MB assemblies into
 memory is a performance win, and mtouch already does it.
2016-10-28 08:28:43 -04:00
Rolf Bjarne Kvinge c6d7a3adec [linker] Use ordinal instead of invariant comparison. (#1025)
Profiled when running the partial static registrar on Xamarin.iOS.dll

Duration before: 1,60s
Duration after:  1,41s
Difference:     -0,19s = -11,9%

Memory usage before: 541.887.736 bytes
Memory usage after:  509.111.944 bytes
Difference:          -32.775.792 bytes = -6,0%

Method calls before: 86.720.379
Method calls after:  63.073.602
Difference:         -23.646.777 = -27,3%
2016-10-28 08:28:02 -04:00
Rolf Bjarne Kvinge ab58a1f808 Bump mono to get fix for #45223. (#1053)
commit mono/mono@a06e82f6c0
    Author: Aleksey Kliger <aleksey@xamarin.com>
    Date:   Fri Oct 21 11:00:04 2016 -0400

    [coop handles] Don't scan null object references

    Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45223
2016-10-28 13:03:54 +02:00
Sebastien Pouliot 81c94cd683 Update XML definition for XM C8SR1 (from cycle8 branch) 2016-10-27 18:37:25 -04:00
Rolf Bjarne Kvinge 3cf1b75749 [generator] Use ordinal string comparison. (#1022)
Test results when running the generator for XM/full:

Profile output size before: 9,4 GB
Profile output size after:  5,6 GB

Duration before: 21,5 s
Duration after:  19,0 s
Difference:     - 2,5 s = -11,6 %

Total memory usage barely changed (5kb less within a total of 1,0 GB),
but the number of method calls fell drastically:

Method calls before: 868.053.383
Method calls after:  492.325.187
Difference:        - 375.728.196 = -43,3%

The top 10 method calls also changed significantly.

Method call summary before

```
Total(ms) Self(ms)      Calls Method name
  128879    28400    3509251 Mono.Globalization.Unicode.SimpleCollator:CompareInternal (string,int,int,string,int,int,bool&,bool&,bool,bool,Mono.Globalization.Unicode.SimpleCollator/Context&)
   16074    16074   79118946 Mono.Globalization.Unicode.CodePointIndexer:ToIndex (int)
   15952    10492   26747901 Mono.Globalization.Unicode.MSCompatUnicodeTable:Category (int)
   26425    10473   26747901 Mono.Globalization.Unicode.SimpleCollator:Category (int)
   14743     8679   14952304 Mono.Globalization.Unicode.MSCompatUnicodeTable:IsIgnorable (int,byte)
   31345     8113   10413595 System.RuntimeType:GetBaseType ()
   12266     7303   12523021 Mono.Globalization.Unicode.SimpleCollator:GetContraction (string,int,int)
   20555     5812   14952304 Mono.Globalization.Unicode.SimpleCollator:IsIgnorable (int,System.Globalization.CompareOptions)
   93341     5529    2674913 System.MonoCustomAttrs:GetCustomAttributes (System.Reflection.ICustomAttributeProvider,System.Type,bool)
    8229     5337   13551378 System.RuntimeType:GetAttributeFlagsImpl ()
```

Method call summary after

```
Total(ms) Self(ms)      Calls Method name
   31646     8168   10412459 System.RuntimeType:GetBaseType ()
   94899     5672    2674880 System.MonoCustomAttrs:GetCustomAttributes (System.Reflection.ICustomAttributeProvider,System.Type,bool)
    8343     5395   13550176 System.RuntimeType:GetAttributeFlagsImpl ()
    5646     5243    2914268 (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
    5147     5147    9727785 (wrapper managed-to-native) object:__icall_wrapper_ves_icall_array_new_specific (intptr,int)
   11140     4432   10948127 System.Type:get_Attributes ()
   19601     4362   10716826 System.Type:get_IsInterface ()
   15238     4344   10716826 System.RuntimeTypeHandle:IsInterface (System.RuntimeType)
    4133     4133          1 (wrapper managed-to-native) System.Threading.WaitHandle:WaitOne_internal (intptr,int)
    5922     3851    9541170 (wrapper stelemref) object:virt_stelemref_class (intptr,object)
```
2016-10-27 18:34:05 -04:00
Rolf Bjarne Kvinge d0209f4b27 [src] Improve makefile to create correct directories for pmcs.exe. (#1021) 2016-10-27 17:48:24 -04:00
Sebastien Pouliot 405bf0e979 [mtouch] Fix MT1009 to report the inner exception (#1008)
Found out it was missing by breaking (locally) something else :)
2016-10-27 17:45:33 -04:00
Sebastien Pouliot 7177c8c811 [tests] Disable XM NSMetadataItem test as it randomly fails on bots (#1052) 2016-10-27 16:51:15 -04:00
Rolf Bjarne Kvinge 66cbc100fe [ObjCRuntime] Fix NSLog P/Invoke on Sierra. (#1023)
Not a real fix (since the bug is in Apple's code), but we've already run into this several times:

https://bugzilla.xamarin.com/show_bug.cgi?id=43541
https://trello.com/c/lGa2jHM6/57-28082586-macos-sierra-nslog-crashes-when-called-from-jit-frame
2016-10-27 16:30:33 -04:00
Rolf Bjarne Kvinge 89eb5dd430 [registrar] Mark our generated code as 'extern C'. (#1049)
This makes the function names smaller, saving a tiny bit of space (about 700
bytes for the dont link test app).

It also looks nicer in crash reports.
2016-10-27 16:12:16 -04:00
Rolf Bjarne Kvinge 71a578ee38 [runtime] Remove deprecated and ignored mono option. (#1019)
Setting this option prints this to stdout:

> Mono Warning: option gen-compact-seq-points is deprecated.

and it's ignored, so just don't set this option.
2016-10-27 16:04:19 -04:00
Rolf Bjarne Kvinge 2fadd551de [tests] Fix xcode8.1 merge failure causing compilation error (duplicated method). (#1050) 2016-10-27 15:24:28 -04:00
Rolf Bjarne Kvinge f70602de16 Bump mono to get test fix for System/watchOS. (#1043)
commit mono/mono@16b8979fd1
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Wed Oct 26 11:39:30 2016 +0200

    [System] Tweak define to exclude System.Net.WebProxy.CreateDefaultProxy and update corresponding test.
2016-10-27 15:16:18 -04:00
Chris Hamons 82bfb2fe39 Fix XM dependency tracking of mmp bundle to prevent rebuilds (#1014)
- https://bugzilla.xamarin.com/show_bug.cgi?id=45764
- _CompileToNative's output in msbuild was incorrectly set to:
 $(_AppBundlePath)Contents\MacOS\$(TargetFileName) when the generated
 file lives at $(_AppBundlePath)Contents\MonoBundle\$(TargetFileName).
- This means we'd always try to rebuild, which can be rather time consuming.
- The XI target file is just different enough to require a seperate fix.
2016-10-27 20:15:28 +02:00
Rolf Bjarne Kvinge 94485580b5 Use ExceptionDispatchInfo to keep stack traces when unhandled exceptions are marshaled. Improves bug #45742 a bit. (#1040)
Example code:

	public override void ViewDidLoad ()
	{
		throw new Exception ("USELESS");
	}

Current output with unhandled exceptions that are marshaled:

    Unhandled Exception:
    System.Exception: USELESS
      at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
      at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /work/maccore/master/xamarin-macios/src/AppKit/NSApplication.cs:98
      at UselessExceptions.MainClass.Main (System.String[] args) [0x00007] in /Users/rolf/Downloads/filed-bug-test-cases-master/Xamarin/bxc45742/Main.cs:10
    [ERROR] FATAL UNHANDLED EXCEPTION: UselessExceptions.CustomException: USELESS
      at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
      at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /work/maccore/master/xamarin-macios/src/AppKit/NSApplication.cs:98
      at UselessExceptions.MainClass.Main (System.String[] args) [0x00007] in /Users/rolf/Downloads/filed-bug-test-cases-master/Xamarin/bxc45742/Main.cs:10

Note how the managed frame where the exception was thrown does not show up.

This is because we technically catch exceptions when marshaling them, and then
later we call mono_raise_exception to raise the same exception. Unfortunately
that leads to overwriting the initial stack trace, and we end up with a stack
trace that does not include the location where the original exception was
thrown.

So instead of calling mono_raise_exception to rethrow the same exception, we
use ExceptionDispatchInfo, which is able to capture the stack trace for both
the original exception and the new exception, producing the following output:

    System.Exception: USELESS
      at UselessExceptions.ViewController.ViewDidLoad () [0x0000c] in /Users/rolf/Downloads/filed-bug-test-cases-master/Xamarin/bxc45742/ViewController.cs:27
    --- End of stack trace from previous location where exception was thrown ---
      at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
      at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /work/maccore/master/xamarin-macios/src/AppKit/NSApplication.cs:98
      at UselessExceptions.MainClass.Main (System.String[] args) [0x00007] in /Users/rolf/Downloads/filed-bug-test-cases-master/Xamarin/bxc45742/Main.cs:10
    [ERROR] FATAL UNHANDLED EXCEPTION: UselessExceptions.CustomException: USELESS
      at UselessExceptions.ViewController.ViewDidLoad () [0x0000c] in /Users/rolf/Downloads/filed-bug-test-cases-master/Xamarin/bxc45742/ViewController.cs:27
    --- End of stack trace from previous location where exception was thrown ---
      at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
      at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /work/maccore/master/xamarin-macios/src/AppKit/NSApplication.cs:98
      at UselessExceptions.MainClass.Main (System.String[] args) [0x00007] in /Users/rolf/Downloads/filed-bug-test-cases-master/Xamarin/bxc45742/Main.cs:10

Incidently this is how Xamarin.Android does it [1].

[1]: 9387f2fe16

https://bugzilla.xamarin.com/show_bug.cgi?id=45742
2016-10-27 20:03:11 +02:00
Sebastien Pouliot bbcc872f7a Update XML references from XI C8SR1 2016-10-27 11:55:32 -04:00
Vincent Dondain b252093691 [mtouch/tests] Add TimingTests (#1007)
* [mtouch/tests] Add TimingTests

- New MLaunchTool.
- AppLaunchTime (mlaunch): time to launch an application on the simulators.
  How it works: we first open the simulator by launching a dummy app. This allows us to detect if there are any launch watchdogs.
  Therefore, for consistency, all measurements are done with the simulator already open.
  In the case of the AppLaunchTime test, we build the app with the default config and launch it. It's automatically killed by the simulator
  because it does not have a valid entry point but this is fine because it also kills the process and lets us stop the stopwatch.
  We then simply log the time performance.
2016-10-27 14:05:44 +02:00
Sebastien Pouliot 3eb8aae49a Restore bmonorevision to pre-merge 2016-10-26 17:31:10 -04:00
Sebastien Pouliot e9705a7dc6 Remove watch-mono (added back by merge) 2016-10-26 16:34:14 -04:00
Sebastien Pouliot 8c93e7758d Merge branch 'xcode8.1' 2016-10-26 15:56:34 -04:00
Emanuel d8362f6ff6 Fixes Bug #44724 - Failed to read file attributes for "/Users/admin/Assets.xcassets" (#1039)
The ProjectDir could exist under certain circumstances (e.g. referenced assemblies are being copied to the Mac in the same folder path that those are located in Windows) so we cannot assume the existence or not of ProjectDir means the build comes from VS.

The only way to ensure we're building from VS is to check the SessionId parameter.

https://bugzilla.xamarin.com/show_bug.cgi?id=44724
2016-10-26 13:08:11 -04:00
Rolf Bjarne Kvinge e9f125fbcb [mmp] Don't process SDK assemblies for external symbols unless we're embedding mono. Fixes #45902. (#1036)
SDK assemblies might contain P/Invokes to libmono, but unless we link with
mono (which we don't do if we're not embedding mono), the native linker will
complain if we ask it to keep those symbols (using `-u symbol`).

So don't look for __Internal P/Invokes in SDK assemblies in that case.

https://bugzilla.xamarin.com/show_bug.cgi?id=45902
2016-10-26 12:57:11 +02:00
Rolf Bjarne Kvinge 0bb2eb7217 Bump mono to get fixes for #45902 and #45847. (#1035)
The recent BTLS changes causes trouble for both XI and XM,
which should be fixed with this bump:

    commit mono/mono@78619b1580
    Author: Alexander Köplinger <alex.koeplinger@outlook.com>
    Date:   Tue Oct 25 18:44:33 2016 +0200

    [System] Don't build managed BTLS code on monotouch

    After 2fb07d6c6d5b3915ef4665391febbb7b8be09fb5 BTLS can be used as a shared lib,
    but this caused an issue in some monotouch tools which grepped the P/Invokes for `__Internal`
    since these icalls wouldn't resolve on monotouch since BTLS is disabled there.

    Instead, we now completely leave out building the managed parts of BTLS when
    BTLS is not enabled.

    (cherry picked from commit db21455da9d74354b75accafc4e8e3c21466f048)

This bump also includes the fix for #45847:

    commit mono/mono@c023b2b30a
    Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
    Date:   Mon Oct 24 19:50:16 2016 +0200

    [System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.

    The MacProxy class uses CFNetwork, but since CFNetwork is not a public
    framework on watchOS, we can't use it.

    So remove MacProxy completely (it only contains internal classes), and throw
    PlatformNotSupportedException in any API that used it (the managed networking
    stack is not supported on watchOS anyway, so this should be safe).

    https://bugzilla.xamarin.com/show_bug.cgi?id=45847

https://bugzilla.xamarin.com/show_bug.cgi?id=45902
https://bugzilla.xamarin.com/show_bug.cgi?id=45847
2016-10-26 07:14:43 +02:00
Rolf Bjarne Kvinge ca8dc04ddf Revert "Bump mono to get fix for #45847." (#1033) 2016-10-25 20:07:22 +02:00
Rolf Bjarne Kvinge 4e61231137 Bump mono to get fix for #45847. (#1031)
commit mono/mono@c023b2b30a
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Mon Oct 24 19:50:16 2016 +0200

    [System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.

    The MacProxy class uses CFNetwork, but since CFNetwork is not a public
    framework on watchOS, we can't use it.

    So remove MacProxy completely (it only contains internal classes), and throw
    PlatformNotSupportedException in any API that used it (the managed networking
    stack is not supported on watchOS anyway, so this should be safe).

    https://bugzilla.xamarin.com/show_bug.cgi?id=45847
2016-10-25 13:37:28 -04:00
Rolf Bjarne Kvinge b638977c91 Bump maccore to get an mlaunch that works with Xcode 8.1 (#1032) 2016-10-25 13:15:48 -04:00