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

4592 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 5f4327ab0f
[CoreGraphics] Fix CGFunction to work after being disposed. (#4644)
We have a test for CGFunction, and in iOS 12 the behavior changed where
previously the CGFunction was invoked immediately when rendering, it's now
retained and only called later.

This is troublesome for the test, because it disposes the managed CGFunction
when it thinks it's completed. Since the function is invoked way later, the
test now crashes. Ops.

The obvious fix is to change the test to dispose the CGFunction later. This
falls flat when finding out that "later" is undetermined. Native code retains
the CGFunction, and can do whatever it wishes with it until it's released, and
there's no way to know when that is.

OK: what about not disposing the CGFunction, and letting the GC do its job?
This also falls flat, because there's a circular reference between the native
CGFunction and the managed wrapper, preventing any of them from being released
automatically by the GC. The only way to break the circular reference is to
dispose the managed wrapper.

So, can we fix the circular reference? Unfortunately not, because we can't
monitor the native CGFunction's retain count, which is required in order to
switch the native->managed link between weak and strong according to the
retain count.

This leaves one solution (that I could come up with at least): make sure
everything works fine after disposing the managed wrapper.

This involves a few things:

* Only break the native->managed connection (the 'gch' GCHandle) when the
  native CGFunction is freed. This is accomplished by using the API provided
  by Apple for exactly that purpose (the 'release' callback field in the
  'CGFunctionCallbacks' struct).

* Use a static variable for the 'CGFunctionCallback' struct and its contents.
  This solves another potential problem: the GC could have collected the
  delegate to the 'EvaluateCallback' function at any point.

* Don't null out the 'evaluate' delegate in Dispose. This leaves the user with
  no way to break a potential circular reference through that delegate (since
  it will never be null), so provide a property that makes it possible for
  users to explicitly null out the delegate ('EvaluateFunction').

* Only call the 'evaluate' callback if it's not null.

This also has the additional advantage that test (and any customer code
running into the same issue) works without modifications.
2018-08-20 07:40:54 +02:00
Vincent Dondain c5169120bf
[msbuild] Update 'metal' binary path for Xcode 10 (#4601)
- Fixes #4576: [xcode10] 'Metal Game' fails to build. (https://github.com/xamarin/xamarin-macios/issues/4576)

In Xcode 10 Apple moved the "metal" binary from `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/metal` to `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal`.
2018-08-17 10:24:02 -04:00
Rolf Bjarne Kvinge f7f8f4e1d9
[builds] Only use Xcode 9.4 when we need it. Fixes #4582. (#4627)
Only use Xcode 9.4 to build 32-bit mac binaries, we don't need it to build
anything else.

This way we can revert 7227d8c478, which is
causing issue #4582 (that commit changed variables containing SDK paths to be
SDK version agnostic, so that the variables could be used for all Xcode
versions - but that unfortunately triggers an obscure ld bug. If we don't need
those variables to refer to Xcode 9.4 paths, they can contain versions just
fine).

Fixes https://github.com/xamarin/xamarin-macios/issues/4582.
2018-08-16 17:07:09 +02:00
Sebastien Pouliot b3efe23189
[networkextension] Obsolete NWPath and NWHostEndpoint default constructors (#4624)
There's nothing that indicates the types are user creatable. In addition
recent tests shows this (and similar) traces that suggest the instances
are not fully initialized.

2018-08-14 16:41:37.677780-0400 introspection[65154:688446] [] nw_path_get_mtu called with null path
2018-08-14 16:41:37.677917-0400 introspection[65154:688446] [] __nwlog_err_simulate_crash simulate crash failed "nw_path_get_mtu called with null path"
2018-08-14 16:41:37.680216-0400 introspection[65154:688446] [] nw_path_get_mtu called with null path, dumping backtrace:
        [x86_64] libnetcore-1229.202.1
    0   libnetwork.dylib                    0x00000001131b1c18 __nw_create_backtrace_string + 120
    1   libnetwork.dylib                    0x000000011315b962 nw_path_get_mtu + 274
    2   Network                             0x0000000111737a67 -[NWPath mtu] + 39
    3   Network                             0x000000011173610e -[NWPath descriptionWithIndent:showFullContent:] + 446
    4   Network                             0x0000000111736825 -[NWPath description] + 21
    5   introspection                       0x000000010484db69 xamarin_dyn_objc_msgSend + 217
    6   ???                                 0x0000000131be3755 0x0 + 5129516885
    7   ???                                 0x0000000131be73d9 0x0 + 5129532377
    8   introspection                       0x0000000104653963 mono_jit_runtime_invoke + 1443
    9   introspection                       0x0000000104732a9f mono_runtime_invoke_checked + 127
    10  introspection                       0x0000000104739de8 mono_runtime_try_invoke_array + 1160
    11  introspection                       0x00000001046da4b7 ves_icall_InternalInvoke + 647
    12  ???                                 0x0000000137b84ae1 0x0 + 5229791969
    13  ???                                 0x0000000137b8484b 0x0 + 5229791307
    14  ???                                 0x0000000137b845fb 0x0 + 5229790715
    15  ???                                 0x0000000137b83d59 0x0 + 5229788505
    16  ???                                 0x0000000137b7c2f4 0x0 + 5229757172
    17  ???                                 0x0000000136d6066b 0x0 + 5214963307
    18  ???                                 0x0000000137b7c2f4 0x0 + 5229757172
    19  ???                                 0x0000000136d6066b 0x0 + 5214963307
    20  ???                                 0x0000000137b7c2f4 0x0 + 5229757172
    21  ???                                 0x0000000136d6066b 0x0 + 5214963307
    22  ???                                 0x0000000137b7c2f4 0x0 + 5229757172
    23  ???                                 0x0000000136d6066b 0x0 + 5214963307
    24  ???                                 0x0000000137b0d76b 0x0 + 5229303659
    25  ???                                 0x0000000131bac8a1 0x0 + 5129291937
    26  introspection                       0x0000000104653963 mono_jit_runtime_invoke + 1443
    27  introspection                       0x0000000104734424 mono_runtime_try_invoke + 148
    28  introspection                       0x000000010473636f mono_runtime_invoke + 31
    29  introspection                       0x00000001044e4188 _ZL31native_to_managed_trampoline_20P11objc_objectP13objc_selectorPP11_MonoMethodj + 248
    30  introspection                       0x00000001044e8754 -[__MonoMac_NSAsyncActionDispatcher xamarinApplySelector] + 52
    31  Foundation                          0x0000000105c7bf6b __NSThreadPerformPerform + 330
    32  CoreFoundation                      0x0000000104f1bb31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    33  CoreFoundation                      0x0000000104f1b464 __CFRunLoopDoSources0 + 436
    34  CoreFoundation                      0x0000000104f15a4f __CFRunLoopRun + 1263
    35  CoreFoundation                      0x0000000104f15221 CFRunLoopRunSpecific + 625
    36  GraphicsServices                    0x00000001157d01dd GSEventRunModal + 62
    37  UIKitCore                           0x000000011a6e62f1 UIApplicationMain + 140
    38  ???                                 0x0000000131be4d18 0x0 + 5129522456
    39  ???                                 0x0000000131be4b93 0x0 + 5129522067
    40  introspection                       0x0000000104653963 mono_jit_runtime_invoke + 1443
    41  introspection                       0x0000000104732a9f mono_runtime_invoke_checked + 127
    42  introspection                       0x000000010473890e mono_runtime_exec_main_checked + 110
    43  introspection                       0x00000001045a132f mono_jit_exec + 287
    44  introspection                       0x000000010484b5ee xamarin_main + 2830
    45  introspection                       0x000000010484df6d main + 45
    46  libdyld.dylib                       0x00000001122915cd start + 1
    47  ???                                 0x0000000000000009 0x0 + 9

2018-08-14 17:09:22.864147-0400 introspection[78577:733530] [] nw_endpoint_get_parent_endpoint_domain called with null endpoint
2018-08-14 17:09:22.864273-0400 introspection[78577:733530] [] __nwlog_err_simulate_crash simulate crash failed "nw_endpoint_get_parent_endpoint_domain called with null endpoint"
2018-08-14 17:09:22.866190-0400 introspection[78577:733530] [] nw_endpoint_get_parent_endpoint_domain called with null endpoint, dumping backtrace:
        [x86_64] libnetcore-1229.202.1
    0   libnetwork.dylib                    0x0000000119d0bc18 __nw_create_backtrace_string + 120
    1   libnetwork.dylib                    0x0000000119c8b232 nw_endpoint_get_parent_endpoint_domain + 178
    2   Network                             0x0000000118261177 -[NWEndpoint parentEndpointDomain] + 39
    3   Network                             0x000000011824a941 -[NWHostEndpoint descriptionWithIndent:showFullContent:] + 97
    4   Network                             0x0000000118260eb5 -[NWEndpoint description] + 21
    5   introspection                       0x000000010b3a4b69 xamarin_dyn_objc_msgSend + 217
    6   ???                                 0x000000013ce75755 0x0 + 5316761429
    7   ???                                 0x000000013ce793d9 0x0 + 5316776921
    8   introspection                       0x000000010b1aa963 mono_jit_runtime_invoke + 1443
    9   introspection                       0x000000010b289a9f mono_runtime_invoke_checked + 127
    10  introspection                       0x000000010b290de8 mono_runtime_try_invoke_array + 1160
    11  introspection                       0x000000010b2314b7 ves_icall_InternalInvoke + 647
    12  ???                                 0x000000013e428bc1 0x0 + 5339515841
    13  ???                                 0x000000013e42892b 0x0 + 5339515179
    14  ???                                 0x000000013e4286db 0x0 + 5339514587
    15  ???                                 0x000000013e427e39 0x0 + 5339512377
    16  ???                                 0x000000013e4203d4 0x0 + 5339481044
    17  ???                                 0x000000013d8b875b 0x0 + 5327521627
    18  ???                                 0x000000013e4203d4 0x0 + 5339481044
    19  ???                                 0x000000013d8b875b 0x0 + 5327521627
    20  ???                                 0x000000013e4203d4 0x0 + 5339481044
    21  ???                                 0x000000013d8b875b 0x0 + 5327521627
    22  ???                                 0x000000013e4203d4 0x0 + 5339481044
    23  ???                                 0x000000013d8b875b 0x0 + 5327521627
    24  ???                                 0x000000013e3c37db 0x0 + 5339101147
    25  ???                                 0x00000001387848a1 0x0 + 5242374305
    26  introspection                       0x000000010b1aa963 mono_jit_runtime_invoke + 1443
    27  introspection                       0x000000010b28b424 mono_runtime_try_invoke + 148
    28  introspection                       0x000000010b28d36f mono_runtime_invoke + 31
    29  introspection                       0x000000010b03b188 _ZL31native_to_managed_trampoline_20P11objc_objectP13objc_selectorPP11_MonoMethodj + 248
    30  introspection                       0x000000010b03f754 -[__MonoMac_NSAsyncActionDispatcher xamarinApplySelector] + 52
    31  Foundation                          0x000000010c7d2f6b __NSThreadPerformPerform + 330
    32  CoreFoundation                      0x000000010ba72b31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    33  CoreFoundation                      0x000000010ba72464 __CFRunLoopDoSources0 + 436
    34  CoreFoundation                      0x000000010ba6ca4f __CFRunLoopRun + 1263
    35  CoreFoundation                      0x000000010ba6c221 CFRunLoopRunSpecific + 625
    36  GraphicsServices                    0x000000011c32a1dd GSEventRunModal + 62
    37  UIKitCore                           0x00000001212402f1 UIApplicationMain + 140
    38  ???                                 0x000000013ce76d18 0x0 + 5316767000
    39  ???                                 0x000000013ce76b93 0x0 + 5316766611
    40  introspection                       0x000000010b1aa963 mono_jit_runtime_invoke + 1443
    41  introspection                       0x000000010b289a9f mono_runtime_invoke_checked + 127
    42  introspection                       0x000000010b28f90e mono_runtime_exec_main_checked + 110
    43  introspection                       0x000000010b0f832f mono_jit_exec + 287
    44  introspection                       0x000000010b3a25ee xamarin_main + 2830
    45  introspection                       0x000000010b3a4f6d main + 45
    46  libdyld.dylib                       0x0000000118de65cd start + 1
    47  ???                                 0x0000000000000009 0x0 + 9
2018-08-15 21:44:13 -04:00
Sebastien Pouliot 878fdffea7
[foundation] Update for beta 6 (#4625) 2018-08-15 21:41:03 -04:00
Sebastien Pouliot 605b992c62
Bump for beta 6 (#4613) 2018-08-15 13:23:31 -04:00
Vincent Dondain 3548c44782
[metal] Update for Xcode 10 beta 1, 2, 3 & 4 (#4562) 2018-08-15 10:09:23 -04:00
Miguel de Icaza 569c3c29bd [Network] Bug fix the NWParameter constructors (#4615) 2018-08-14 08:56:50 -04:00
Manuel de la Pena 41fe079f9b [Generator] Ensure the correct error is raised when an Export is missing on a Property. (#4604)
The generator had a small bug in which we would get a NRE when a
property missed a Export attribute and had no WrapAttr. The issue is due
to the fact that an || is being used and does not shortcut when the
attribute is missing. In that case, the first Get check would pass and a
second attempt would happen with the set. In the case the set is missing,
we would get a NRE. The correct way is to ensure that we do have the get
and the set BEFORE the attr is checked.

The added test shows an example of the issue.
2018-08-09 16:06:14 -04:00
Sebastien Pouliot f471f9b591
[security] Update for beta 5 (only) change (#4600) 2018-08-09 10:12:07 -04:00
Sebastien Pouliot 0b7265193a
[coreservices] Update up to beta 5 (#4590)
Also avoid creating NSString instances for hidden constants where
only the handle is every used.
2018-08-08 12:38:03 -04:00
Manuel de la Pena 7c7f46da28
[iTunesLibrary] Xcode 10 beta 3 support. (#4462) 2018-08-08 16:34:16 +02:00
Manuel de la Pena 82d21bc211
[Tests] Fix failing tests on iOS 8. Fixes #4437 (#4592)
Some of the tests fail because the assert is looking at the wrong iOS
version. Looking at the API definitions:

* UIStackView - Available in iOS 9, not iOS 8.
* AudioServicesPlayAlertSoundWithCompletion - Available in iOS 9, not
iOS 8.

All the other tests reported in the issue pass.

Issue: https://github.com/xamarin/xamarin-macios/issues/4437
2018-08-08 16:14:04 +02:00
Miguel de Icaza 8960cc0022
Merge pull request #4251 from migueldeicaza/xcode10-network
[Network, Security] Bindings for Network, Security, DispatchIO and some classes needed to port samples
2018-08-08 09:55:06 -04:00
Sebastien Pouliot 4a9b7f1f22
[tests][xtro] Merge MPSRayIntersector results into parent MetalPerformanceShaders framework (#4589) 2018-08-08 08:52:04 -04:00
Sebastien Pouliot 0dce6bbda9
Bump version for next preview (#4591) 2018-08-08 08:51:44 -04:00
Manuel de la Pena f4cd485b38 [ImageIO] Add support for Xcode 10 beta 5. (#4587) 2018-08-07 21:06:40 -04:00
Sebastien Pouliot 805c65ac98
[coreanimation] Add new API up to b5 (#4571)
Also a small generator change to allow `CGColorSpace` use inside
strong dictionaries.
2018-08-07 13:49:30 -04:00
Chris Hamons 86e97b101b More CoreFoundation SOCKS APIs to ignore backlog, they are ancient but just showing up in headers (#4572) 2018-08-04 00:25:34 -04:00
Sebastien Pouliot 7e770663d9
[audiotoolbox][tvos] Remove AudioFileReadPackets symbol (#4570)
The public API was removed a long time ago (with XAMCORE_2_0) but
the p/invoke was still present in the platform assemblies.

Since tvOS requires bitcode this can cause a problem when linking
natively since a direct call won't be possible. That would only
happen if the symbol is removed (from the binary, not just the
headers) and if the managed linker is not enabled (otherwise it
will always be removed).
2018-08-04 00:24:54 -04:00
Manuel de la Pena 3613803471 [CoreMedia] Add Xcode 10 beta 5 support. (#4567) 2018-08-04 00:24:24 -04:00
Chris Hamons 7669300fcb Fix appkit warning (#4573) 2018-08-04 00:22:07 -04:00
Manuel de la Pena b47305ede2 [CoreImage] Add Xcode 10 beta 5 support. (#4564) 2018-08-03 17:06:45 -04:00
Rolf Bjarne Kvinge 9d65e42f58 Fix testing 32-bit XM apps. Fixes maccore issue 884. (#4555)
* [jenkins] Only XM apps with variations are Classic/32-bit apps, so adjust ignore logic accordingly. Fixes maccore issue 884.

Fixes https://github.com/xamarin/maccore/issues/884.

* [mmp] Fix passing -stdlib=libc++ to clang.

* [tests] Fix 32-bit XM issues.

* [xharness] Add support for building 32-bit XM apps by using Xcode 9.4.

* [xharness] Since xharness can now build 32-bit mac apps, enable them by default.

* Remove debug code.

* Remove unused variable.
2018-08-03 17:06:23 -04:00
Rolf Bjarne Kvinge 5400e01178
[xtro] Make 'classify' faster by running it for each platform in parallel with eachother. (#4563) 2018-08-03 16:20:00 +02:00
Rolf Bjarne Kvinge 0ede8b07bc
[jenkins] Implement support for slack notifications. (#4369)
Implement support for slack notifications.

Notifications will only be sent when something fails, and unfortunately I wasn't able to make notifications ping due to https://github.com/jenkinsci/slack-plugin/issues/353.
2018-08-03 11:37:54 +02:00
Rolf Bjarne Kvinge 698441e4a2 Update xtro todos. 2018-08-03 10:38:24 +02:00
Rolf Bjarne Kvinge 16f8032616 Merge remote-tracking branch 'origin/xcode10' into xcode10-network 2018-08-03 10:32:10 +02:00
Rolf Bjarne Kvinge c77f191064 [CoreGraphics] Add missing API added in Xcode 10 beta 1. (#4547)
* [CoreGraphics] Add CGPDFArray.Get* overloads that take a nint index, since the CGPDFArray.Count property returns nint.

This makes the following code work:

    for (var i = 0; i < array.Count; i++)
    	array.GetInt (i, ...)

* Don't add [MonoPInvokeCallback] to Mac code.

* [CoreGraphics] Rename CGPDFArray.ApplyBlockCallback to ApplyCallback.

Since the fact that the method is implemented using a block is not relevant
for managed code.

This also makes the method named like an equivalent method in CGPDFDictionary.

* [CoreGraphics] Change CGPDFArray.Apply to take an 'object' as the info parameter instead of IntPtr.

This makes it nicer for managed code.

* [CoreGraphics] CGPDFArray.Apply: resolve the iterated object to the actual CGPDFObject type.

* [CoreGraphics] Add an CGPDFDictionary.Apply overload that resolves the iterated object to the actual CGPDFObject type.

This method was previously only available in Classic, so I just reintroduced
it with a few changes to make the API nicer (which isn't a breaking change
since we're not building Classic anymore).

* [tests] Add test for CGPDF types.

* [tests] Don't run the new tests unless the SDK was part of Xcode 10
2018-08-02 20:30:41 -04:00
Vincent Dondain f3b5b81163 [arkit] Add ARAnchorCopyingCtorTest (#4551)
- Fixes https://github.com/xamarin/xamarin-macios/issues/4497.
2018-08-02 20:29:50 -04:00
Manuel de la Pena ab64222d5b [AudioToolbox] Add Xcode 10 beta 5 support. (#4559) 2018-08-02 20:29:15 -04:00
Miguel de Icaza 0c7f9248cd [Network, Security] Feedback, plus build warnings 2018-08-02 17:38:51 -04:00
Chris Hamons abcce7c2b9 Add missing AppKit Xcode 10 bindings (#4546) 2018-08-02 16:32:30 -04:00
Manuel de la Pena bf3d722360 [UIKit] Add support for Xcode 10 beta 5. (#4556) 2018-08-02 16:31:35 -04:00
Manuel de la Pena a2bfd0b633 [AVFoundation] Add support for Xcode 10 beta5. (#4554) 2018-08-02 16:15:16 -04:00
Rolf Bjarne Kvinge 04b181f574 [tests] Adjust the MT5211 test according to modified ld output. Fixes maccore issue 897. (#4557)
Fixes https://github.com/xamarin/maccore/issues/897.
2018-08-02 15:42:17 -04:00
Chris Hamons 9e3c69a7f5
Add soft deprecations from Foundation beta 5 on macOS (#4548) 2018-08-02 11:06:28 -05:00
Rolf Bjarne Kvinge bb631d36bd Update xtro definitions. 2018-08-02 17:16:00 +02:00
Sebastien Pouliot 66a4a0fd79
[iad] Update for beta 5 (#4544)
Apple removed `MPMoviePlayerController_iAdPreroll.h` in beta 5.

The deprecation existed, but indirectly, on `MPMoviePlayerController`,
the type on which the category is based. IOW it's became obsoleted so
we're adding the attributes to match this.
2018-08-02 10:13:15 -04:00
Chris Hamons 42bdecda4d Ignore instead of todo CoreWLand bindings uncovered by 24f865655f (#4552) 2018-08-02 09:16:48 -04:00
Sebastien Pouliot 1c2c655bb8
[coremidi] Update to beta 5 (#4550)
Be more explicit (and match headers) about API availability - even
if it does not change what we expose.
2018-08-02 09:15:09 -04:00
Rolf Bjarne Kvinge 8040f2351d introspection: Adjust CMAttachmentTest for new CoreFoundation types. 2018-08-02 10:23:24 +02:00
Rolf Bjarne Kvinge bbfb76135a Put availability attributes on the type instead of each member when it's the same for all members. 2018-08-02 10:09:53 +02:00
Rolf Bjarne Kvinge bdb3ff9049 Update xtro definitions. 2018-08-02 09:59:08 +02:00
Rolf Bjarne Kvinge 0181606fce
[jenkins] Skip any executing builds on internal jenkins when new builds are scheduled for pull requests. (#4518) 2018-08-02 09:53:46 +02:00
Chris Hamons e77560fff3
Xcode 10 Beta 5 AppKit (#4539)
- Mark NSBindingSelectionMarker as 10.14+ and note in XAMCORE_4_0 future usages
2018-08-01 12:31:20 -05:00
Miguel de Icaza eee94b4620 [Network, ObjCRuntime] Bring back the helper for future simple uses of the block API 2018-08-01 12:20:56 -04:00
Rolf Bjarne Kvinge 21eb1037dc Add trailing slash to make future diffs nicer. 2018-08-01 17:22:48 +02:00
Rolf Bjarne Kvinge 7b4654ba29 Update xtro todos 2018-08-01 17:11:07 +02:00
Rolf Bjarne Kvinge f54aa3b84b Remove unused file. 2018-08-01 17:11:07 +02:00