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

5457 Коммитов

Автор SHA1 Сообщение Дата
Bernhard Urban 9688c42e2d Bump mono and enable monotouch-test with interpreter (#5023)
* Bump Mono 2018-06

Commit list for mono/mono:

* mono/mono@c0fe724379 [aot] Reenable recursion checking when initing shared got entries (#11295)
* mono/mono@f55f7e53e3 [interp] use unsigned conversion for nuint (#11285)
* mono/mono@5986920bdb [2018-06] [arm64] Remove the limitation on the number of nullable arguments for dyncalls (#11266)
* mono/mono@665a308c39 [WinForms] Propagate the flags from DrawTextInternal to MeasureTextInternal (#11251)
* mono/mono@5ed4143b4f [2018-06] Crash Reporter V2 (#11162)
* mono/mono@f0db92c2b6 [interp] Implement interpreter entry trampolines on amd64 (#10978) (#11165)
* mono/mono@c1f1a7bfed [ci] Move OSX .pkg build to a separate bot pool
* mono/mono@d80ced607b [aot] Ensure shared got entries are initialized before loading methods (#11225)
* mono/mono@d07c626a74 [pkg] Add preinstall which removes existing Mono of the same version (#11209)
* mono/mono@cda3acc57c [sdks] futimens and futimes symbols are missing on anything earlier than 10.13 (#11174)
* mono/mono@226e91a064 Bump xunit-binaries

Diff: 2343f26706...c0fe724379

* [tests] enable monotouch-test with --interpreter on Jenkins
2018-10-24 15:24:22 -04:00
Rolf Bjarne Kvinge 545c7bf4ba Merge remote-tracking branch 'origin/master' into mono-2018-08 2018-10-24 13:49:26 +02:00
Rolf Bjarne Kvinge 0ddc3553d3
[Foundation] Fix compiler warnings in NSUrlSessionHandler. (#5032)
Fix these warnings:

    src/Foundation/NSUrlSessionHandler.cs(71,57): warning CS3001: Argument type 'NSUrlSessionConfiguration' is not CLS-compliant
    src/Foundation/NSUrlSessionHandler.cs(89,14): warning CS0618: 'NSUrlSession.FromConfiguration(NSUrlSessionConfiguration, NSUrlSessionDelegate, NSOperationQueue)' is obsolete: 'Use the overload with a 'INSUrlSessionDelegate' parameter.'
2018-10-24 07:54:50 +02:00
Rolf Bjarne Kvinge ad67a39104
[runtime] Improve diagnostics/behavior in case of failure to contact the IDE when debugging. (#5029)
When debugging watchOS apps on device, we wait forever [1] for a connection to
be established to the IDE (iOS apps wait for only 2 seconds, but that's
because the app will be killed after a while, which we avoid on watchOS by
attaching the native debugger).

Unfortunately our error handling was not quite optimal, which meant that if
the connection to the IDE failed, we'd wait forever instead of launching the
app without attaching the debugger.

So improve this, by printing "Waiting for connection to the IDE..." messages
while trying to connect, and printing detailed log messages if the
connection attempt fails (as well as terminating the wait and launching the
watch app).

[1] In this case forever technically means "1 hour".
2018-10-24 07:52:58 +02:00
Martin Baulig 63025fe8e7 [security]: `NATIVE_APPLE_CERTIFICATE` should now be defined on watchOS as well. 2018-10-24 00:10:10 -04:00
Sebastien Pouliot d2a9a57bb9
[mtouch] Display a specific error is a .framework binary is invalid. Fixes #5028 (#5031)
Instead of a generic `MT0000` caused by an exception reading the magic
numbers of the binary framework file.

This was caused be uncompressing an archive, with a symlink, into a
file system that does not support symlinks (on Windows).

ref: https://github.com/xamarin/xamarin-macios/issues/5028
2018-10-23 14:15:58 -04:00
Sebastien Pouliot b403da0d85
[uikit] Preserve method associated with `updateSearchResultsForSearchController:`. Fixes #5024 (#5027)
This method is called back from iOS (or tvOS) so there's no managed
reference pointing to it. However we know that if it's (private inner)
type is present it's because the callback (from native) is possible so
we can preserve the method conditionally (to the type presence).

https://github.com/xamarin/xamarin-macios/issues/5024
2018-10-22 21:54:54 -04:00
Rolf Bjarne Kvinge 74102bce2d Use the zlib-helper.o library built by mono, instead of building our own. (#5021)
This also makes it possible to simplify/remove some of our build logic.
2018-10-22 19:52:45 -04:00
Jeffrey Stedfast 0cbf9609a1
Update mtouch-errors.md 2018-10-22 10:22:52 -04:00
Jeffrey Stedfast 502d811c43
Update mtouch-errors.md 2018-10-22 10:20:57 -04:00
Rolf Bjarne Kvinge d899d4fb70
Remove bitrotted support for a separate mono submodule for watchOS support. (#5022)
Unce upon a time we used a separate mono submodule for watchOS support, to make
development of watchOS support easier (we referenced mono/master, to avoid
backporting fixes for watchOS support through various release branches in
mono).

This only worked until our watchOS support became stable, since then we had to
start using a stable version of mono for watchOS support.

This means that our build support for using a separate mono clone for watchOS
support is no longer needed; and in any case it's broken because of build
changes done later.
2018-10-22 16:14:26 +02:00
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
Martin Baulig d2bcd4b775 Bump Mono. 2018-10-17 15:12:39 -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
Martin Baulig 3f325dd3f0 Initial "Titanium Yellow" support. 2018-10-16 19:01:32 -04:00
Rolf Bjarne Kvinge 8bc87c9421 Fix the llvm32 build by using Xcode 9.4. (#4985)
Since Xcode 10 doesn't support building 32-bit macOS binaries.

(cherry picked from commit 13b2647955)
2018-10-16 19:01:26 -04:00
Martin Baulig c30807113c Revert "[monotouch-test] Disable X509Certificate(byte[]) tests on watchOS (#4942)"
This reverts commit d003a9b918.
2018-10-16 15:18:33 -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
Martin Baulig 1167557fc0 Bump Mono to "Titanium Yellow". 2018-10-15 14:02:01 -04:00
Martin Baulig 47a2a3de15 Add `PreserveDependencyLookupStep` to mmp and mtouch to make it build again. 2018-10-15 13:24:33 -04:00
Martin Baulig 7f15a6173e Comment-out the asserts in the MailX1 and SecRecordTest tests.
The assert message `TestRuntime.AssertNotWatchOS ("X509Certificate (byte[]) doesn't work on watchOS")`
is clearly wrong as `X509Certificate (byte[])` is supposed to work on all platforms.

Still investigating whether the rest of the test will work on watchOS or not (and why if it doesn't).
2018-10-15 11:56:25 -04:00
Martin Baulig b46ef9e3e8 Remove Mono.CSharp from xammac. 2018-10-15 11:49:55 -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 8feb75335e
Merge branch 'master' into mono-2018-08 2018-10-15 11:23:27 -04:00
Martin Baulig 3959b5fb36 Bump Mono to current 2018-10. This is the last commit prior to "Titanium Yellow". 2018-10-15 11:18:25 -04:00
Martin Baulig 3da5bfdc8e Merging the 'mono-2018-08' branch. 2018-10-15 11:17:11 -04:00
Sebastien Pouliot e8b87b77d7
[tests][mmp] Convert old mmp calendar regression tests to unit tests (#4983) 2018-10-15 11:15:20 -04:00