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

702 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge ffc8dad1ec [tests][intro] Add mapping for SecAccessControl on macOS (#1754)
Wrench is not happy, but jenkins bots are fine. This is likely something
internal to macOS which varies per version.
2017-02-23 09:56:26 -05:00
Rolf Bjarne Kvinge 88c276e0aa [tests][generator] Port XI/Classic tests to XI/Unified. (#1745)
* [tests][generator] Port XI/Classic tests to XI/Unified.

* [tests][generator] Comment out code triggering previously unknown bugs.

These tests makes the generator fail:

    error BI0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
    System.NullReferenceException: Object reference not set to an instance of an object
      at Generator.GetSetterExportAttribute (System.Reflection.PropertyInfo pinfo) [0x0002e] in /work/maccore/master/xamarin-macios/src/generator.cs:1981
      at Generator.Go () [0x007e3] in /work/maccore/master/xamarin-macios/src/generator.cs:2162
      at BindingTouch.Main2 (System.String[] args) [0x010b2] in /work/maccore/master/xamarin-macios/src/btouch.cs:435
      at BindingTouch.Main (System.String[] args) [0x0001d] in /work/maccore/master/xamarin-macios/src/btouch.cs:77
      at System.Environment.get_StackTrace () [0x00000] in /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Environment.cs:321
      at ErrorHelper.ShowInternal (System.Exception e) [0x000dc] in /work/maccore/master/xamarin-macios/src/error.cs:200
      at ErrorHelper.Show (System.Exception e) [0x00027] in /work/maccore/master/xamarin-macios/src/error.cs:151
      at BindingTouch.Main (System.String[] args) [0x0002b] in /work/maccore/master/xamarin-macios/src/btouch.cs:79

This has been filed as https://bugzilla.xamarin.com/show_bug.cgi?id=52664.

* [tests][generator] Comment out code triggering previously unknown bugs.

This has been filed as https://bugzilla.xamarin.com/show_bug.cgi?id=52665.
2017-02-22 16:47:11 +01:00
Rolf Bjarne Kvinge 00874dc1e7 [tests][generator] 'virtualwrap' is a custom test, so put it in the corresponding variable. (#1743)
Fixes this warning:

    Makefile:163: warning: overriding commands for target `virtualwrap'
    Makefile:40: warning: ignoring old commands for target `virtualwrap'
2017-02-22 14:23:45 +01:00
Sebastien Pouliot c43b735bab [corefoundation] Fix CallbackDelegate signature to be 32bits safe (enum). Fixes #52279 (#1714)
The `CFStreamEventType` enum is based on `NSUInteger`. The native delegate
CallbackDelegate was using it directly and that made it incorrect on 32
bits platforms.

We have introspection tests to check enums on p/invoke, but it seems they
don't cover native delegates - decorated with [MonoNativeFunctionWrapper]
That's to be added in a different PR.

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

* [tests][intro] Validate signatures of delegates decorated with [MonoNativeFunctionWrapper]
2017-02-20 08:14:04 -05:00
Rolf Bjarne Kvinge 10890b020c Bump to a mlaunch that hopefully fixes #50419. (#1424)
https://bugzilla.xamarin.com/show_bug.cgi?id=50419
2017-02-17 16:03:40 +01:00
Rolf Bjarne Kvinge e8fbb7f0a6 [tests][mtouch] There's no need to delete a temporary directory we create ourselves. (#1711)
Deleting the directory when the test completes just makes it harder to copy-
paste the failing command.

Any directories created by Cache.CreateTemporaryDirectory will automatically
be deleted at the next test run, so this won't use up disk space.
2017-02-17 16:01:05 +01:00
Rolf Bjarne Kvinge cf14456cd5 [mtouch] Add docs and improve MT4146 to be an error if we can detect the generated code won't compile. Fixes #52530. (#1712)
https://bugzilla.xamarin.com/show_bug.cgi?id=52530
2017-02-17 16:00:53 +01:00
Alex Soto a021c0cd3c [generator] Have WrapAttribute generate virtual members (#1707)
* [generator] Have WrapAttribute generate virtual members

WrapAttribute now has a boolean optional parameter named isVirtual,
this instructs the generator to add the virtual keyword to generated
members.

This is useful when fixing breaking changes so we can keep the wrong
signature generated instead of having manual code files.

* [docs] Add docs about virtual to WrapAttribute
2017-02-16 17:24:40 -06:00
Rolf Bjarne Kvinge 4a0ffa3110 [mtouch tests] Refactor registrar tests a little bit to not cause trouble in Xamarin Studio. (#1679)
Change how the registrar calls mtouch a bit, so that we don't use API that
throws an exception with the entire output in the exception message.

The problem is that if the process has a lot of output, XS slows down to a
crawl when showing the exception message in the test result pad.

Instead print the output to the terminal.
2017-02-10 18:24:37 +01:00
Rolf Bjarne Kvinge d3137d0b95 [tests/link sdk] Fix watchOS version check. (#1678)
* [tests/link sdk] Remove defines that are set by default.

And these defines varies by platform, which means they're not correct for tvOS/watchOS.

* [tests/link sdk] Fix watchOS version check.
2017-02-10 18:22:46 +01:00
Rolf Bjarne Kvinge 0e27b4a812 [mtouch tests] Add sleep to fix #47696. (#1662)
Sometimes, when the stars align, fastsim can build an app in less than a
second.

Coupled with the fact that HFS+'s filestamp resolution is 1 second, we can't
assert that filestamps change without making sure enough time passes by.

So sleep for a second.

https://bugzilla.xamarin.com/show_bug.cgi?id=47696
2017-02-09 11:53:18 +01:00
Chris Hamons 2c835c5294 [XM] Add hybrid/standard AOT option and improve AOT code (#1650)
* [XM] Seperate parsing from compilation in AOT code

- Parsing command line options was too entangled with actually compiling
- Refactor test code to centralize Compile, reducing some complexity of tests
- Groundwork for hybrid vs non-hybrid AOT work

* Add hybrid/standard AOT support

* Add xammac_tests to makefile/jenkins

* Add flag to force AOT

* Disable MonoTouchFixtures.Contacts.ContactStoreTest.GetUnifiedContacts on XM due to prompts on Jenkins
2017-02-08 13:40:48 -06:00
Rolf Bjarne Kvinge a22cda6eb3 [mtouch tests] Adjust FastDev_LinkWithTest after fe17d5db9f. (#1633)
We disabled fastdev for tvOS/watchOS projects with binding projects in
bac02538, and that broke the FastDev_LinkWithTest:

    Errors and Failures:
    1) Test Failure : Xamarin.MTouch.FastDev_LinkWithTest(TVOS)
         Binding symbol not in executable
      Expected: no item String ending with " T _theUltimateAnswer"
      But was:  < ... >

So adjust the test to match the new behavior.
2017-02-03 11:02:07 +01:00
Rolf Bjarne Kvinge e3eedb62d3 [mmptest] Use the right location for mono64. (#1630) 2017-02-03 09:24:35 +01:00
Rolf Bjarne Kvinge 68415e88c5 [mtouch] Fix build error with fastdev & libpinvokes & paths with spaces. (#1618) 2017-02-02 18:09:42 +01:00
Chris Hamons 1db1ce5a40 [XM] Add BCL tests (#1447) 2017-02-01 11:05:08 -05:00
Timothy Risi 48682b27aa Resource files for mac should be copied to the app bundle (#1500)
Resource files for mac should be copied to the app bundle
* Move the Satellite code used by mac to tools/common/Assembly.cs
* Add EmbeddedResources test to xammac_tests
2017-01-31 15:59:08 -09:00
Timothy Risi f3ebfc3cce Fix NSOpenGLPixelFormat ConvertToAttributes method (#1539)
Fix NSOpenGLPixelFormat ConvertToAttributes

* Add OpenGLProfile to list of NSOpenGLPixelFormatAttributes that require a value.  Check for 0 terminating the array
* Use InitializeHandle instead of 'Handle = '
* Add tests
2017-01-31 15:52:09 -09:00
Sebastien Pouliot de090b86d4 [tests][macos][intro] Fix XM classic introspection tests. Fixes #52065 (#1595) (#1597)
The latest Sierra had a few surprises:

* CITextFeature is now 64bits only;
* The MediaPlayer framework is now 64bits only [1]

Both made the classic tests fails for XM.

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=52065
2017-01-31 14:45:30 -05:00
Rolf Bjarne Kvinge 76587376e9 [xharness] Fix code to compile with csc. (#1586) 2017-01-30 10:04:59 +01:00
Rolf Bjarne Kvinge 8b17770d36 [xharness] Make 'IncludeMac' an general switch for all macOS tests. (#1582) 2017-01-27 18:24:10 +01:00
Rolf Bjarne Kvinge 71e61b4b04 [xharness] Always add the mmp test to the list of tests, but mark it as ignored when it shouldn't be executed. (#1580) 2017-01-27 17:02:21 +01:00
Rolf Bjarne Kvinge c0c1136d70 [xharness] Get the INCLUDE_ make variables and disable tests accordingly. (#1578) 2017-01-27 10:52:49 +01:00
Rolf Bjarne Kvinge 92659752df [xharness] No need to run the mac binding projects twice. (#1577) 2017-01-27 10:36:09 +01:00
Rolf Bjarne Kvinge 47a7568f9b [tests] Refactor many of the mtouch tests to use new testing infrastructure. (#1569)
This makes a couple of future optimizations easier:

* Cache the compilation of test assemblies.
* Load mtouch.exe directly in the test process.
2017-01-27 07:35:32 +01:00
Rolf Bjarne Kvinge 98feef8dff [tests] The mtouch tests now require Cecil, so add the expected project reference to the solution. (#1568) 2017-01-27 07:32:44 +01:00
Rolf Bjarne Kvinge f24c8f7331 [docs] Update text about MT4134 to not mention the legacy registrar anymore. (#1558)
Since the legacy registrar is not available anymore.
2017-01-26 15:31:26 +01:00
Alex Soto 1799c2f489 [generator] Add BindAs support (#1476)
* [generator] Add BindAs support for NSValue and NSNumber
https://trello.com/c/RYCPEnkh

The intent of BindAs attribute is to have a binding definition as

	[return: BindAs (typeof (bool?))]
	[Export ("boolMethod:")]
	NSNumber BoolMethod (int arg1);

and our generator outputs

	[Export ("boolMethod:")]
	public virtual global::System.Nullable<bool> BoolMethod (int arg1) { ...  }

So we internally do the NSNumber <-> bool conversion, this also
applies to properties, parameters and methods.

* [generator] Fix a small formating issue

* [tests] Add BindAsAttribute generator tests

* [generator] Implement @spouliot's feedback

* [tests] Add BI1048 and BI1049 error tests for [BindAs]

* [generator] Implement Rolf's suggestion to avoid almost all string comparisons in [BindAs] for types

* [generator] Add BindAs support for smart enums and arrays with tests

* [generator] Some code clean up and implementation of PR feedback

* [generator] Add Protocol|Model checks and tests also a NRE check in NSArray creator

BindAs attribute cannot be used in Protocol|Model interfaces

* [generator] Add NSNumber <-> Enum support

* [docs] add BindAs documentation

* [docs] Implement documentation feedback for BindAs
2017-01-25 07:14:55 +01:00
Rolf Bjarne Kvinge 3dac0bae81 Use @rpath instead of @executable_path in dylibs. (#1552)
Use @rpath instead of @executable_path in dylibs, since it allows us to be
more flexible when placing dylibs in the app.

In particular with this change it's trivial to put libmonosgen-2.0.dylib in
the container app, and reference it from extensions.
2017-01-24 20:24:32 +01:00
Vlad Brezae cd9292ffdd Enable selecting the sgen major mode (#1546)
* [mmp/mtouch] Add option for concurrent sgen

* [msbuild] Add support for concurrent sgen properties

* [mmp] Test for concurrent sgen option
2017-01-24 07:28:15 +01:00
Rolf Bjarne Kvinge 025226999a [tests] Sleep a bit to work around HFS' lack of sub-second timestamp values. (#1541)
HFS timestamp resolution is 1 second, which means that we can't distinguish
files modified again within 1 second. This means that this test will fail more
often the faster we make mtouch, so add a forced sleep to make sure we don't
do things faster than the file system can keep track of.
2017-01-20 16:55:08 +01:00
Rolf Bjarne Kvinge 1a7a4ab463 [mtouch] Add support for specifying how to optimize LLVM output. (#1532)
Performance tests
-----------------

This is for a new watchOS extension project, built for release.

* The default (currently -O2) optimizations:      41s (  baseline )  30.027.060 bytes (     baseline    )
* All optimizations disabled (`--llvm-opt=all=`): 17s (-24s = -59%)  32.978.312 bytes (+2.951.252 = +10%)
* Optimized for size (`--llvm-opt=all=-Os`):      36s ( -5s = -12%)  28.617.408 bytes (-1.409.652 =  -5%)
* Optimized for more size (`--llvm-opt=all=-Oz`): 35s ( -6s = -15%)  28.601.016 bytes (-1.426.044 =  -5%)
* Optimized slightly (`--llvm-opt=all=-O1`):      35s ( -6s = -15%)  28.666.556 bytes (-1.360.504 =  -5%)
* Optimized a lot (`--llvm-opt=all=-O3`):         41s (  0s =   0%)  30.403.996 bytes (+  376.936 =  +1%)

Conclusions
-----------

* The fastest build by far (less than twice as fast) is if optimizations are
  disabled, but this adds a 10% size penalty (~3 MB in this test case),
  compared to the baseline, and 15% size penalty (4.3 MB) compared to -Oz.
* -Oz seems to have the best overall results: at least as fast as any other
  optimized build, and the smallest app as well.

Caveats
-------

Some optimizations might not work the AOT compiled code. The resulting
binaries have not been tested.
2017-01-20 16:11:48 +01:00
Rolf Bjarne Kvinge 786ae13f80 [mtouch] Fix an unnecessary re-link when the linker copies assemblies without processing them. (#1534)
Event sequence:

* mtouch is executed with the linker disabled.
* The linker pipeline copies all input assemblies (since the linker is
  disabled the assemblies don't change) into the PreBuild directory. This will
  keep the original timestamps of the input assemblies.
* mtouch is executed again, when none of the input assemblies changed.
* The linker pipeline will re-execute, because it will see that at least one
  of the input assemblies (at least the .exe) is newer than at least one of
  the assemblies in the PreBuild directory (usually a framework assembly,
  because those have the original timestamp from their install location).

Fix:

Touch all the assemblies in the PreBuild directory after the linker pipeline
executes the first time. This way the second time mtouch is executed, it will
find that all assemblies in the PreBuild directory have timestamps later than
all the input assemblies, so it will load the cached linked assemblies,
instead of re-executing the linker pipeline.
2017-01-20 10:45:08 +01:00
Rolf Bjarne Kvinge 72080fb320 [xharness] Lines containing 'ghprbPull' are probably not build errors. (#1537) 2017-01-20 10:43:49 +01:00
Rolf Bjarne Kvinge da690aff81 [xharness] Show test xml files in the html report. (#1535)
* [xharness] Show test xml files in the html report.

* [xharness] Force links to xml files to show up in a new top-level window.

Jenkins shows the html report in an iframe, and links will load in that
iframe. This means that the browser renders the contents of the link as if it
was html, and rendering xml as html results in a blank page.

So set the target attribute on links to xml files, so that those xml files
open as top-level pages, and then the browser will rendering the xml like xml.
2017-01-20 10:42:55 +01:00
Rolf Bjarne Kvinge 38261db8ae [xharness] Don't autorefresh the html report if not in server mode. (#1538) 2017-01-20 10:39:24 +01:00
Sebastien Pouliot e72b654890 [linker] Inline BinaryCompatibility.TargetsAtLeast_Desktop_V4_5[_1] (#1518)
This is a more interesting case since the inlining of 2 property getters
has a deeper impact and removes other types/methods from the final app.

Here we don't care what's inside the code we replace - only that it
always return a constant boolean after evaluation. That _constant_ is
something we can add tests to ensure we continue to behave identically.

```
--- before	2017-01-16 14:58:12.000000000 -0500
+++ after	2017-01-16 14:58:09.000000000 -0500
@@ -1580,7 +1580,6 @@
 System.String System.AppDomain::get_BaseDirectory()
 System.String System.AppDomain::get_FriendlyName()
 System.String System.AppDomain::getFriendlyName()
-System.String System.AppDomain::GetTargetFrameworkName()
 System.String System.AppDomain::ToString()
 System.UnhandledExceptionEventHandler System.AppDomain::UnhandledException
 System.UnhandledExceptionEventHandler System.AppDomain::UnhandledException
@@ -11949,54 +11948,12 @@
 System.Reflection.FieldInfo System.Runtime.Serialization.ValueTypeFixupInfo::ParentField()
 System.Runtime.Serialization.ValueTypeFixupInfo
 System.Void System.Runtime.Serialization.ValueTypeFixupInfo::.ctor(System.Int64,System.Reflection.FieldInfo,System.Int32[])
-System.Runtime.Versioning.BinaryCompatibility
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Desktop_V4_5
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Desktop_V4_5_1
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Desktop_V4_5_2
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Desktop_V4_5_3
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Desktop_V4_5_4
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Desktop_V5_0
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Phone_V7_1
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Phone_V8_0
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Silverlight_V4
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Silverlight_V5
-System.Boolean System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::TargetsAtLeast_Silverlight_V6
-System.Boolean System.Runtime.Versioning.BinaryCompatibility::get_TargetsAtLeast_Desktop_V4_5()
-System.Boolean System.Runtime.Versioning.BinaryCompatibility::get_TargetsAtLeast_Desktop_V4_5_1()
-System.Boolean System.Runtime.Versioning.BinaryCompatibility::ParseTargetFrameworkMonikerIntoEnum(System.String,System.Runtime.Versioning.TargetFrameworkId&,System.Int32&)
-System.Boolean System.Runtime.Versioning.BinaryCompatibility::TargetsAtLeast_Desktop_V4_5()
-System.Boolean System.Runtime.Versioning.BinaryCompatibility::TargetsAtLeast_Desktop_V4_5_1()
-System.Int32 System.Runtime.Versioning.BinaryCompatibility::AppWasBuiltForVersion()
-System.Int32 System.Runtime.Versioning.BinaryCompatibility::get_AppWasBuiltForVersion()
-System.Int32 System.Runtime.Versioning.BinaryCompatibility::s_AppWasBuiltForVersion
-System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap
-System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap System.Runtime.Versioning.BinaryCompatibility::s_map
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.BinaryCompatibility::AppWasBuiltForFramework()
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.BinaryCompatibility::get_AppWasBuiltForFramework()
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.BinaryCompatibility::s_AppWasBuiltForFramework
-System.Void System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::.ctor()
-System.Void System.Runtime.Versioning.BinaryCompatibility/BinaryCompatibilityMap::AddQuirksForFramework(System.Runtime.Versioning.TargetFrameworkId,System.Int32)
-System.Void System.Runtime.Versioning.BinaryCompatibility::.cctor()
-System.Void System.Runtime.Versioning.BinaryCompatibility::ParseFrameworkName(System.String,System.String&,System.Int32&,System.String&)
-System.Void System.Runtime.Versioning.BinaryCompatibility::ReadTargetFrameworkId()
-System.Runtime.Versioning.CompatibilitySwitch
-System.String System.Runtime.Versioning.CompatibilitySwitch::GetValueInternal(System.String)
 System.Runtime.Versioning.TargetFrameworkAttribute
 System.String System.Runtime.Versioning.TargetFrameworkAttribute::_frameworkDisplayName
 System.String System.Runtime.Versioning.TargetFrameworkAttribute::_frameworkName
 System.String System.Runtime.Versioning.TargetFrameworkAttribute::FrameworkDisplayName()
 System.Void System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(System.String)
 System.Void System.Runtime.Versioning.TargetFrameworkAttribute::set_FrameworkDisplayName(System.String)
-System.Int32 System.Runtime.Versioning.TargetFrameworkId::value__
-System.Runtime.Versioning.TargetFrameworkId
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::NetCore
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::NetFramework
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::NotYetChecked
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::Phone
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::Portable
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::Silverlight
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::Unrecognized
-System.Runtime.Versioning.TargetFrameworkId System.Runtime.Versioning.TargetFrameworkId::Unspecified
 System.IntPtr System.RuntimeArgumentHandle::args
 System.RuntimeArgumentHandle
 System.Boolean System.RuntimeFieldHandle::Equals(System.Object)
```

```
Statistics

Native subtotal           35,729,800   35,728,760       -1,040       0.00 %
    Executable            29,270,272   29,270,240          -32       0.00 %
    AOT data *.aotdata     6,459,528    6,458,520       -1,008      -0.02 %

Managed *.dll/exe          4,537,344    4,532,736       -4,608      -0.10 %

TOTAL                     40,581,685   40,576,037       -5,648      -0.01 %
```
2017-01-19 08:45:19 -05:00
Rolf Bjarne Kvinge 2d104f32d9 [mtouch] Make sure native symbols from third-party libraries are preserved in dylibs. Fixes #51548.
The native linker treats object files (.o) and static libraries (.a files,
which are archives of .o files) differently.

The native linker will always include object files into the executable:

	$ echo "void xxx () {}" > foo.m
	$ clang -c foo.m -o foo.o -arch x86_64
	$ ld foo.o -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64
	$ nm foo.dylib
	0000000000000fe0 T _xxx

However, if the object file is inside a static library:

	$ echo "void xxx () {}" > foo.m
	$ clang -c foo.m -o foo.o -arch x86_64
	$ ar cru foo.a foo.o
	$ ld foo.a -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64
	$ nm foo.dylib
	<no output>

This means that our testing library (libtest.a) which is a fat library of
_object files_, do not show the problems reported in bug #51548.

So:

a) I've fixed the creation of libtest.a to be a fat library of _static
   libraries_. This causes the `FastDev_LinkWithTest` test to fail exactly
   like in bug #51548.

b) I've made mtouch pass `-u <native symbol>` to the native linker, for every
   native symbol referenced in a managed assembly, when creating a dylib.
   Amazingly this seems to work fine even with symbols to Objective-C classes
   (`_OBJC_CLASS_$_<class name>`).

c) This also required adding support for collecting the Objective-C names of
   all managed types registered with Objective-C to the linker. The
   information is already available in the static registrar, but that would
   require us to make sure the static registrar is executed before compiling
   dylibs, which means those two tasks won't be able to run in parallel (also
   there's no guarantee we'll even run the static registrar).

https://bugzilla.xamarin.com/show_bug.cgi?id=51548
2017-01-18 12:33:06 +01:00
Sebastien Pouliot 00b1c09acb [linker] Add an well known candidate inliner substep along with tests (#1513)
TL&DR: This is *how* it should be done and tested, it's not complete
(single, simple case) nor the most interesting case ;-)

The trick is to make sure each case is covered by tests so a mono
_bump_ won't give us a BCL that does not conform to what the linker
expect.

What's the impact ?

1. There is the expected reduction of metadata in mscorlib. Since both
   methods don't call other API there's no indirect effect (removal).

--- before	2017-01-15 11:12:44.000000000 -0500
+++ after	2017-01-15 11:12:56.000000000 -0500
@@ -13166,9 +13166,6 @@
 System.Void System.Security.SecurityException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)
 System.Void System.Security.SecurityException::.ctor(System.String)
 System.Void System.Security.SecurityException::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)
-System.Boolean System.Security.SecurityManager::CheckElevatedPermissions()
-System.Security.SecurityManager
-System.Void System.Security.SecurityManager::EnsureElevatedPermissions()
 System.Security.SecurityRulesAttribute
 System.Security.SecurityRuleSet System.Security.SecurityRulesAttribute::m_ruleSet
 System.Void System.Security.SecurityRulesAttribute::.ctor(System.Security.SecurityRuleSet)

2. There is no visible size change (even with #1) in mscorlib.dll due to
   padding (compiler /filealign)

   mscorlib.dll                793,600      793,600            0       0.00 %

3. there's a *very* small reduction of mscorlib.*.aotdata size

   mscorlib.armv7.aotdata      717,264      717,216          -48      -0.01 %
   mscorlib.arm64.aotdata      712,840      712,704         -136      -0.02 %

   AOT data *.aotdata        6,460,064    6,459,880         -184       0.00 %

4. there's no change in executable size - normal as the AOT compiler has
   _likely_ already doing the same optimization (before this commit)

   Executable               29,270,272   29,270,272            0       0.00 %

Full comparison: https://gist.github.com/spouliot/0464c8fa3a92b6486dfd90595d9eb718
2017-01-17 21:49:44 -05:00
Chris Hamons 482ab9051f [XM] Rework binding project test to try to fix build machine issues (#1474)
- https://bugzilla.xamarin.com/show_bug.cgi?id=50634
2017-01-17 10:06:10 -06:00
Rolf Bjarne Kvinge 6fe1c9feab [tests] Use a different bundle id for different apps that can be installed on the same device. (#1509)
* [tests] Use a different bundle id for different apps that can be installed on the same device.

* [xharness] Add workaround for radar #29847128.
2017-01-16 18:34:57 +01:00
Rolf Bjarne Kvinge 3a480b53bf Merge pull request #1506 from rolfbjarne/mtouch-single-invocation
[mtouch] Build extensions and the container app in the same mtouch process.
2017-01-16 18:33:42 +01:00
Rolf Bjarne Kvinge babe01d42e [tests] Automatically run today extension test runs, since there's no UI to manually start it. (#1501) 2017-01-16 16:24:44 +01:00
Rolf Bjarne Kvinge 787c63766e [xharness] Fix generation of today extension projects to work from Xamarin Studio. (#1502)
Minor tweaks to make the solutions/project files usable from the IDE, and not
only the command line.
2017-01-16 16:23:49 +01:00
Rolf Bjarne Kvinge 6a780e76f0 [xharness] Fix today extension's project references. (#1504) 2017-01-16 16:18:53 +01:00
Rolf Bjarne Kvinge 65111d9e83 [xharness] Fix the name of referenced projects in derived projects. (#1503)
System.IO.Path expects unix-style directory separators, but MSBuild expects
window-style directory separators, so make sure to not confuse those.
2017-01-16 16:18:48 +01:00
Rolf Bjarne Kvinge 53fc697aad [mtouch] Refactor command-line parsing to be reusable.
Also add a few tests to verify how we treat the root assembly (or lack
thereof).
2017-01-16 13:52:37 +01:00
Rolf Bjarne Kvinge 5f26772e1b [xharness] Add button to hide/show debug log in web page (and default to hidden). (#1490) 2017-01-16 07:32:28 +01:00
Rolf Bjarne Kvinge a02fb1d62e [xharness] Fix log stream handling. (#1494)
Don't create multiple writer streams for the same underlying file, instead
store the writer stream on the log instance, and return it whenever needed.

This fixes an issue where there would be multiple writer streams, which could
cause exceptions when creating more writer streams (access defined errors
because the file is already open).
2017-01-16 07:30:57 +01:00
Rolf Bjarne Kvinge 9f02c44613 [xharness] Add support for using the system's Xamarin.iOS/Xamarin.Mac instead of a locally build one. (#1498)
* [tests] Use the target directory from the loaded configuration.

* [xharness] Find the root directory based on xharness.exe's location (unless specified).

* [tests] Add makefile target to generate test config using the system XI.
2017-01-16 07:24:14 +01:00