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

221 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 1c81c8a5a8 [mtouch] Improve logging a bit. (#1071)
* Show log statements from assembly comparison.
2016-10-31 16:53:02 -04:00
Rolf Bjarne Kvinge e8789f2af6 [mtouch] Copy frameworks referenced by watch extensions to the bundle. (#1070)
Watch extensions do not have access to the containing app bundle on the phone,
so instead copy frameworks to the extension itself.
2016-10-31 17:02:37 +01:00
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
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
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 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
Rolf Bjarne Kvinge a1644f6e13 [registrar] Improve an error message. (#1047) 2016-10-28 08:38:38 -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
Sebastien Pouliot 81c94cd683 Update XML definition for XM C8SR1 (from cycle8 branch) 2016-10-27 18:37:25 -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
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
Sebastien Pouliot bbcc872f7a Update XML references from XI C8SR1 2016-10-27 11:55:32 -04:00
Sebastien Pouliot 8c93e7758d Merge branch 'xcode8.1' 2016-10-26 15:56:34 -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
Chris Hamons 448b78c47d [XM] Add StringComparison.Ordinal tweak just like c533db66bf (#1006) 2016-10-20 08:34:26 -05:00
Rolf Bjarne Kvinge 0dd27141d6 [mtouch/mmp] Fix check if an assembly is a framework assembly. Fixes #36109. (#1000)
Fix check if an assembly is a framework assembly to take into account symlinks.

https://bugzilla.xamarin.com/show_bug.cgi?id=36109
2016-10-14 14:14:27 -04:00
Rolf Bjarne Kvinge cf0be91860 [mtouch] CoreAudioKit didn't exist in the simulator until iOS 9. Fixes #44996. (#998)
https://bugzilla.xamarin.com/show_bug.cgi?id=44996
2016-10-14 18:56:08 +02:00
Rolf Bjarne Kvinge 2c950a84ea [mtouch] Treat P/Invokes to 'sqlite3' as equal to 'libsqlite3'. Fixes #42372. (#996)
https://bugzilla.xamarin.com/show_bug.cgi?id=42372
2016-10-14 12:34:51 +02:00
Rolf Bjarne Kvinge c533db66bf [mtouch] Always use ordinal string comparisons. (#995) 2016-10-14 12:34:35 +02:00
Rolf Bjarne Kvinge 2a9f5a8238 Merge pull request #988 from rolfbjarne/bug44709d
Unify stret detection between the generator and platform assemblies, and fix stret detection on watchOS. Fixes #44709.
2016-10-13 19:44:02 +02:00
Chris Hamons 17bb354dca [XM] Fix 44707 by fixing launcher and mmp (#971)
- https://bugzilla.xamarin.com/show_bug.cgi?id=44707
- Sets MONO_CFG_DIR to work around embedding API bug: https://bugzilla.xamarin.com/show_bug.cgi?id=45279
- Added ability to run single XM test by setting XM_TEST_NAME to full test name.
2016-10-13 10:42:05 -05:00
Rolf Bjarne Kvinge 9d85ca79ab Unify stret detection between the generator and platform assemblies, and fix stret detection on watchOS. Fixes #44709.
Unify the code to determine whether a particular return type requires a stret
signature or not between the generator and platform assemblies.

Also fix the stret detection for armv7k, whose calling convention is not
identical to armv7(s): there's the concept of homogeneous structures, which
contains multiple elements of only one type, and which is sometimes passed in
registers on armv7k.

https://bugzilla.xamarin.com/show_bug.cgi?id=44709
2016-10-13 17:35:51 +02:00
Rolf Bjarne Kvinge 084e691be2 [src] Make sure to always set all variants of our conditional compilation symbols. (#986)
For Unified, set XAMCORE_2_0, UNIFIED and __UNIFIED__.

For Xamarin.iOS/tvOS/watchOS set both the normal and underscored versions
(IOS and __IOS__, TVOS and __TVOS__, and WATCHOS and __WATCHOS__).

The underscored versions are the public symbols we're setting in the
corresponding projects, so we should use those everywhere to simplify our
code, but due to historical reasons we're still using the other variants in
existing code.

Making sure all the possible variants are set for all projects, makes it
possible to only use the underscored versions in new code.

Also define `GENERATOR` for the generator, so that we can easily share
files between the generator and platform assemblies.
2016-10-13 15:10:24 +02:00
Rolf Bjarne Kvinge 2f60dd2220 [mtouch] Fix NullReferenceException in PInvoke wrapper generation. Fixes #44763. (#956)
Fix NullReferenceException in PInvoke wrapper generation when incremental
builds are enabled and the linker didn't run because cached results were
found.

https://bugzilla.xamarin.com/show_bug.cgi?id=44763
2016-10-06 16:13:01 +02:00
Rolf Bjarne Kvinge b2634bce56 [mtouch] Set install_name for libpinvokes.dylib. Fixes #44775. (#955)
https://bugzilla.xamarin.com/show_bug.cgi?id=44775
2016-10-06 15:17:40 +02:00
Rolf Bjarne Kvinge 7e1d9820b3 [mtouch] Bundle libpinvokes.dylib in the app. (#954)
Building a dylib is somewhat useless unless it ends up in the app bundle.
2016-10-06 14:16:55 +02:00
Rolf Bjarne Kvinge 6f60992290 [mtouch] Build with -debug so that we get debug information and thus source code location in stack traces. (#953) 2016-10-06 10:24:09 +02:00
Chris Hamons 4bb4e2629d [XM] Teach mmp to set xamarin_debug_mode so mono will read mdb files (#951) 2016-10-06 07:05:12 +02:00
Rolf Bjarne Kvinge d1361d963e Merge pull request #933 from rolfbjarne/watchos-network-api
Bump [watch-]mono to get more API removal for watchOS.
2016-10-04 19:47:10 +02:00
Rolf Bjarne Kvinge 1fdd17e611 [mtouch] Add (another) workaround for file descriptor leak in System.Diagnostics.Process. (#934) 2016-10-03 20:02:28 +02:00
Rolf Bjarne Kvinge a3939b100f [mtouch] Tell Cecil to load assemblies in memory unless they're big assemblies. (#935)
In the recent Cecil update Cecil changed from loading assemblies in memory to
keep a FileStream around and read whenever necessary [1].

This is problematic for us, because we need all the AssemblyDefinitions in
memory at once, and if there are many assemblies, then we'll run into problems
due to the number of file descriptors in use.

So revert to the behavior for the old Cecil: loading assemblies in memory,
unless the assemblies are big, since in that case we might run out of memory
otherwise.

http://cecil.pe/post/149243207656/mono-cecil-010-beta-1
2016-10-03 13:44:51 -04:00
Rolf Bjarne Kvinge c4f4056b22 Bump [watch-]mono to get more API removal for watchOS. 2016-10-03 18:31:04 +02:00
Rolf Bjarne Kvinge 0fa4235097 [mtouch] Don't do any TLS processing in the linker for watchOS.
Don't do any TLS processing in the linker for watchOS, because on watchOS we
don't have (managed) TLS.
2016-10-03 18:31:04 +02:00
Rolf Bjarne Kvinge 0863e412b4 Remove XI/Classic support (#926)
* [tests] Remove Classic SDK tests.

* Remove XI/Classic support.

This also means we can remove support for the legacy registrars.

* [monotouch-test] Remove legacy registrar tests.

* [tests/mtouch] Remove Classic tests (and legacy registrar logic).

* [tests/scripted] Fix tests to reference Xamarin.iOS.dll.
2016-09-30 15:02:17 -04:00
Rolf Bjarne Kvinge 4d06d05cc0 [mtouch] Add workaround for file descriptor leak in System.Diagnostics.Process. (#917) 2016-09-29 17:45:23 +02:00
Rolf Bjarne Kvinge b58b36178b Update list of Facade assemblies. (#916)
These assemblies were added here: 919b89954a
2016-09-29 16:12:31 +02:00
Sebastien Pouliot 9fda816230 [mtouch][linker] Use correct error code for CoreOptimizeGeneratedCode (#915)
Previous PR [1] has the right documentation but the wrong source code.

[1] https://github.com/xamarin/xamarin-macios/pull/903
2016-09-28 23:16:03 -04:00
Sebastien Pouliot 5b80e7f85c [mtouch][linker] Provide a more specific error code when OptimizeGeneratedCodeSubStep fails (#903)
The MT2001 error is a general, something went bad, in the linker code
base. The stack trace is often enough to track down issues but in some
cases it would be easier to ask customers for a specific assembly
(rather than their complete project) to investigate an issue.

Example:

error MT2103: Binding Optimizer failed processing `System.Void GoogleConversionTracking.Unified.GoogleConversionPing::.ctor()`.
--- inner exception
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessIsDirectBinding (Mono.Cecil.MethodDefinition caller, Mono.Cecil.Cil.Instruction ins) [0x00026] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:264
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessCalls (Mono.Cecil.MethodDefinition caller, Int32 i) [0x00337] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:197
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.Process (Mono.Cecil.MethodDefinition method) [0x0007b] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:81
  at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00004] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:48
---
  at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00014] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:50
  at Mono.Tuner.SubStepDispatcher.DispatchMethod (Mono.Cecil.MethodDefinition method) [0x0001d] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:215
  at Mono.Tuner.SubStepDispatcher.BrowseMethods (ICollection methods) [0x0001c] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:167
  at Mono.Tuner.SubStepDispatcher.BrowseTypes (ICollection types) [0x0006b] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:145
  at Mono.Tuner.SubStepDispatcher.BrowseAssemblies (IEnumerable`1 assemblies) [0x00050] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:123
  at Mono.Tuner.SubStepDispatcher.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:104
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/linker/Mono.Linker/Pipeline.cs:118
  at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1& assemblies) [0x000ac] in /Users/poupou/git/xamarin/xamarin-macios/tools/mtouch/Tuning.cs:79

Right now the MT2001 would only include the inner exception, which does
not include any clue to which assembly caused the exception.

Note: The same pattern to be applied to other BaseSubStep subclasses in
separate commits.

Related to (but not the fix for) https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-28 11:46:14 -04:00
Sebastien Pouliot da60263a0a [mtouch] Fix NRE when optimizing bindings. Fixes #44701 (#900)
Some binding assemblies contains extra, unneeded code, generated by the C# compiler, e.g.

IL_002f: stloc.0
IL_0030: ldloc.0

which the binding optimizer did not expect.

https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-27 16:09:42 -04:00
Sebastien Pouliot 4ab6730dd2 [mtouch] Update script to use mono64. Fixes #44122 and others (#887)
Our move to open source and the mtouch/mlaunch split changed mtouch from
a 64bits to a 32bits application (because mono is, by default, still
32bits on OSX).

That's the cause for several recent bugs

* https://bugzilla.xamarin.com/show_bug.cgi?id=44122
* https://bugzilla.xamarin.com/show_bug.cgi?id=44521
* https://bugzilla.xamarin.com/show_bug.cgi?id=44518
* https://bugzilla.xamarin.com/show_bug.cgi?id=44516
2016-09-26 14:47:30 -04:00
Rolf Bjarne Kvinge 86e1e0e882 [mtouch] Show more information about LinkWith attributes. (#895)
* [mtouch] Fix source analysis warning about culture-aware string comparison.

* [mtouch] Show more information about LinkWith attributes.
2016-09-26 16:23:28 +02:00
Rolf Bjarne Kvinge 85cead2337 [mtouch] Don't use nested Parallel.ForEach loops. (#888)
The nested Parallel.ForEach loops don't take into account the outer
MaxDegreeOfParallelism value, causing us to spawn more concurrent tasks than
we want to.

So refactor the code to have one static list of tasks, which each subtask adds
to.
2016-09-23 16:03:23 -04:00
Sebastien Pouliot eb91e692a6 [mtouch] Update script to use mono64. Fixes #44122 and others (#887)
Our move to open source and the mtouch/mlaunch split changed mtouch from
a 64bits to a 32bits application (because mono is, by default, still
32bits on OSX).

That's the cause for several recent bugs

* https://bugzilla.xamarin.com/show_bug.cgi?id=44122
* https://bugzilla.xamarin.com/show_bug.cgi?id=44521
* https://bugzilla.xamarin.com/show_bug.cgi?id=44518
* https://bugzilla.xamarin.com/show_bug.cgi?id=44516
2016-09-23 12:55:11 -04:00
Rolf Bjarne Kvinge 7656a92756 Revert "[mtouch] Don't use nested Parallel.ForEach loops." (#886) 2016-09-23 14:35:43 +02:00
Rolf Bjarne Kvinge fc55e4306f [mtouch] Don't use nested Parallel.ForEach loops. (#881)
The nested Parallel.ForEach loops don't take into account the outer
MaxDegreeOfParallelism value, causing us to spawn more concurrent tasks than
we want to.

So refactor the code to have one static list of tasks, which each subtask adds
to.
2016-09-23 07:02:11 +02:00