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

17366 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a0fa2adf59
[CoreMedia] Make the remaining P/Invokes in have blittable signatures. (#20360)
Contributes towards #15684.
2024-03-22 14:34:31 +01:00
Rolf Bjarne Kvinge 24f1054635
[ObjCRuntime] Refactor the Block.SetupBlock(Delegate,Delegate) implementation a bit. (#20353)
* Extract code the trimmer wants to warn about into a separate method.
* Suppress the trimmer warning we get.

Contributes towards #10405.
2024-03-22 10:19:37 +01:00
Rolf Bjarne Kvinge 26d240586e
[CoreMedia] Make the P/Invokes in CMBufferQueue have blittable signatures. (#20355)
Contributes towards #15684.
2024-03-22 08:02:32 +01:00
Rolf Bjarne Kvinge e76b7b8de6
[tools] Sort list of versions before showing them in an error message. (#20324)
Error messages aren't meant to be an exercise in mental capacity, so make
things easier for developers to figure out which versions are valid and which
are not by sorting them.

So instead of this:

    Valid Mac Catalyst versions are: 15.0, 13.3.1, 16.2, 14.3, 15.5, 13.1, 16.0, 17.2, 14.1, 15.3, 16.5, 14.6, 13.4, 17.0, 16.3, 15.6, 13.2, 14.4, 16.1, 14.2, 15.4, 16.6, 13.5, 14.7, 17.1, 15.2, 14.0, 16.4, 13.3, 14.5

We now get:

    Valid Mac Catalyst versions are: 13.1, 13.2, 13.3, 13.3.1, 13.4, 13.5, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 15.0, 15.2, 15.3, 15.4, 15.5, 15.6, 16.0, 16.1, 16.2, 16.3, 16.4, 16.5, 16.6, 17.0, 17.1, 17.2
2024-03-21 14:26:10 +01:00
Manuel de la Pena 7cb86a92a1
[CI] Run yamllint as an action to post. (#20349) 2024-03-21 08:45:42 -04:00
Rolf Bjarne Kvinge 0d39f757ca
[ObjCRuntime] Suppress trimmer warnings for certain DynamicRegistrar members. (#20350)
Contributes towards #10405.
2024-03-21 12:58:05 +01:00
Gerald Versluis 0e6c4fe875
Fix Apple Privacy Manifest doc typos (#20352)
Spotted a couple of typos
2024-03-21 12:51:52 +01:00
Gerald Versluis a3af464fb3
Fix Apple Privacy Manifest doc typos
Spotted a couple of typos
2024-03-21 12:37:15 +01:00
Michael Cummings (MSFT) 4854f70f09
Add documentation on how to provide the Apple Privacy Manifest (#20292)
From https://developer.apple.com/news/?id=3d8a9yyh

> Starting March 13: If you upload a new or updated app to App Store
Connect that uses an API requiring approved reasons, we'll will send you
an email letting you know if you’re missing reasons in your app’s
privacy manifest. This is in addition to the existing notification in
App Store Connect.
> 
> Starting May 1: You’ll need to include approved reasons for the listed
APIs used by your app’s code to upload a new or updated app to App Store
Connect. If you’re not using an API for an allowed reason, please find
an alternative. And if you add a new third-party SDK that’s on the list
of commonly used third-party SDKs, these API, privacy manifest, and
signature requirements will apply to that SDK. Make sure to use a
version of the SDK that includes its privacy manifest and note that
signatures are also required when the SDK is added as a binary
dependency.

[Document
preview](928100b38f/docs/apple-privacy-manifest.md)

fixes: https://github.com/xamarin/xamarin-macios/issues/20059

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2024-03-21 07:04:27 -04:00
dotnet-maestro[bot] e90f2acb07
[main] Update dependencies from dotnet/installer (#20342)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.2 to 8.0.3 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.2 to 8.0.3 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.2 to 8.0.3 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: from 8.0.2 to 8.0.3 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.2 to 8.0.3 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 
- **Date Produced**: March 20, 2024 3:07:29 AM UTC
- **Commit**: 697741a24aa43f007e03e2a8ea4496bb336ffdfc
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.104-servicing.24161.13 to 8.0.104-servicing.24169.60][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.2 to 8.0.3][2]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.2 to 8.0.3][3]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.2 to 8.0.3][2]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: [from 8.0.2 to 8.0.3][4]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.2 to 8.0.3][2]

[1]: 3769468c6f...697741a24a
[2]: https://dev.azure.com/dnceng/internal/_git/dotnet-runtime/branches?baseVersion=GC1381d5ebd2ab1f292848d5b19b80cf71ac332508&targetVersion=GC9f4b1f5d664afdfc80e1508ab7ed099dff210fbd&_a=files
[3]: https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/branches?baseVersion=GCda7e9894ce22ef8cc02e5acc56e95a6f8cf8f644&targetVersion=GC88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343&_a=files
[4]: 2fc2ffd960...9a29abdd76
2024-03-21 11:14:56 +01:00
dotnet-maestro[bot] 3aa058b490
[main] Update dependencies from xamarin/xamarin-macios (#20348)
This pull request updates the following dependencies

## From https://github.com/xamarin/xamarin-macios

- **Subscription**: 3ba82e10-e94b-4c1c-df8b-08dc11e0730b
- **Build**: 
- **Date Produced**: March 20, 2024 5:27:38 PM UTC
- **Commit**: 5edc544b7d
- **Branch**: refs/heads/release/7.0.3xx

- **Updates**:
  - **Microsoft.macOS.Sdk**: [from 13.3.7141 to 13.3.7142][4]

[4]: 10030635dc...5edc544b7d
2024-03-21 08:20:27 +01:00
Rolf Bjarne Kvinge cdd613166a
[CoreMedia] Make the P/Invokes in CMSync have blittable signatures. (#20340)
Contributes towards #15684.
2024-03-21 08:05:20 +01:00
Rolf Bjarne Kvinge 2f9fd8fe41
[AVFoundation] Obsolete AVSpeechSynthesizer.WriteUtteranceAsync. Fixes #20338. (#20339)
The callback may be called multiple times, which means the async version won't
work correctly.

So obsolete and hide the Async binding for now, and remove in XAMCORE_5_0.

References:
* https://discord.com/channels/732297728826277939/732297808148824115/1219903715939582022
* https://developer.apple.com/documentation/avfaudio/avspeechsynthesizer/3141659-writeutterance?language=objc

Fixes https://github.com/xamarin/xamarin-macios/issues/20338.
2024-03-21 08:05:07 +01:00
Rolf Bjarne Kvinge b2e89697f1
[ObjCRuntime] Suppress trimmer warnings for certain Runtime members. (#20337)
Contributes towards #10405.
2024-03-20 14:33:12 -04:00
Rolf Bjarne Kvinge 63fcc40957
[CoreMedia] Make the P/Invokes in CMSampleBuffer have blittable signatures. (#20334)
Contributes towards #15684.
2024-03-20 07:25:48 +01:00
Rolf Bjarne Kvinge 9263a3e122
[msbuild] Adjust error message when we can't find Xcode to not talk about VS. Fixes #19818. (#20306)
Some people may use VSCode, or the command line, and talking about VS is confusing.

Fixes https://github.com/xamarin/xamarin-macios/issues/19818.
2024-03-20 06:32:06 +01:00
Rolf Bjarne Kvinge c41d581f5c
[ObjCRuntime] Suppress trimmer warnings for certain Runtime members. (#20322)
Contributes towards #10405.
2024-03-20 06:31:41 +01:00
Rolf Bjarne Kvinge 2cbc31f686
[Foundation] Suppress trimmer warnings for NSObject.DynamicConformsToProtocol members. (#20333)
Contributes towards #10405.
2024-03-20 06:30:25 +01:00
Rolf Bjarne Kvinge aea652658b
[Compression] Add missing enum members. Fixes #20319. (#20332)
Also document all the members.

Fixes https://github.com/xamarin/xamarin-macios/issues/20319.
2024-03-20 06:30:05 +01:00
Rolf Bjarne Kvinge cbec66db7d
[tests] Ignore the VerifyEveryVisibleMemberIsDocumented test if the Xamarin bits aren't enabled. (#20321)
Our tool to inject documentation for Apple APIs live in maccore, so if that
part of the build isn't enabled, we'll get a lot of false positives.

Instead just ignore the test if the Xamarin bits (in maccore) aren't enabled.
2024-03-20 06:28:45 +01:00
Rolf Bjarne Kvinge bb775d026c
[Foundation] Fix hack in NSUrlSessionHandler to avoid a deadlock. (#20327)
Calling [Try]SetResult on a default TaskCompletionSource will call any
continuations on the same thread.

This can lead to deadlocks (thus the hack to run TrySetResult in a background
thread), so avoid it by configuring the TaskCompletionSource to call
continutations asynchronously.

Ref: https://devblogs.microsoft.com/premier-developer/the-danger-of-taskcompletionsourcet-class/
2024-03-19 08:33:35 +01:00
Rolf Bjarne Kvinge 120d6e3936
[CoreMedia] Make the P/Invokes in CMFormatDescription have blittable signatures. (#20329)
Contributes towards #15684.
2024-03-19 08:29:03 +01:00
Rolf Bjarne Kvinge ab3fc14482
[Foundation] Don't dispose the CancellationTokenSource in NSUrlSessionHandler's InflightData. Fixes #11799. (#20328)
There's a random ObjectDisposedException occurring, which seems to have this sequence of events:

1. The request is sent.
2. The request is cancelled.
3. The InflightData instance is removed here: c3437328bf/src/Foundation/NSUrlSessionHandler.cs (L545)
   3a. The InflightData is disposed: c3437328bf/src/Foundation/NSUrlSessionHandler.cs (L224)
   3a. The InflightData.CancellationTokenSource instance is disposed: c3437328bf/src/Foundation/NSUrlSessionHandler.cs (L1168)
4. Data comes in (in the DidReceiveData callback), and SetResponse is called: c3437328bf/src/Foundation/NSUrlSessionHandler.cs (L932)
   4a. The SetResponse method tries to use InflightData.CancellationTokenSource, and that throws an ObjectDisposedException: c3437328bf/src/Foundation/NSUrlSessionHandler.cs (L970)

Full stack traces:

```
InflightData disposed:
   at System.Net.Http.NSUrlSessionHandler.InflightData.Dispose(Boolean disposing) in xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 1168
   at System.Net.Http.NSUrlSessionHandler.InflightData.Dispose() in xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 1160
   at System.Net.Http.NSUrlSessionHandler.RemoveInflightData(NSUrlSessionTask task, Boolean cancel) in xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 224
   at System.Net.Http.NSUrlSessionHandler.<>c__DisplayClass58_0.<SendAsync>b__0() in xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 545
   at System.Threading.CancellationToken.<>c.<Register>b__12_0(Object obj)
   at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
   at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
   at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
   at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)
   at System.Threading.CancellationTokenSource.LinkedNCancellationTokenSource.<>c.<.cctor>b__4_0(Object s)
   at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source)
   at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
   at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
   at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)
   at System.Threading.CancellationTokenSource.TimerCallback(Object state)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.DispatchItemWithAutoreleasePool(Object workItem, Thread currentThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
```

```
ObjectDisposedException:
   *** Terminating app due to uncaught exception 'System.ObjectDisposedException', reason: 'The CancellationTokenSource has been disposed. (System.ObjectDisposedException)
      at System.Net.Http.NSUrlSessionHandler.NSUrlSessionHandlerDelegate.SetResponse(InflightData inflight) in xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 970
      at System.Net.Http.NSUrlSessionHandler.NSUrlSessionHandlerDelegate.DidReceiveData(NSUrlSession session, NSUrlSessionDataTask dataTask, NSData data) in xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 932
   '
   *** First throw call stack:
   (
      0   CoreFoundation                      0x0000000186e72ccc __exceptionPreprocess + 176
      1   libobjc.A.dylib                     0x000000018695a788 objc_exception_throw + 60
      2   nsurlsessionhandler                 0x0000000106d4562c xamarin_process_managed_exception + 1052
      3   nsurlsessionhandler                 0x00000001071a26c4 _ZL31native_to_managed_trampoline_53P11objc_objectP13objc_selectorPP11_MonoMethodS0_S0_S0_j + 1028
      4   nsurlsessionhandler                 0x00000001071ca8e0 -[System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate URLSession:dataTask:didReceiveData:] + 68
      5   CFNetwork                           0x000000018c0fe28c CFURLCredentialStorageCopyAllCredentials + 61900
      6   libdispatch.dylib                   0x0000000186b6c750 _dispatch_call_block_and_release + 32
      7   libdispatch.dylib                   0x0000000186b6e3e8 _dispatch_client_callout + 20
      8   libdispatch.dylib                   0x0000000186b75a14 _dispatch_lane_serial_drain + 748
      9   libdispatch.dylib                   0x0000000186b76578 _dispatch_lane_invoke + 432
      10  libdispatch.dylib                   0x0000000186b812d0 _dispatch_root_queue_drain_deferred_wlh + 288
      11  libdispatch.dylib                   0x0000000186b80b44 _dispatch_workloop_worker_thread + 404
      12  libsystem_pthread.dylib             0x0000000186d1b00c _pthread_wqthread + 288
      13  libsystem_pthread.dylib             0x0000000186d19d28 start_wqthread + 8
```

Disposing the CancellationTokenSource would be ideal, but the additional
complexity this would entail makes me question whether it's worth it: the
amount of entry points into this code makes it quite complex to keep track of
what the request has done, what it's doing and what's pending when things can
happen simultaneously on multiple threads at the same time, and keeping the
code thread-safe, and at the same time not accidentally not run into
deadlocks.

So it seems an easy fix would be to just not dispose the
CancellationTokenSource, the GC will eventually do it, even though MSDN
[says][1] quite clearly:

> Always call Dispose before you release your last reference to the CancellationTokenSource. Otherwise, the resources it is using will not be freed until the garbage collector calls the CancellationTokenSource object's Finalize method.

An additional note is that a network request's resource usage would already be
dwarfing any memory usage by the CancellationTokenSource, so it's unlikely
this will show up in any profiles.

So with this change we won't be disposing the CancellationTokenSource anymore.

Fixes https://github.com/xamarin/xamarin-macios/issues/11799.

[1]: https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtokensource.dispose?view=net-8.0
2024-03-19 08:28:51 +01:00
Rolf Bjarne Kvinge 4584da6842
[Foundation] Always call the completion handler in a few callbacks in NSUrlSessionHandler. (#20326)
Fixes these warnings:

    [API] API MISUSE: NSURLSession delegate System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate: <System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate: 0x600000676c60> (0x600000676c60)
    [API] API MISUSE: dataTask:didReceiveResponse:completionHandler: completion handler not called

    [API] API MISUSE: NSURLSession delegate System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate: <System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate: 0x600000676c60> (0x600000676c60)
    [API] API MISUSE: dataTask:willCacheResponse:completionHandler: completion handler not called

    [API] API MISUSE: NSURLSession delegate System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate: <System_Net_Http_NSUrlSessionHandler_NSUrlSessionHandlerDelegate: 0x6000002cffa0> (0x6000002cffa0)
    [API] API MISUSE: dataTask:willCacheResponse:completionHandler: completion handler not called

which is printed numerous times with the test case here:

https://github.com/xamarin/xamarin-macios/issues/11799#issuecomment-1988244584
2024-03-19 08:28:33 +01:00
Rolf Bjarne Kvinge f8f6fe852a
[bgen] Add support for copying xml documentation for enums fields. (#20323) 2024-03-19 08:27:47 +01:00
dotnet-maestro[bot] d10cd5d2cf
[main] Update dependencies from dotnet/xharness (#20320)
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 
- **Date Produced**: March 18, 2024 11:58:47 AM UTC
- **Commit**: 2eb3ea9fc22aa1b51ff4221bafbeeebc42ef5979
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.24160.7 to 9.0.0-prerelease.24168.1][1]

[1]: 36310c81ae...2eb3ea9fc2
2024-03-18 17:47:00 +01:00
Rolf Bjarne Kvinge 3bbe2c508f
[CoreMedia] Make the P/Invokes in CMBlockBuffer have blittable signatures. (#20318)
Contributes towards #15684.
2024-03-18 15:02:23 +01:00
Rolf Bjarne Kvinge d794245b42
[runtime] Fix conserving stack trace when re-throwing marshalled exceptions. Fixes #19417. (#20316)
The stack trace from unhandled exception is now:

    Unhandled managed exception: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') (System.ArgumentOutOfRangeException)
       at System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Item(Int32 index)
       at CrashiOS.RootViewController.GetItem() in /Users/rolf/test/bugs/StackTraceIssue/CrashiOS/RootViewController.cs:line 19
       at CrashiOS.RootViewController.<.ctor>b__1_0(Object _, EventArgs _) in /Users/rolf/test/bugs/StackTraceIssue/CrashiOS/RootViewController.cs:line 12
       at UIKit.UIBarButtonItem.Callback.Call(NSObject sender) in xamarin-macios/src/UIKit/UIBarButtonItem.cs:line 33
    --- End of stack trace from previous location ---
       at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2655
       at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in xamarin-macios/src/UIKit/UIApplication.cs:line 64
       at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in xamarin-macios/src/UIKit/UIApplication.cs:line 96
       at Program.<Main>$(String[] args) in /Users/rolf/test/bugs/StackTraceIssue/CrashiOS/Main.cs:line 26

as opposed to:

    Unhandled managed exception: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') (System.ArgumentOutOfRangeException)
       at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle)
       at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName)
       at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
       at Program.<Main>$(String[] args) in /Users/rolf/test/bugs/StackTraceIssue/CrashiOS/Main.cs:line 26

Fixes https://github.com/xamarin/xamarin-macios/issues/19417.
2024-03-18 15:02:12 +01:00
Rolf Bjarne Kvinge 72283a0818
[ObjCRuntime] Suppress trimmer warnings for certain Stret members. (#20313)
Contributes towards #10405.
2024-03-18 14:43:15 +01:00
dotnet-maestro[bot] 8d679b75a1
[main] Update dependencies from dotnet/installer (#20248)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240311.13
- **Date Produced**: March 11, 2024 9:28:24 PM UTC
- **Commit**: 3769468c6f08fcde14e152fe40b5a857aa826906
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.103-servicing.24119.1 to 8.0.104-servicing.24161.13][8]

[8]: 96079bf81d...3769468c6f
2024-03-18 09:01:09 +01:00
Rolf Bjarne Kvinge 87953eda87
[CoreGraphics] Make the remaining P/Invokes have blittable signatures. (#20310)
Contributes towards #15684.
2024-03-15 18:40:39 +01:00
Rolf Bjarne Kvinge c3437328bf
[ObjCRuntime] Suppress trimmer warnings for certain Blocks members. (#20309)
Contributes towards #10405.
2024-03-15 16:23:12 +01:00
Rolf Bjarne Kvinge 6b6259de64
[msbuild] Detect problems with long paths, and try to show a bit more helpful information. Fixes #20053. (#20298)
Ref: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1935561

Fixes https://github.com/xamarin/xamarin-macios/issues/20053.
2024-03-15 14:33:45 +01:00
Rolf Bjarne Kvinge 76482387c8
[SafetyKit] Added bindings for SafetyKit. (#20263)
This also required a minor generator fix to fix generation of async methods
with a nullable NSError.

---------

Co-authored-by: Israel Soto <issoto@microsoft.com>
2024-03-15 08:15:01 +01:00
Rolf Bjarne Kvinge 2453beaa5f
[CoreGraphics] Make P/Invokes in CGPDFScanner have blittable signatures. (#20304)
Contributes towards #15684.
2024-03-15 08:14:43 +01:00
Rolf Bjarne Kvinge a81a2d9bd4
[ObjCRuntime] Suppress trimmer warnings for certain DynamicRegistrar members. (#20300)
Contributes towards #10405.
2024-03-15 08:05:25 +01:00
Ryan Pendleton d08f2402d2
[AVKit] Add bindings for AVCaptureEventInteraction (#20296)
Resolves #20295
2024-03-14 17:29:19 +01:00
Rolf Bjarne Kvinge 2348736a2b
[DeviceDiscoveryExtension] Added bindings for DeviceDiscoveryExtension. (#20272)
---------

Co-authored-by: Israel Soto <issoto@microsoft.com>
2024-03-14 07:58:45 +01:00
Rolf Bjarne Kvinge d1f387c16a
[tests] Improve running bgen tests from the terminal. (#20303)
Make it appropriately quiet, and pass the project.

This makes the run-tests target work when there's also a .sln in the same
directory (which gets created automatically when opening the project in
VSCode).
2024-03-14 07:58:31 +01:00
Rolf Bjarne Kvinge f1d54e236a
[generator] Add support for XML documentation in the API definitions. Fixes #17397. (#20253)
* Enable generation of the documentation file (.xml) by the C# compiler when building projects (by passing the `DocumentationFlag` argument to the Csc task).
	* Also disable the CSC1591 warning, which complains about having public APIs without xml documentation; it just turns out to be annoying rather than helpful, since most APIs won't be documented.
* Add support in the generator for reading the .xml file next to the compiled api definition assembly, and then looking for documentation there when generating binding code.
	* When enabled, enable generation of the documentation file if the generator is compiling the api definitions.
	* Make it an opt-out, in case the new code causes problems.
* Add tests. 

Fixes https://github.com/xamarin/xamarin-macios/issues/17397.

---------

Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
2024-03-13 11:19:36 +01:00
Rolf Bjarne Kvinge 93ec62cc32
[CoreGraphics] Make P/Invokes in CGPDFObject have blittable signatures. (#20286)
Contributes towards #15684.
2024-03-13 11:16:42 +01:00
Rolf Bjarne Kvinge 9b8869b221
[runtime] Detect recursion when handling unhandled Objective-C exceptions. Fixes #14796. (#20276)
Detect recursion when handling unhandled Objective-C exceptions, which can happen if:

* We install a handler for unhandled Objective-C exceptions.
* An unhandled Objective-C exception is caught.
* We convert the unhandled Objective-C exception to a managed exception, and throw that.
* Nobody handles the managed exception either, so we convert it to an Objective-C exception and throw that.
* We re-enter the unhandled Objective-C exception handler, and the cycle continues.
* Eventually the process crashes due to a stack overflow.

Fixes https://github.com/xamarin/xamarin-macios/issues/14796.
2024-03-13 11:16:02 +01:00
Rolf Bjarne Kvinge 2a1300ed9d
[ObjCRuntime] Suppress trimmer warnings for certain Runtime members. (#20290)
Contributes towards #10405.
2024-03-13 11:06:51 +01:00
Sergey Nechaev 591311035e
Allow null for CGColorSpace.CreatePattern (#20294)
Per Apple docs for the `CGColorSpaceCreatePattern(CGColorSpaceRef
baseSpace)`, the `baseSpace` _should_ be null when creating the color
pattern. So, allow `null` here.

Fixes https://github.com/xamarin/xamarin-macios/issues/20293
2024-03-13 07:24:13 +01:00
Rolf Bjarne Kvinge 90a4288eb3
[ObjCRuntime] Suppress trimmer warnings for Class.ResolveToken. (#20278)
Contributes towards #10405.
2024-03-12 08:51:05 +01:00
dotnet-maestro[bot] e1e2a1e207
[main] Update dependencies from dotnet/xharness (#20289)
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240310.7
- **Date Produced**: March 10, 2024 10:53:37 PM UTC
- **Commit**: 36310c81aed0452963ebf26866fc9f1b95d72dbb
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.24129.1 to 9.0.0-prerelease.24160.7][1]

[1]: 9649ddab48...36310c81ae
2024-03-12 08:39:21 +01:00
Rolf Bjarne Kvinge ab63fd4e6b
[CoreGraphics] Make P/Invokes in CGPDFDocument have blittable signatures. (#20283)
Contributes towards #15684.
2024-03-11 08:15:35 +01:00
Rolf Bjarne Kvinge 58e382efb7
[DeviceDiscoveryUI] Added bindings for DeviceDiscoveryUI. (#20271)
Follow-up of #15762.

---------

Co-authored-by: Israel Soto <issoto@microsoft.com>
2024-03-08 10:07:39 +01:00
Rolf Bjarne Kvinge e462d9ee6d
[src] Fix capitalization in a few APIs for XAMCORE_5_0. (#20281) 2024-03-08 10:02:00 +01:00
Rolf Bjarne Kvinge a5fc5c1a88
[runtime] Fix min OS versions in various compiler and linker arguments. (#20275)
Once upon a time we needed to special case a higher min OS version that the
min OS version we supported for certain compiler/linker arguments, because we
used features not supported in the min OS version we supported.

That time has passed; in all cases our min OS version is now higher than the
special-cased min OS versions passed to native compilers/linkers, so we can
just use the actual min OS version we support.
2024-03-08 07:26:41 +01:00