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

5301 Коммитов

Автор SHA1 Сообщение Дата
Vincent Dondain f87f3b88f8 [coregraphics] Add 'MatrixOrder' overload for Scale, Rotate and Translate (#5011)
- Fixes #4698: CGAffineTransform.Scale does not work like Swift's .scaledBy(x:y:)
  (https://github.com/xamarin/xamarin-macios/issues/4698)
- 'Scale' monotouch-test now covers the new overload for the new multiplication order.
- Changed the Scale test's values so we have different values for 'x0' (it was always 0 before) and so it matches the test case from the bug report.

* Same fix for Rotate and Translate
2018-10-22 08:42:52 -04:00
Rolf Bjarne Kvinge c378d6baa5
Add a UserType flag for registered types, and use it to improve the performance for is_user_type. (#5017)
* Refactor type map to have a separate flag field for each type instead of magic location in the array.

Refactor the type map to have a separate flag field for each type instead of a
magic location in the array. This simplifies some code, but also allows us to
introduce more flags in the future (which becomes increasingly complex if the
location in the array is to determine yet another value).

This has neglible performance impacts.

* Add a UserType flag for registered types, and use it to improve the performance for is_user_type.

Reflection in the Objective-C runtime is apparently quite slow, so try to
avoid it by computing the information we need for determining whether a
particular Objective-C type represents a user type or not in the static
registrar.

We store this information in a flag for the type in question in the type map,
and use a binary search to search the type map when needed.

This provides a significant improvement, in particular in the dontlink
scenario (probably because there are many more Objective-C types in the app,
which made Objective-C reflection slow). In fact, it somehow made the dontlink
scenario so fast that it's faster than the linkall scenario (which also
improved, but not nearly as much). While quite inexplicable, it's a consistent
result I've seen over multiple test runs.

Numbers
=======

Test case: 004283d7b6

Fix 1 refers to PR #5009.
Fix 2 refers to PR #5013.
Fix 3 refers to PR #5016.
Fix 4 is this fix.

iPad Air 2
----------

| Configuration       | Before | After fix 1 | After fix 2  | After fix 3  | After fix 4  | Improvement from fix 3 to fix 4 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | -----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  | 477 ms |      481 ms |       224 ms |       172 ms |       148 ms |                     24 ms (14%) |           329 ms (69%) |
| Release (dont link) | 738 ms |      656 ms |       377 ms |       201 ms |       146 ms |                     55 ms (27%) |           592 ms (80%) |

iPhone X
--------

| Configuration       | Before | After fix 1 | After fix 2  | After fix 3  | After fix 4  | Improvement from fix 3 to fix 4 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | -----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  |  98 ms |       99 ms |        42 ms |        31 ms |        29 ms |                      2 ms ( 6%) |            69 ms (70%) |
| Release (dont link) | 197 ms |      153 ms |        91 ms |        43 ms |        28 ms |                     15 ms (35%) |           169 ms (86%) |

When linking all assemblies, the type map has 24 entries, and when not linking
at all it has 2993 entries.

This is part 4 (the last) of multiple fixes for #4936.

The total speed-up is 69-86% (3-7x faster).
2018-10-22 07:57:16 +02:00
Rolf Bjarne Kvinge 097e3fc9ce
[Class] Cache the IntPtr constructors in a dictionary. (#5016)
Using reflection to find these constructors is computation-intensitive, so
cache the results.

Numbers
=======

Test case: 004283d7b6

Fix 1 refers to PR #5009.
Fix 2 refers to PR #5013.
Fix 3 is this fix.

iPad Air 2
----------

| Configuration       | Before | After fix 1 | After fix 2  | After fix 3  | Improvement from fix 2 to fix 3 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  | 477 ms |      481 ms |       224 ms |       172 ms |                     52 ms (23%) |           305 ms (64%) |
| Release (dont link) | 738 ms |      656 ms |       377 ms |       201 ms |                    176 ms (47%) |           537 ms (73%) |

iPhone X
--------

| Configuration       | Before | After fix 1 | After fix 2  | After fix 3  | Improvement from fix 2 to fix 3 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  |  98 ms |       99 ms |        42 ms |        31 ms |                     11 ms (26%) |            67 ms (68%) |
| Release (dont link) | 197 ms |      153 ms |        91 ms |        43 ms |                     48 ms (53%) |           154 ms (78%) |

When linking all assemblies, the type map has 24 entries, and when not linking
at all it has 2993 entries.

This is part 3 of multiple fixes for #4936.
2018-10-19 18:33:45 +02:00
Rolf Bjarne Kvinge 1279dd1eaa
Get the F# binaries from macios-binaries instead of building them every time. (#5015)
It's still possible to build from source if desired.

Also remove the fsharp submodule (it will be cloned manually only if building
from source).
2018-10-19 16:54:44 +02:00
Rolf Bjarne Kvinge ac87108152
[Class] Make looking up a System.Type given a native Class instance faster (#5013)
Cache the Class -> System.Type lookup in an array.

I could also have used a dictionary, but there are a couple of disadvantages
compared to the array approach:

* A dictionary would require a lock every time it's read/written to. The array
  is created at launch, and after that we don't have to care about thread
  safety because it's safe to do the slow lookup multiple times.
* Its memory requirements would be higher with more elements (in particular
  since we'd not only need to store the Type instance, but also a boolean
  determining whether it's a user type or not).
* It's ~1% slower (probably due to the lock).

Numbers
=======

Test case: 004283d7b6

Fix 1 refers to PR #5009.
Fix 2 is this fix.

iPad Air 2
----------

| Configuration       | Before | After fix 1 | After fix 2  | Improvement from fix 1 to fix 2 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  | 477 ms |      481 ms |       224 ms |                    257 ms (53%) |           253 ms (53%) |
| Release (dont link) | 738 ms |      656 ms |       377 ms |                    279 ms (43%) |           459 ms (62%) |

iPhone X
--------

| Configuration       | Before | After fix 1 | After fix 2  | Improvement from fix 1 to fix 2 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  |  98 ms |       99 ms |        42 ms |                     57 ms (58%) |            56 ms (57%) |
| Release (dont link) | 197 ms |      153 ms |        91 ms |                     62 ms (41%) |           106 ms (54%) |

When linking all assemblies, the type map has 24 entries, and when not linking
at all it has 2993 entries.

This is part 2 of multiple fixes for #4936.
2018-10-19 16:04:36 +02:00
Rolf Bjarne Kvinge 900356c2e6
[Class] Sort our array of Class -> token references so that we can do binary instead of linear searches in it. (#5009)
Our type map has two sections: first come all the wrapper types, then all the
custom types. This means we need to sort these two sections separately, since
code elsewhere depends on this split in order to determine if a type is a
custom type or not.

We also need a minor modification in the array of skipped types, since it
contained indexes into the type map, which won't be valid after is has been
sorted. Instead store a type reference for the actual type in the array, and
use that to search the type map for the corresponding Class. This is a little
bit slower, but the results are cached in a dictionary, so it'll only happen
once for each type.

The performance is slightly slower when the type map has very few entries, but
that is repaid many times over when the number of entries go up.

Numbers
=======

Test case: 004283d7b6

iPad Air 2
----------

| Configuration       | Before | After  | Improvement   |
| ------------------- | ------ | ------ | ------------: |
| Release (link all)  | 477 ms | 481 ms | -4 ms (-0,8%) |
| Release (dont link) | 738 ms | 656 ms |   82 ms (11%) |

iPhone X
--------

| Configuration       | Before | After  | Improvement |
| ------------------- | ------ | ------ | ----------: |
| Release (link all)  |  98 ms |  99 ms | -1 ms (-1%) |
| Release (dont link) | 197 ms | 153 ms | 44 ms (22%) |

When linking all assemblies, the type map has 24 entries, and when not linking
at all it has 2993 entries.

This is part 1 of multiple fixes for #4936.
2018-10-19 07:33:15 +02:00
monojenkins 1ec90f0fe5 [uikit] Duplicate bindings for 'UIScrollView.ContentOffset' to get correct availability information. Fixes #4893 (#5007)
`ContentOffset` was moved to `UIFocusItemScrollableContainer` in iOS 12.
Since it's a new protocol it's decorated as introduced in iOS 12 - but
the API was actually already available for a long time.

The _trick_ is to keep the original binding inside `UIScrollView`
so it overrides the protocol and keeps the correct availability info.
It requires adding `new` to bindings to avoid compiler warnings.

reference: https://github.com/xamarin/xamarin-macios/issues/4893

---

from @rolfbjarne 

In iOS 12 this property was moved to a protocol, but that protocol's
availability attributes limits it to iOS 12, not iOS 2 where this property was
originally introduced.

This is problematic, because it means we'll throw a
PlatformNotSupportedException if someone tries to call it on 32-bit iOS.

So put the property back on UIScrollView, so that the generated code ends up
with the right availability attributes (and a correct 32-bit implementation).

https://github.com/xamarin/xamarin-macios/pull/5004
2018-10-18 14:37:30 -04:00
Sebastien Pouliot 99641c7fcd
[msbuild] Avoid possible NullReferenceException in ScnToolTaskBase. Fixes #4039 (#5006)
`EnvironmentVariables` can be null (not empty) and cause the NRE in the
attached test case.

It's not clear that the extra logic is needed if we were using `xcrun`.
There's an enhancement for this https://github.com/xamarin/xamarin-macios/issues/4634

reference: https://github.com/xamarin/xamarin-macios/issues/4039
2018-10-18 14:03:17 -04:00
Sebastien Pouliot 5ad55d603e
[tests][linkall] Add a check that the Makefile produced version number is 'legit'. Fixes #4859 (#5005)
History: a marge conflict caused a version string to become "12.3." and
this was found in the API diff much later.

reference: https://github.com/xamarin/xamarin-macios/issues/4859
2018-10-18 11:16:24 -04:00
Miguel de Icaza dca1f4793f [UIKit] UIGestureRecognizer, support a way of unsubscribing without creating cycles (#4729)
* [UIKit] UIGestureRecognizer, support a way of unsubscribing without creating cycles

This now tracks all the uses of AddTarget with delegates by recording
the Token/Selector pair and making `Dispose()` release all the linkage
as well as providing an enumerator that can be used to get all the
registered Action handlers - this can then be used with .First() and
then passed to `RemoveTarget`.

This addresses https://github.com/xamarin/xamarin-macios/issues/4190

This initial patch is here for discussion of the approach, want to
review and test this before we merge.

* Simplify code a little bit.

* Add test.

* [tests] Add an NSAutoreleasePool to make GestureRecognizerTest.NoStrongCycles happy on 32-bit.
2018-10-18 12:31:39 +02:00
Vincent Dondain 3cf004f817
[gamecontroller] Update for Xcode 10.1 beta 2 (#4996) 2018-10-17 15:13:04 -04:00
Rolf Bjarne Kvinge ee1f7dc33d
[CoreFoundation] Implement missing dispatch API. Fixes #4606. (#4967)
* [CoreFoundation] Add DispatchQueue.DispatchBarrierSync.

* [CoreFoundation] Bind dispatch_queue_[set|get]_specific.

* [CoreFoundation] Bind dispatch_queue_get_qos_class.

* [CoreFoundation] Bind dispatch_queue_create_with_target.

* Add tests.

* Update xtro.

* Add missing availability attributes.

* [tests] Do a version check before testing new API.

* Remove redundant code.
2018-10-17 14:42:29 +02:00
Sebastien Pouliot 6751f27841
[tests][mmp] Move TypeDescriptor (regression) tests to unit tests (#4994)
Also move some tests to share more (now and in future commits)
with iOS linker-related tests.

Part of https://github.com/xamarin/xamarin-macios/issues/4975
2018-10-17 08:25:37 -04:00
monojenkins 679619efce [mediaplayer] Fix NRE in MPNowPlayingInfoCenter wrt null dictionary entries. Fixes #4988 (#4997)
The custom `TryGetValue` could return `true` and an `out null`. That was
fine for many items, e.g. converting `null` to `NSString` or `NSDate` is
fine.

However this cause an `NullReferenceException` when trying to create
arrays (thru `NSArray`) or converting `NSNumber` into value types.

The _normal_ `TryGetValue` behavior fixes this - and avoid extraneous
(and non-required) conversions of `null` items.

ref: https://github.com/xamarin/xamarin-macios/issues/4988
2018-10-17 08:23:47 -04:00
Rolf Bjarne Kvinge 6044a74ae2
Bump maccore to get fix for xamarin/maccore#1090. (#4989)
* Bump maccore to get fix for xamarin/maccore#1090.

Diff: 46a1224794...b93ee3155d

* Bump maccore again.

Commit list for xamarin/maccore:

* xamarin/maccore@b35c3a8d76 Build mlaunch with msbuild instead of xbuild. (#1091)

Diff: b93ee3155d...b35c3a8d76
2018-10-17 07:13:25 +02:00
Vincent Dondain 082e36b4c8 [security] Update for Xcode 10.1 beta 2 (#5000) 2018-10-16 20:49:30 -04:00
Vincent Dondain 12c747c598 [intents] Update for Xcode 10.1 beta 3 (#4999) 2018-10-16 20:49:16 -04:00
Vincent Dondain 910b796bf3 [identitylookup] Update for Xcode 10.1 beta 3 (#4998) 2018-10-16 20:49:01 -04:00
Bernhard Urban 8e72ea8330 [tests] improve MonoWeakReferenceTest to avoid false pinning (#4961)
Fixes an issue when executed with interpreter. Now, the test is closer
to what we do in the runtime test:

831e73abcd/mono/tests/weak-fields.cs
831e73abcd/mono/mini/TestHelpers.cs
2018-10-16 14:05:19 -04:00
Vincent Dondain fd293b2d25 [coretelephony] Update for Xcode 10.1 beta 2 (#4993)
Filed radar https://trello.com/c/WKIRTcLk for probably incorrect macOS API.
2018-10-16 14:00:52 -04:00
Sebastien Pouliot e05d87da2a
[mediaplayer] Fix NRE in MPNowPlayingInfoCenter wrt null dictionary entries. Fixes #4988 (#4992)
The custom `TryGetValue` could return `true` and an `out null`. That was
fine for many items, e.g. converting `null` to `NSString` or `NSDate` is
fine.

However this cause an `NullReferenceException` when trying to create
arrays (thru `NSArray`) or converting `NSNumber` into value types.

The _normal_ `TryGetValue` behavior fixes this - and avoid extraneous
(and non-required) conversions of `null` items.

ref: https://github.com/xamarin/xamarin-macios/issues/4988
2018-10-16 13:58:08 -04:00
Sebastien Pouliot e73b1a981e
[mac] Fix logic to include branch name in packages. Fixes #4990 (#4991)
so it can be reported inside VSM.

The logic was not updated (for XM) with the simpler one we can use
on the internal Jenkins bots.

ref: https://github.com/xamarin/xamarin-macios/issues/4990
2018-10-16 13:57:25 -04:00
Bernhard Urban 60b06b9c98 [tests] make Symbols.FunctionNames aware of interpreter (#4973) 2018-10-16 11:25:35 -04:00
Rolf Bjarne Kvinge 13b2647955
Fix the llvm32 build by using Xcode 9.4. (#4985)
Since Xcode 10 doesn't support building 32-bit macOS binaries.
2018-10-16 16:55:11 +02:00
Sebastien Pouliot b2a596d680
Apply XM audit fixes from `xcode10` (#4986)
Backport of
b40230c09d
2018-10-15 20:00:03 -04:00
Vincent Dondain 9e0ab2b5fe Bump for Xcode 10.1 beta 3 (#4987) 2018-10-15 19:57:54 -04:00
Chris Hamons 1082ce7a09
Add xtro test for [Deprecated] attributes and fix up usages (#4966)
- https://github.com/xamarin/xamarin-macios/issues/4431
2018-10-15 10:43:17 -05:00
Sebastien Pouliot e8b87b77d7
[tests][mmp] Convert old mmp calendar regression tests to unit tests (#4983) 2018-10-15 11:15:20 -04:00
Rolf Bjarne Kvinge 250fd976a4
Merge pull request #4111 from radical/msbuild-port
[msbuild] Move from xbuild to msbuild
2018-10-15 16:55:53 +02:00
Rolf Bjarne Kvinge 904be25c25
[xharness] Generate a system variant of dont link, and run it using the oldest mono version we support in Jenkins. Fixes #4121. (#4968)
This is an addition to the tests we already run on older macOS bots (and as such will not execute on our PR bots).

Fixes https://github.com/xamarin/xamarin-macios/issues/4121.
2018-10-15 16:51:46 +02:00
Chris Hamons d29ede7144
[mmp] Include libmono-system-native.a when embedding mono if it exists (#4980) 2018-10-15 09:12:56 -05:00
Sebastien Pouliot 855e682719
[linker] Set flag when processing ParameterInfo.get_Name from XML files. Fixes #4978 (#4981)
Commit 996d90614b fixed the use of XML files. However it did not set the flags so if it's used in both XML and in code then the dictionary is being added twice, which throws an exception like

```
error MT2102: Error processing the method 'System.Boolean SignalGo.Shared.Helpers.ReflectionHelper/d__0::MoveNext()' in the assembly 'SignalGo.Shared.dll': An item with the same key has already been added. Key: System.String System.Reflection.ParameterInfo::get_Name()
```

reference: https://github.com/xamarin/xamarin-macios/issues/4978
2018-10-15 08:26:49 -04:00
Sebastien Pouliot 78af341ca4
[uikit] Duplicate bindings for 'UIScrollView.ContentOffset' to get correct availability information. Fixes #4893 (#4982)
`ContentOffset` was moved to `UIFocusItemScrollableContainer` in iOS 12.
Since it's a new protocol it's decorated as introduced in iOS 12 - but
the API was actually already available for a long time.

The _trick_ is to keep the original binding inside `UIScrollView`
so it overrides the protocol and keeps the correct availability info.
It requires adding `new` to bindings to avoid compiler warnings.

reference: https://github.com/xamarin/xamarin-macios/issues/4893
2018-10-15 08:20:52 -04:00
Rolf Bjarne Kvinge 5fbfacc2a8 [tests] Only restore packages.config, not the mtouch test project.
Restoring the mtouch.csproj makes nuget try to restore Mono.Cecil.csproj as
well, which doesn't work.

So just restore what's listed in our packages.config instead.
2018-10-15 10:41:33 +02:00
Sebastien Pouliot d13f66a497
[appkit] Add missing `[NullAllowed]` on `NSView.NextKeyView`. Fixes #4558 (#4979)
Confirmed with headers.

reference: https://github.com/xamarin/xamarin-macios/issues/4558
2018-10-12 17:09:20 -04:00
Sebastien Pouliot f4dbb6840a
[foundation] Fix inlined 'NSUserActivity (IntentsAdditions)' to work if nothing else from Intents is used. Fixes #4894 (#4974)
The selectors `suggestedInvocationPhrase` and `setSuggestedInvocationPhrase`
needs Intents.framework to be loaded into memory. Otherwise an exception
occurs:

```
Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[NSUserActivity setSuggestedInvocationPhrase:]: unrecognized selector sent to instance 0x19cb3f00
```

When the linker is enabled there's no clue (e.g. namespaces from
preserved types) that `Intents` is required to call the property.

The fix is to provide an hint that will force the linker to keep a type
(a small enum available in all platforms in this case) which tells
`mtouch` (based on the type's namespace) to instruct the native linker
(Apple's `ld`) to [weak]link the Intents.framework in the application
executable.

Note: other selections from the category works fine.

reference:
https://github.com/xamarin/xamarin-macios/issues/4894
2018-10-12 11:56:57 -04:00
Rolf Bjarne Kvinge 40288e4270 Bump mono. (#4971)
Commit list for mono/mono:

* mono/mono@2343f26706 [sdks] Add cmake toolchain file for LLVM MXE builds (#11056)
* mono/mono@46b723d6b0 [2018-06] [sdks] Create archive targets for pre-building on CI (#10936)
* mono/mono@ab3c897d68 Merge pull request #10997 from lewurm/2018-06-interp-fixes-for-native-type
* mono/mono@914a62ab2e [interp] introduce float R4 stack type
* mono/mono@62f23a8365 [interp] support ntype.ToString ()
* mono/mono@2c48c62e66 [interp] support nfloat.*Infinity
* mono/mono@5c5a48b144 [interp] support ntype.Equals ()
* mono/mono@13e412ee52 [interp] support ntype.CompareTo ()
* mono/mono@a576a799b1 [interp] fix op_implicit/op_explicit conversions for native types
* mono/mono@1d9378713e [sdks/ios] Build libMonoPosixHelper for device architectures, so that zlib-helper.o is created. (#10921) (#10970)
* mono/mono@6e48ad4f7b Merge pull request #10905 from monojenkins/backport-pr-10899-to-2018-06
* mono/mono@d050e323ed [runtime] Fix undefined pthread_main_np (#10930)
* mono/mono@b549fa7f32 [Reflection] Fix issue with finding types in module using an asterisk as filter criteria
* mono/mono@0dffbef269 Bump corefx to disable more tests
* mono/mono@6c46acfe69 [runtime] Disable stack guard for main thread on osx
* mono/mono@46e0249d4c [sdks] One more update to get XA PR builds working on Linux (#10855)
* mono/mono@910395a05f corefx bump
* mono/mono@2cdfb380a3 [2018-06] [System]: Make sure `HttpWebRequest` observes exceptions on timeout.  #10488. (#10732)
* mono/mono@aebef84fa2 [merp] Fix return value handling of posix_spawn (#10828)
* mono/mono@59f2dbf28b [sdks] Debian Linux doesn't need to build MXE (#10819)
* mono/mono@401bce867d Bump msbuild to track mono-2018-06
* mono/mono@65737564b0 Bump corefx
* mono/mono@40d991c325 [SDKS] Build host runtime with correct bitness (#10742)
* mono/mono@1a71d5101f [crash] Fix summarize_frame assertion
* mono/mono@8f36212ad3 [2018-06] Ignore some xunit tests for XA (non compatible with xunit 2.4) (#10721)
* mono/mono@410792459a [corlib] Makes remoting test more robust (and disable it on mobile)
* mono/mono@7dd65f79a5 [mono-api-html] Render something for fields with marshalling info. (#10698)
* mono/mono@7c898271e7 [offset-tool] Error out when parsing fails. (#10696)
* mono/mono@adbb8f72c8 [2018-06] Implement IEnumerable for ConditionalWeakTable (#10657)

Diff: 1b18f39e46...2343f26706
2018-10-11 17:08:59 -04:00
Chris Hamons 7c1d23d411
Bind 2 high visibility PrintCore APIs (#4933)
- https://github.com/xamarin/xamarin-macios/issues/4713
2018-10-11 09:14:48 -05:00
Rolf Bjarne Kvinge 4362842b68 [mmptests] Update according to MSBuild changes. 2018-10-11 12:25:47 +02:00
Rolf Bjarne Kvinge ffd85c94d0
[generator] Throw PlatformNotSupportException in 32-bit mode for 64-bit-only iOS API. Fixes #4689. (#4954)
Throw PlatformNotSupportedException for iOS API that was introduced in iOS 11+
in 32-bit mode, since that API is clearly not available in any 32-bit capable
iOS version.

This makes the 32-bit version of Xamarin.iOS.dll smaller (from 15.282.176
bytes to 14.575.616 bytes, ~700kb smaller - small enough that this makes the
dontlink test work in 32-bit mode again on device).

Fixes https://github.com/xamarin/xamarin-macios/issues/4689.
2018-10-11 08:53:44 +02:00
Rolf Bjarne Kvinge 745c18cc73 Merge remote-tracking branch 'origin/master' into msbuild-port 2018-10-11 07:31:58 +02:00
Rolf Bjarne Kvinge f96faaa814
[CoreFoundation] Refactor Dispatch code to take advantage of recent code improvements. (#4939)
* [CoreFoundation] Make DispatchObject inherit from NativeObject to share more code.

* [CoreFoundation] Replace calls to Check () with calls to GetCheckedHandle () to reuse more code.

* [CoreFoundation] Simplify a bit by reusing code in base constructors.

* [CoreFoundation] Use Handle instead of handle.

* [CoreFoundation] Use InitializeHandle instead of setting the 'handle' field.

* [CoreFoundation] Remove temporary 'handle' field.

* [CoreFoundation] Remove needless 'unsafe' blocks.

* Reintroduce DispatchObject.Check, since it's public API.
2018-10-11 07:26:55 +02:00
Ankit Jain 73fbb53856 [msbuild] Enable nuget package conflict resolution (#4945)
Fixes https://github.com/mono/mono/issues/10602 .

From the issue:
```
We need to enable this to support the system assemblies conflict
resolution which we now rely on for any new packages to enhance
developers experience and get us out of dependency on specific package
versions.
```
2018-10-10 20:14:31 -04:00
Jo Shields 6f2ebedb74 Bump to mono:2018-06 (#4277)
* Bump to mono:2018-06

* Bump mono

* Updates compression to work with the public span

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Bump Mono

* [runtime] always use `mono_jit_set_aot_mode` (#4491)

`mono_jit_set_aot_only` is deprecated and accidentally broke with
https://github.com/mono/mono/pull/7887

This should fix device tests with `mono-2018-06`

* Testing with Zoltan's patch

* Include libmono-system-native on Xamarin.Mac

* Bump Mono

Commit list for mono/mono:

* mono/mono@7bcda192a0 Bump llvm to release_60/fc854b8ec5873d294b80afa3e6cf6a88c5c48886. (#9786). (#9804)
* mono/mono@23e95ec7ad Apply F# portable pdb debug fix for pinvokes & bump (#9797)
* mono/mono@295f6d32af [2018-06] [MacOS] On Mac, use the copyfile API to copy files (#9696)

Diff: 7d5f4b6136...7bcda192a0

* Revert 4bacab3d5c, it doesn't fix the ios aot problems.

* Bump mono

* [tests] Adjust the MT0137 test for mcs change in behavior.

Starting with mono 5.16 mcs will now add assembly references when the assembly
is only used in attributes (this was already the case for csc in both 5.14 and
5.16, so it seems to be a compatibility change).

Adjust the MT0137 test accordingly.

* [msbuild] Fix parsing of json parser errors to handle trailing periods in the error message.

Fixes this test:

    1) Test Failure : Xamarin.iOS.Tasks.Bug60536.TestACToolTaskCatchesJsonException
         ColumnNumber
      Expected: 2
      But was:  0

* Bump mono

* [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that.

* Bump mono

* Bump mono

* [jenkins] Don't give VSTS a fake branch. (#4667)

Something in VSTS changed, and now fake branch names don't work anymore.

So instead use real branch names (and for pull requests I've created a
'pull-request' branch we can use).

* Assembly.LoadFile accepts only absolute path

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump Mono

* [mtouch] add mixed-mode support (#4751)

* [mtouch] add --interp-mixed option

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.

* [mtouch] Add support to --interpreter to list the assemblies to (not) interpret.

* [msbuild] Simplify interpreter code to use a single variable.

* Fix whitespace.

* [mtouch] Move mtouch-specific code to mtouch-specific file.

* [msbuild] An empty string is a valid value for 'Interpreter', so make it a non-required property.

* [mtouch] Add sanity check for aot-compiling interpreted assemblies.

* Bump Mono

* [linker] Updates SDKs facades list

* Bump mono

* [msbuild] Adds facades which might override default nuget version to framework list

The collision resolver task reads them from here https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/ConflictResolution/FrameworkListReader.cs

* Bump to a VSfM version that can build XM Classic projects.
2018-10-10 11:02:28 -04:00
Manuel de la Pena a75c0b9ff7
[AppKit] Fix issue 4837 by moving the category to be inline. Fixes #4837 (#4875)
* [AppKit] Fix issue 4837 by moving the category to be inline. Fixes #4837

The NSControlEditingSupport needs to be inline to make the use of the
API simpler allowing users to inherit an override the method.

Fixes https://github.com/xamarin/xamarin-macios/issues/4837
2018-10-10 16:59:22 +02:00
Rolf Bjarne Kvinge 80881930c0
[install-source] Quiet warning. (#4964)
The line "Got empty dir for " is printed 6000 times when building on the bots;
this change will quiet this warning.
2018-10-10 15:44:40 +02:00
Rolf Bjarne Kvinge beb6ee6e9a
[src] Change argument order to csc to fix compiler warning. (#4960)
Fixes these warnings:

    build/mac/mobile/Foundation/NSUrl.g.cs(41,30): warning CS0660: 'NSUrl' defines operator == or operator != but does not override Object.Equals(object o)
    build/mac/mobile/Foundation/NSUrl.g.cs(41,30): warning CS0661: 'NSUrl' defines operator == or operator != but does not override Object.GetHashCode()
    build/mac/full/Foundation/NSUrl.g.cs(41,30): warning CS0660: 'NSUrl' defines operator == or operator != but does not override Object.Equals(object o)
    build/mac/full/Foundation/NSUrl.g.cs(41,30): warning CS0661: 'NSUrl' defines operator == or operator != but does not override Object.GetHashCode()
    build/mac/full/Foundation/NSUrl.g.cs(41,30): warning CS0660: 'NSUrl' defines operator == or operator != but does not override Object.Equals(object o)
    build/mac/full/Foundation/NSUrl.g.cs(41,30): warning CS0661: 'NSUrl' defines operator == or operator != but does not override Object.GetHashCode()
    build/mac/mobile/Foundation/NSUrl.g.cs(41,30): warning CS0660: 'NSUrl' defines operator == or operator != but does not override Object.Equals(object o)
    build/mac/mobile/Foundation/NSUrl.g.cs(41,30): warning CS0661: 'NSUrl' defines operator == or operator != but does not override Object.GetHashCode()

We've already ignored these warnings in NSUrl.cs [1], but since NSUrl is a
partial class, and the warning applies to the class, it seems the order the
source files are passed to csc determines whether csc reports the warning or
not.

[1] 1f5ba0b5c0/src/Foundation/NSUrl.cs (L30-L31)
2018-10-10 14:21:49 +02:00
Rolf Bjarne Kvinge ec88393dcf
[CoreFoundation] Simplify DispatchQueue.MainQueue. (#4925)
* The dispatch_get_main_queue function doesn't exist anywhere (tested on iOS 5.1.1 - iOS 12, macOS 10.7 - 10.14), and when called from native code, it's always an inlined function, so just remove the call completely.
    
* Getting the _dispatch_main_q symbol from either the current address space, libSystem or libdispatch works fine everywhere. Looking up something in the current address space is costly (according to 'man dlsym'), so stop doing that: only look in libdispatch (since that's where the symbol actually is according to 'nm').

* I find no reason for the lock in DispatchQueue.MainQueue, nor does history reveal anything helpful, so I removed the lock.
2018-10-10 10:48:22 +02:00
Rolf Bjarne Kvinge 45d2ade35e
[docs] Improve documentation for MT5216. Fixes #4445. (#4956)
Fixes https://github.com/xamarin/xamarin-macios/issues/4445.
2018-10-10 08:52:05 +02:00
Rolf Bjarne Kvinge 1f5ba0b5c0
[xharness] Improve logging a bit. (#4952)
* [xharness] Improve logging a bit.

* Use timestamp in more log paths.
* Create numbered log subdirectories to make things nicer to look at in a
  terminal (thousands of subdirectories can be annoying to shift through; this
  way there's an additional subdirectory level).

* Avoid string interpolation when not needed.
2018-10-10 08:05:26 +02:00