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

7369 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 54fd609c01
[CoreFoundation] Implement Xcode 16.0 beta 1-6 changes. (#21116)
Note: there we no changes in beta 1, beta 2, beta 3, beta 4 or beta 6.

Additionally, none of the added APIs are APIs we'll bind for now,
they're rather specialized.
2024-08-27 13:56:03 +02:00
Rolf Bjarne Kvinge 0aed4d8aaf
[Network] Implement Xcode 16.0 beta 1-6 changes. (#21075)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 22:36:50 +02:00
Rolf Bjarne Kvinge adc67f1ef1
[MessageUI] Implement Xcode 16.0 beta 1-6 changes. (#20892)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 22:27:07 +02:00
Rolf Bjarne Kvinge 2c443ca50f
[ScreenCaptureKit] Implement Xcode 16.0 beta 1-6 changes. (#21071)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 22:26:19 +02:00
Rolf Bjarne Kvinge 7399ff9b32
[PdfKit] Implement Xcode 16.0 beta 1-6 changes. (#21034)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 20:01:16 +02:00
Rolf Bjarne Kvinge 863c31f861
[CoreAudioTypes] Implement Xcode 16.0 beta 1-6 changes. (#21019)
The capitalization of these new enum members matches the capitalization
of other MPEG* enum members in the same enum.

Note: there were no changes in beta 2, beta 4, beta 5 or beta 6.
2024-08-26 20:00:28 +02:00
Rolf Bjarne Kvinge 0cd9749b78
[MetalFX] Implement Xcode 16.0 beta 1-6 changes. (#21020)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 19:59:01 +02:00
Rolf Bjarne Kvinge 6d6e5ec1c3
[PhotosUI] Implement Xcode 16.0 beta 1-6 changes. (#21041)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 19:58:33 +02:00
Rolf Bjarne Kvinge c40115f294
[FSKit] Implement this new framework. (#21029)
Marked as a preview API, because this framework requires implementing a
user-space file system to validate anything, and that's a bit too much
at the moment.

Tentatively marking this for stable release in .NET 11.

Up-to-date until beta 6.
2024-08-26 19:58:03 +02:00
Rolf Bjarne Kvinge 762e628bd8
[CoreGraphics] Implement Xcode 16.0 beta 1-6 changes. (#21033)
Note: there were no changes in beta 3, beta 5 or beta 6.
2024-08-26 19:56:23 +02:00
Rolf Bjarne Kvinge 06798764a4
[bgen] Improve nullability detection to detect the nullability attributes the C# compiler generates. Fixes #17130. (#21099)
Fixes https://github.com/xamarin/xamarin-macios/issues/17130.
2024-08-26 19:10:40 +02:00
Rolf Bjarne Kvinge 19b925e54a
[GameKit] Implement Xcode 16.0 beta 1-6 changes. (#20880)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 19:08:55 +02:00
Rolf Bjarne Kvinge 6302fe77eb
[xcode16] Merge main into xcode16. (#21112) 2024-08-26 18:40:44 +02:00
Rolf Bjarne Kvinge beac080a06
[AutomaticAssessmentConfiguration] Implement Xcode beta 5-6 changes. (#21028)
There were no changes in beta 4 or beta 6.
2024-08-26 17:07:05 +02:00
Rolf Bjarne Kvinge 90acc663f9
[VideoSubscriberAccount] Implement Xcode 16.0 beta 1-6 changes. (#21067)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-26 17:05:44 +02:00
Rolf Bjarne Kvinge 0f06df6bf3
[CoreText] Implement Xcode 16.0 beta 1-6 changes. (#20878)
Note: there were no changes in beta 2, beta 3, beta 4 or beta 6.
2024-08-26 16:49:05 +02:00
Rolf Bjarne Kvinge 46506898d4
Bump to Xcode 16 beta 6. (#21088) 2024-08-26 16:21:58 +02:00
Rolf Bjarne Kvinge f417c91828
[system-dependencies] We don't need autotools anymore, so don't check for it. (#21104)
Autotools was required to build mono from source, which we haven't done
in a *long* time.
2024-08-26 11:34:44 +02:00
Rolf Bjarne Kvinge cc395235af [xcode16] Merge main into xcode16. 2024-08-26 10:46:00 +02:00
Rolf Bjarne Kvinge 15e2c21cd8
[xcode16] Merge main into xcode16. (#21097) 2024-08-26 10:45:09 +02:00
Rolf Bjarne Kvinge f3a7879a28
[CloudKit] Implement Xcode 16.0 beta 1-6 changes. (#20861)
The bindings that have been removed haven't fully been removed from the
headers, but it looks like they will be soon. These bindings have also been
deprecated since before the earliest OS versions we support, so there should
be no need to keep them around.

Removing them preemptively also lessens the risk of running into App Store
rejections in the future.

A few tests changes were needed to ignore the newly obsoleted/hidden APIs.

Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-23 16:44:32 +02:00
Rolf Bjarne Kvinge 6016b2c49d
[UniformTypeIdentifiers] Implement Xcode 16.0 beta 1-6 changes. (#21068)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-23 16:32:53 +02:00
Rolf Bjarne Kvinge d5b76740a4
[HomeKit] Implement Xcode 16.0 beta 1-6 changes. (#21080)
Note: there were no changes in beta 2, beta 4 or beta 6.
2024-08-23 12:18:22 +02:00
Rolf Bjarne Kvinge a4f9a50ea7
[SpriteKit] Implement Xcode 16.0 beta 1-6 changes. (#21053)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-23 11:49:29 +02:00
Rolf Bjarne Kvinge 0f70086682
[bgen] Fix generating delegates with nullable return types. #17109. (#21094)
Fixes https://github.com/xamarin/xamarin-macios/issues/17109.
2024-08-23 11:48:10 +02:00
Rolf Bjarne Kvinge d5b59443f3
[Foundation] Implement Xcode 16.0 beta 1-6 changes. (#21065)
Note: there were no changes in beta 2, beta 4, beta 5 or beta 6.
2024-08-23 11:43:49 +02:00
Rolf Bjarne Kvinge c7003b6bd8
[LocalAuthentication] Implement Xcode 16.0 beta 1-6 changes. (#20891)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-23 11:38:28 +02:00
Rolf Bjarne Kvinge 34dfc2cfb3
[Speech] Implement Xcode 16.0 beta 1-6 changes. (#21077)
There were no changes in beta 2, beta 4, beta 5 or beta 6.
2024-08-22 17:15:52 +02:00
Rolf Bjarne Kvinge fa7e84d7bf
[UserNotifications] Implement Xcode 16.0 beta 1-6 changes. (#21066)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 15:47:59 +02:00
Rolf Bjarne Kvinge 633b7a21c5 [xcode16] Merge main into xcode16. 2024-08-22 14:20:29 +02:00
Rolf Bjarne Kvinge 510d87299d
[ShazamKit] Implement Xcode 16.0 beta 1-6 changes. (#21051)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 14:08:33 +02:00
Rolf Bjarne Kvinge 622ffc4147
[CoreMidi] Move fields to the api definition. (#21043) 2024-08-22 11:58:09 +02:00
Rolf Bjarne Kvinge 9e58a82ac7
[CoreAnimation] Implement Xcode 16.0 beta 1-6 changes. (#21050)
I also added some missing APIs from earlier Xcode versions.

There were no changes in beta 1, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 11:35:41 +02:00
Rolf Bjarne Kvinge 942084e236
[Symbols] Implement Xcode 16.0 beta 1-6 changes. (#21056)
There were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 09:52:34 +02:00
Rolf Bjarne Kvinge ee7d65d99e
[QuickLook] Implement Xcode 16.0 beta 1-6 changes. (#21052)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 09:50:39 +02:00
Rolf Bjarne Kvinge ac516e8f38
[SceneKit] Implement Xcode 16.0 beta 1-6 changes. (#21055)
Note: there were changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 09:47:44 +02:00
Rolf Bjarne Kvinge 703efade7d
[MediaPlayer] Implement Xcode 16.0 beta 1-6 changes. (#21072)
Note: there were no changes in beta 2, beta 4, beta 5 or beta 6.
2024-08-22 09:39:45 +02:00
Rolf Bjarne Kvinge 47c7798ad7
[TVMLKit] Implement Xcode 16.0 beta 1-6 changes. (#21064)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-22 09:38:07 +02:00
Rolf Bjarne Kvinge e0a3240106
[QuickLookThumbnailing] Implement Xcode 16.0 beta 1-6 changes. (#21049)
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
2024-08-21 17:12:57 +02:00
Rolf Bjarne Kvinge 2fa8625416
[Photos] Implement Xcode 16.0 beta 1-6 changes. (#21040)
Note: there were no changes in beta 3, beta 4, beta 5 or beta 6.
2024-08-21 14:16:44 +02:00
Rolf Bjarne Kvinge dbcb10a525 [net9.0] Merge main into net9.0. 2024-08-21 12:26:22 +02:00
Rolf Bjarne Kvinge a64b3e33dc
[JavaScriptCore] Implement Xcode 16.0 beta 1-6 changes. (#20883)
Note: there were no changes in beta 2-6.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-08-21 11:04:25 +02:00
Rolf Bjarne Kvinge bd51954783 Merge remote-tracking branch 'origin/main' into dev/rolf/bump-main-in-xcode16-2024-08-19 2024-08-19 17:32:42 +02:00
Rolf Bjarne Kvinge 57578e7773
[xtro] Improve auto-sanitize to automatically delete empty files. (#21045) 2024-08-19 15:25:25 +02:00
Rolf Bjarne Kvinge 4bea0584c8 [xcode16] Merge main into xcode16. 2024-08-19 14:23:49 +02:00
Peter Collins c5e8a3dc78
Backport maestro and artifact drop infra improvements from net9.0 (#21057)
Backports the following maestro and artifact storage changes,
removing dependencies on bosstoragemirror and adding support
for passwordless maestro auth.


0d1bd7b1bc

ebf969ee40

2562461eeb
2024-08-19 14:10:17 +02:00
Rolf Bjarne Kvinge 854ca9321c
[dotnet-linker] Fix computing block signatures. Fixes #21008. (#21011)
When we compute the signature of a block for Objective-C, we need to use
parameters of the user-provided callback (and not the intermediate
UnmanagedCallersOnly method) to compute the signature.

This is because the intermediate method's parameters don't have all the
information we need to correctly compute the block signature (in
particular for the issue in question, the user callback has an `NSError`
parameter, while the intermediate method has an `IntPtr` parameter, and
these two parameter types show up differently in the block signature).

This is solved by adding the `UserDelegateType` attribute (which was
created for exactly this, and it's just in older generated code) to the
intermediate method, pointing to a delegate with the correct managed
signature.

Fixes https://github.com/xamarin/xamarin-macios/issues/21008.
2024-08-15 10:02:55 +02:00
Rolf Bjarne Kvinge a3dd5dd402
[xtro] Fix a few problem when validating DllImports. (#21026)
* Handle DllImports without an EntryPoint value correctly.
* Keep track of DllImports we've found separately, instead of removing entries
  from the list of DllImports we found. This fixes an issue with native
  functions that are declared more than once in the headers: we'd match the
  first instance to the DllImport, and then report the second one as 'not
  bound'.
2024-08-15 10:02:01 +02:00
Rolf Bjarne Kvinge 8fad547c92
[bgen] Add support for specifying the backing field for strong enums using a new BackingFieldType attribute. (#21016) 2024-08-14 21:20:43 +02:00
Rolf Bjarne Kvinge d8a8c33612
[CoreGraphics] Bind the CGSession API. (#21024)
And use it to ignore a few tests that fail when the screen is locked.
2024-08-14 19:41:28 +02:00
Rolf Bjarne Kvinge 3127c2e6c1 [net9.0] Merge main into net9.0. 2024-08-14 17:58:49 +02:00
Rolf Bjarne Kvinge 80a70faab9 [xcode16] Merge main into xcode16. 2024-08-14 17:52:54 +02:00
Rolf Bjarne Kvinge 76b69ffa13
[bgen] Add support for NSNumber as the underlying type for Objective-C fields. (#21018) 2024-08-14 13:43:31 +02:00
Rolf Bjarne Kvinge 7da04184cf
[tests] Improve the CustomizedCodeSigning tests to not depend on file order. (#20889)
The CustomizedCodeSigning test asserts that a certain condition shows a
particular error message from codesign.

There are multiple files in the app bundle that can trigger this particular
message, so change the logic to not assert on a particular file, instead use
assert on the remained of the error message.

Fixes this random test failure:

    Xamarin.Tests.DotNetProjectTest.CustomizedCodeSigning(iOS,"ios-arm64"): Failure when comparing error messages:
        Unexpected error message #0:
            Expected: /usr/bin/codesign exited with code 1:\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Diagnostics.DiagnosticSource.dll
            Actual: /usr/bin/codesign exited with code 1:\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64
        Unexpected error message #1:
            Expected: Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Diagnostics.DiagnosticSource.dll
            Actual: Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64
        All errors:
            /usr/bin/codesign exited with code 1:
                /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature
                /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all
                In subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64
                        Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature
                /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all
                In subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-08-12 18:58:17 +02:00
dotnet-maestro[bot] 2142e3190c
[net9.0] Update dependencies from dotnet/sdk (#20994)
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 9.0.0-rc.1.24406.14 to 9.0.0-rc.1.24408.12 (parent: Microsoft.NET.Sdk)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-rc.1.24406.14 to 9.0.0-rc.1.24408.12 (parent: Microsoft.NET.Sdk)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.0-rc.1.24379.5 to 9.0.0-rc.1.24402.2 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-rc.1.24406.14 to 9.0.0-rc.1.24408.12 (parent: Microsoft.NET.Sdk)

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

- **Subscription**: 3727984b-7a79-4ba3-37dd-08dbe6bddf31
- **Build**: 20240809.1
- **Date Produced**: August 9, 2024 8:31:14 AM UTC
- **Commit**: 43360291a50c9c7c471551f8f8363919d38014ea
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.NET.Sdk**: [from 9.0.100-rc.1.24408.2 to 9.0.100-rc.1.24409.1][9]
  - **Microsoft.NET.ILLink.Tasks**: [from 9.0.0-rc.1.24406.14 to 9.0.0-rc.1.24408.12][10]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-rc.1.24406.14 to 9.0.0-rc.1.24408.12][10]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: [from 9.0.0-rc.1.24379.5 to 9.0.0-rc.1.24402.2][11]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-rc.1.24406.14 to 9.0.0-rc.1.24408.12][10]

[9]: 196789faff...43360291a5
[10]: 4985021ebf...68511fd27f
[11]: bdc1e33d5d...edf3e90fa2
2024-08-12 11:22:46 +02:00
Rolf Bjarne Kvinge 1fca27f2bc [xtro] Fix Mac Catalyst stuff for Xcode 16 b5. 2024-08-09 19:05:12 +02:00
Rolf Bjarne Kvinge 5492bd1dd6 Merge remote-tracking branch 'origin/xcode16' into dev/rolf/bump-main-in-xcode16-2024-08-06 2024-08-09 18:27:41 +02:00
Manuel de la Pena c5383a19b1
[Xcode16] Bump Xcode to beta 5. (#20998)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-08-09 18:26:56 +02:00
Rolf Bjarne Kvinge 75be879708
[ObjCRuntime] Allow a null delegate in Runtime.ReleaseBlockWhenDelegateIsCollected. Fixes #20920. (#20999)
Allow a null delegate in Runtime.ReleaseBlockWhenDelegateIsCollected if the corresponding native pointer is also null.

Fixes https://github.com/xamarin/xamarin-macios/issues/20920.
2024-08-09 14:32:19 +02:00
Rolf Bjarne Kvinge fe71a5f38b [xtro] Fix Mac Catalyst stuff for Xcode 16. 2024-08-08 08:00:25 +02:00
Rolf Bjarne Kvinge 6d7193262a [net9.0] Merge main into net9.0. 2024-08-07 15:21:12 +02:00
Rolf Bjarne Kvinge 7e54b16412
[dotnet] Delay computing trimming options until MAUI has had a chance to change the default. (#20970)
See comment in code for a deeper explanation.

Partial fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2053707.

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2024-08-07 14:43:53 +02:00
Rolf Bjarne Kvinge 772c7153c8
[net9.0] [dotnet] Delay computing trimming options until MAUI has had a chance to change the default. (#20971)
See comment in code for a deeper explanation.

Partial fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2053707.
2024-08-07 14:43:15 +02:00
Rolf Bjarne Kvinge 2dc0efef4d [xcode16] Merge main into xcode16. 2024-08-06 19:53:09 +02:00
Rolf Bjarne Kvinge 47137d670a
[xtro] Enable Mac Catalyst. (#20974)
It didn't work at some point, but seems to be working fine now.

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2024-08-06 19:49:43 +02:00
dotnet-maestro[bot] a9c949762e
[net9.0] Update dependencies from dotnet/sdk (#20949)
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 9.0.0-preview.7.24366.18 to 9.0.0-rc.1.24378.5 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.AspNetCore.App.Ref**: from 9.0.0-rc.1.24375.10 to 9.0.0-rc.1.24379.7 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.7.24366.18 to 9.0.0-rc.1.24378.5 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.0-preview.7.24365.1 to 9.0.0-rc.1.24373.3 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.7.24366.18 to 9.0.0-rc.1.24378.5 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.DotNet.Cecil**: from 0.11.5-alpha.24324.1 to 0.11.5-alpha.24365.1 (parent: Microsoft.NETCore.App.Ref)

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

- **Subscription**: 3727984b-7a79-4ba3-37dd-08dbe6bddf31
- **Build**: 20240730.5
- **Date Produced**: July 30, 2024 10:19:29 PM UTC
- **Commit**: 10803eca35eef6e685924886ba74caf0bd9439ad
- **Branch**: refs/heads/main

- **Updates**:
  - **VS.Tools.Net.Core.SDK.Resolver**: [from 9.0.100-rc.1.24377.4 to 9.0.100-rc.1.24380.5][16]
  - **Microsoft.NET.ILLink.Tasks**: [from 9.0.0-preview.7.24366.18 to 9.0.0-rc.1.24378.5][17]
  - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0-rc.1.24375.10 to 9.0.0-rc.1.24379.7][18]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.7.24366.18 to 9.0.0-rc.1.24378.5][17]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: [from 9.0.0-preview.7.24365.1 to 9.0.0-rc.1.24373.3][19]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.7.24366.18 to 9.0.0-rc.1.24378.5][17]
  - **Microsoft.DotNet.Cecil**: [from 0.11.5-alpha.24324.1 to 0.11.5-alpha.24365.1][20]

[16]: 74dafbfb0c...10803eca35
[17]: 1f70f0cc66...0912e94a6c
[18]: 98ee50279a...27f2a011a4
[19]: 99ea0c06b8...40781ca2fc
[20]: 7e4af02521...e05101e694

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2024-08-05 20:16:13 +02:00
Alex Soto b4dff0b30a Merge remote-tracking branch 'origin/main' into dev/alex/net9-main-merge 2024-07-31 09:01:02 -04:00
Alex Soto 76769f17d5
[main] Enable dedup only when targeting arm64 (#20953)
Backport of https://github.com/xamarin/xamarin-macios/pull/20952

--------

## Description

Previous fix https://github.com/xamarin/xamarin-macios/pull/20945 did
not take into account that when we target non arm64 apple mobile
platforms we are using `MONO_AOT_MODE_INTERP_ONLY` which cannot use
dedup optimization as it discards AOT images during runtime.

## Changes

- Enable dedup only when targeting ARM64
- Fix tests to cover builds for both ARM64 and X64 builds

Finally, the change was tested against MAUI iossimulator-x64 template
app

---------

Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
2024-07-30 08:10:22 -04:00
Ivan Povazan 40a8eba6bf
Do not enable dedup when targeting `maccatalyst-x64` (#20945)
## Description

This is a follow-up PR to:
https://github.com/xamarin/xamarin-macios/pull/20936

We should not enable dedup when targeting `maccatalyst-x64` because in
case when the project file specifies
`MtouchInterpreter=all,-System.Private.CoreLib`, the build will run the
full AOT compiler with interpreter enabled.

In this setup the runtime is configured to run in interp only mode:
97a91cc4e3/tools/common/Target.cs (L812-L813)

which means that during runtime, AOT images will be ignored - aot
runtime will load them but mark them as unusuable since they are
compiled with `full` compiler switch and the code falls back to
interpreter (ref:
efebf202a4/src/mono/mono/mini/aot-runtime.c (L2131-L2148)
)

This is problematic for the `aot-instances` container image, which has a
special handling at the runtime and does not accept it to be marked as
unusable (we might want to revisit this in the future):

efebf202a4/src/mono/mono/mini/aot-runtime.c (L2527-L2529)

## Changes

This PR disables dedup optimization when targeting `maccatalyst-x64` and
updates the required tests to match the behavior.

---

Backports:

- [x] https://github.com/xamarin/xamarin-macios/pull/20946
- [x] Original reenabling of dedup for .NET 9 already includes these
changes: https://github.com/xamarin/xamarin-macios/pull/20941

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2024-07-26 18:44:07 -04:00
Alex Soto 73038144e7
[net9.0] Reenable dedup optimization for all AOT modes (#20941)
Backport of #20936

---

## Description

As part of the fix for: https://github.com/dotnet/runtime/issues/99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
https://github.com/xamarin/xamarin-macios/issues/20848

However, it turns out that disabling dedup optimization is not required
to fix https://github.com/dotnet/runtime/issues/99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
https://github.com/dotnet/runtime/issues/99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, condition `is_ok (error)' not met, function:init_jit_call_info, Attempting to JIT compile method '(wrapper other) void object:gsharedvt_out_sig (intptr)' while running in aot-only mode. See https://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
https://github.com/xamarin/xamarin-macios/issues/20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.

---------

Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2024-07-26 14:47:25 -04:00
Ivan Povazan 97a91cc4e3
Reenable dedup optimization for all AOT modes (#20936)
## Description

As part of the fix for: https://github.com/dotnet/runtime/issues/99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
https://github.com/xamarin/xamarin-macios/issues/20848

However, it turns out that disabling dedup optimization is not required
to fix https://github.com/dotnet/runtime/issues/99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
https://github.com/dotnet/runtime/issues/99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, condition `is_ok (error)' not met, function:init_jit_call_info, Attempting to JIT compile method '(wrapper other) void object:gsharedvt_out_sig (intptr)' while running in aot-only mode. See https://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
https://github.com/xamarin/xamarin-macios/issues/20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2024-07-25 19:50:21 -04:00
Alex Soto ce5350de25 Merge remote-tracking branch 'origin/main' into net9.0 2024-07-19 15:26:35 -04:00
Ivan Povazan 374e902075
NativeAOT: Enable building app extensions with NativeAOT (#20872)
### Description

This PR enables building app extensions with NativeAOT. 

App extensions are class libraries and to build them with NativeAOT we
must not specify `CustomNativeMain=true`. If we do, ILC would expect
that the input assembly has a managed Main as the module entry point.

Additionally, when building class libraries (with the absence of a
managed Main entry point), our static reference from:

2e5ef1eb1c/runtime/nativeaot-bridge.m (L39)

requires build-time symbol resolution. To avoid linking errors, we
generate an empty `__managed__Main`
in the native bootstrapping code of the app extension (e.g., in
`main.arm64.mm`).

### Testing

The unit tests have been introduced to test building app extensions with
both Mono and NativeAOT.
Executing an iOS app TodayExtension built with NativeAOT has been
verified manually on an actual device.

--- 
Fixes: https://github.com/xamarin/xamarin-macios/issues/20653
2024-07-19 08:03:49 -04:00
Alex Soto 9fa7696a30 Fix tests 2024-07-17 15:44:00 -04:00
Alex Soto 5b72d86f02 Merge remote-tracking branch 'xamarin/main' into xcode16 2024-07-16 22:58:16 -04:00
Rolf Bjarne Kvinge e1290d2f15
[net9.0] Bump to Xcode 15.4 packages instead of Xcode 15.1 packages as the latest .NET 8 stable. (#20888)
This also required some changes to the generation of the workload
manifest files, since the Xcode 15.4 packages support multi-targeting.

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2024-07-15 13:55:15 -04:00
Rolf Bjarne Kvinge d19f9508c2
[xcode16] Bump to Xcode 16 beta 3. (#20850) 2024-07-13 09:43:49 -04:00
Rolf Bjarne Kvinge f4bdeb661a
[MediaAccessibility] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20894)
Note: there were no changes in beta 2 or beta 3.
2024-07-13 09:39:43 -04:00
Rolf Bjarne Kvinge acb99cb31b
[LinkPresentation] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20887)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 14:48:36 -04:00
Rolf Bjarne Kvinge 1506abdd5e
[FileProvider] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20890)
Note: there were no changes in beta 3.
2024-07-12 14:47:27 -04:00
Rolf Bjarne Kvinge d1ec7a793f
[tests] Fix determining whether we're building for the simulator or not. (#20852)
The 'Platform=iPhoneSimulator' property is not necessarily set for .NET
projects, so don't rely on it.
2024-07-12 18:46:17 +02:00
Rolf Bjarne Kvinge 9201eaec21
[CallKit] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20858)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:46:00 +02:00
Rolf Bjarne Kvinge 319e5eb87b
[Intents] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20881)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:45:27 +02:00
Rolf Bjarne Kvinge e590cc8340
[IOSurface] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20879)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:45:05 +02:00
Rolf Bjarne Kvinge 06517e1a76
[ImageIO] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20875)
Note: there were no changes in beta 3.
2024-07-12 18:44:45 +02:00
Rolf Bjarne Kvinge 168bac88d7
[GameController] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20874)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:44:23 +02:00
Rolf Bjarne Kvinge ec61254a7f
[DeviceDiscoveryExtension] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20870)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:44:05 +02:00
Rolf Bjarne Kvinge 9a78097226
[CoreTelephony] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20863)
Note: there were no changes in beta 2 and beta 3.
2024-07-12 18:43:44 +02:00
Rolf Bjarne Kvinge 9f3b144c87
[CoreLocation] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20864)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:42:34 +02:00
Rolf Bjarne Kvinge 317c07b59c
[AVFoundation] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes (from AVFAudio only). (#20851)
Note: there were no changes in beta 2 and beta 3 in AVFAudio.
2024-07-12 18:42:11 +02:00
Rolf Bjarne Kvinge 17acc8eb64
[CoreBluetooth] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20859)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:41:40 +02:00
Rolf Bjarne Kvinge 0ccad3e8ff
[Contacts] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20860)
Note: there were no changes in beta 2 and beta 3.
2024-07-12 18:41:19 +02:00
Rolf Bjarne Kvinge c2bb0a04b5
[CoreMotion] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20862)
Note: there were no changes in beta 3.
2024-07-12 18:40:40 +02:00
Rolf Bjarne Kvinge 01400da900
[xtro] Get libclang-mono.dylib from where sharpie is. (#20815)
This fixes a crash when using a locally built sharpie - in which case we
shouldn't use the system libmono-clang.dylib, but the locally built one too.
2024-07-12 18:40:21 +02:00
Rolf Bjarne Kvinge 20a18e37c3
[AVKit] Implement Xcode 15 + Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20849)
Note: there were no changes in beta 2 or beta 3.
2024-07-12 18:39:56 +02:00
Rolf Bjarne Kvinge 451d2dd71e
[AutomaticAssessmentConfiguration] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. (#20847)
Note: there were no changes in beta 2 and beta 3.
2024-07-12 18:39:33 +02:00
Alex Soto 4486eb3b9f Merge remote-tracking branch 'xamarin/main' into dev/alex/main-net9.0 2024-07-11 18:53:54 -04:00
Rolf Bjarne Kvinge 219c74a3c4
[xcode15.4] Update bindings to Xcode 15.4 (#20865)
Co-authored-by: Alex Soto <alex@soto.dev>
2024-07-11 14:09:52 -04:00
dotnet-maestro[bot] dfa48ff895
[net9.0] Update dependencies from dotnet/sdk (#20794)
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 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24357.2 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.AspNetCore.App.Ref**: from 9.0.0-preview.6.24320.4 to 9.0.0-preview.7.24360.7 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24357.2 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.0-preview.6.24317.2 to 9.0.0-preview.7.24319.4 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24357.2 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.24313.1 to 0.11.5-alpha.24324.1 (parent: Microsoft.NETCore.App.Ref)

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

- **Subscription**: 3727984b-7a79-4ba3-37dd-08dbe6bddf31
- **Build**: 20240711.1
- **Date Produced**: July 11, 2024 8:29:26 AM UTC
- **Commit**: 81ac886071828da7f14d0c26d731ac06abd0c7f6
- **Branch**: refs/heads/main

- **Updates**:
  - **VS.Tools.Net.Core.SDK.Resolver**: [from 9.0.100-preview.7.24323.5 to 9.0.100-preview.7.24361.1][58]
  - **Microsoft.NET.ILLink.Tasks**: [from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24357.2][59]
  - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0-preview.6.24320.4 to 9.0.0-preview.7.24360.7][60]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24357.2][59]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: [from 9.0.0-preview.6.24317.2 to 9.0.0-preview.7.24319.4][61]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.6.24319.11 to 9.0.0-preview.7.24357.2][59]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.24313.1 to 0.11.5-alpha.24324.1][62]

[58]: ea9243f9cb...81ac886071
[59]: 117cfccdd7...4e278fe17f
[60]: 613c1e990b...71b5ef3f5c
[61]: 9880d891dd...ffe9afdc04
[62]: d145726036...7e4af02521
2024-07-11 19:58:14 +02:00
Alex Soto 2e5ef1eb1c
[xcode15.3] Bump to Xcode 15.3 bindings (#20780)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-07-11 11:41:31 +02:00
Rolf Bjarne Kvinge 4fd259d4dc
[tests] Simplify NWPathTest.EnumerateGatewayTest (#20853)
* Remove code to test NWPath.EnumerateInterfaces, because this method is already tested elsewhere.
* Assume that if the test fails to find any gateways, it might be because the
  current machine doesn't have any (which happens on one of my machines), and
  in that case ignore the test.
2024-07-10 21:40:50 +02:00
Rolf Bjarne Kvinge b3fc0d93ec
[src] Implement a more generic way of calling objc_msgSend with variadic arguments. (#20832)
Move the architecture-specific vargs implementation of UIAppearance.GetAppareance into a more generic way of calling objc_msgSend with variadic arguments.

This prepares the way for more APIs with variadic arguments (which is coming in Xcode 16).
2024-07-10 21:19:51 +02:00
Rolf Bjarne Kvinge 12264008df [xcode16] Merge main into xcode16. 2024-07-10 18:01:39 +02:00
Rolf Bjarne Kvinge ed77cd6224
[dotnet] Limit custom dotnet/runtime selection to the current .NET version. (#20840)
This way any tests using the previous .NET version still works.
2024-07-10 16:30:34 +02:00
Rolf Bjarne Kvinge 72d87db71c
[Xcode16] Allow the runtime to compile with Xcode 16 beta 2. (#20844)
Add support for Xcode 16 beta 2.

---------

Co-authored-by: Manuel de la Pena Saenz <mandel@microsoft.com>
2024-07-10 13:00:51 +02:00
Rolf Bjarne Kvinge 7ddf1284a5
[dotnet] Force 'AppendRuntimeIdentifierToOutputPath=true' for the inner build of universal apps. (#20839)
When building universal apps, each inner build must add the runtime identifier to the output path, otherwise the inner builds may conflict with eachother, overwriting eachother's files.

That's bad.

So we explicitly set `AppendRuntimeIdentifierToOutputPath` to `true` when building inner builds.
2024-07-10 13:00:05 +02:00
Rolf Bjarne Kvinge 180a7e0bb9
[tests] Fix a couple of minor issues. (#20843)
* xtro: Fix how we build the u2todo project to actually build the correct project.
* Don't import eng/Versions.props in several test projects, it's already imported in a Directory.Build.props further up the directory hierarchy.
2024-07-10 12:57:30 +02:00
Rolf Bjarne Kvinge 886d48d015 Merge remote-tracking branch 'origin/xcode16' into dev/rolf/xcode16-rolf 2024-07-09 17:56:13 +02:00
Rolf Bjarne Kvinge 4c5d826ad3 Update xtro. 2024-07-09 16:33:03 +02:00
Rolf Bjarne Kvinge c81cb4aa77
[xtro] Move xtro-sharpie.csproj to its own directory. (#20825)
This will make it easier to eventually migrate this project to .NET.
2024-07-09 16:25:39 +02:00
Rolf Bjarne Kvinge 1520e0ebbc
[tests] Update 'KnownFrameworkReference' and 'KnownRuntimePack' to the reference the correct dotnet/runtime version when using a custom dotnet/runtime. (#20838) 2024-07-09 14:17:58 +02:00
Rolf Bjarne Kvinge 7a26aaeb63 Add Xcode 16 b1 todos. 2024-07-09 13:11:11 +02:00
Rolf Bjarne Kvinge 6b427362a2 [xtro] Remove todos for deprecated APIs. 2024-07-09 10:39:38 +02:00
Rolf Bjarne Kvinge 1f6eff4529 [xtro] Bump Objective-Sharpie.
Also disable Objective-C modules when using sharpie, because clang fails to
compile the headers when modules are enabled for some reason.
2024-07-09 10:34:40 +02:00
Rolf Bjarne Kvinge c36628c001 [introspection] Add ignore for UITextLoupeSession's ctor. 2024-07-09 10:22:50 +02:00
Rolf Bjarne Kvinge 46fb027c3b [CoreImage] Implement Xcode 16.0 beta 1 and beta 2 changes.
Note: there were no beta 2 changes.
2024-07-09 10:22:50 +02:00
Rolf Bjarne Kvinge 2340af0510 [introspection] Update exceptions for Xcode 16 beta 1. 2024-07-09 10:22:37 +02:00
Rolf Bjarne Kvinge d5106e5dad [AuthenticationServices] Add new protocol conformances in Xcode 16 beta 1 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 34a06c8d4e [msbuild] Fix computing target device for tvOS.
Also use a tvOS storyboard (and not an iOS storyboard) for tvOS test projects (or
alternatively no storyboard at all, whenever that's possible).
2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 88ebfde8fa [tests] Adjust ProtocolTest to ignore any '?' attributes.
The '?' property attribute seems to be new in Xcode 16, and there's no
documentation about it, so ignore it.
2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 0384a291bf [monotouch-test] Simplify CalendarTest to allow multiple values for EKCalendar.Immutable.
We don't really care about the value, and keeping track of whether the
calendar is immutable or not to assert the right value is time-consuming, so
just don't do that.
2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge e4bebf07d9 [tests] Implement Xcode 16 version check for TestRuntime.CheckXcodeVersion. 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 093b31097c [monotouch-test] Misc adjustment for Xcode 16 beta 1. 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 33432692f1 [monotouch-test] Run AudioComponentTest.Validate in a background thread.
It hangs for me, which makes the entire test run hang if it happens on the main thread.
2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 464c7003f5 [tests] Ignore a watchOS test that makes clang crash. 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge d1d7e74f1f [tests] Skip the linker warning about -ld_classic going away in legacy Xamarin tests. 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge 29ad60906a [monotouch-test] Adjust MonoTouchFixtures.HealthKit.CdaDocumentSampleTest to expect various exception messages.
Apple has flip-flopped between the two possible exception messages depending
on platform and OS version, and it's difficult and annoying to keep track.

So just don't: always accept either exception message. It doesn't really matter which one we get.s
2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge bb1171fb03 [tests] Fix the GetMlaunchRunArguments test to not require an update on every OS bump. 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge fb4215105d [tests] Update cecil-tests with known documentation failures. 2024-07-09 10:22:35 +02:00
Rolf Bjarne Kvinge 4b5e6c9b2d Xcode 16, here we come 2024-07-09 10:22:35 +02:00
Rolf Bjarne Kvinge 0e7a808958 [net9.0] Merge main into net9.0. 2024-07-08 18:45:06 +02:00
Rolf Bjarne Kvinge 26ede64161
[tests] Make the generator tests in the Makefile use the locally installed Xamarin.iOS/Xamarin.Mac. (#20821) 2024-07-08 18:30:36 +02:00
Rolf Bjarne Kvinge ddaf7822f9
[devops] Copy XMA's NuGet.config to XMA's home directory. (#20819)
This way we're using the same NuGet configuration even when executing outside
of XMA's .NET directory.

Also collect a bit more diagnostic info.
2024-07-08 18:30:21 +02:00
Rolf Bjarne Kvinge 544b96817f
[xtro] Fix version comparison with macOS 10.7. (#20816)
This also required updating the xtro files.
2024-07-08 18:30:14 +02:00
Rolf Bjarne Kvinge 9582522ccb
[xtro] Convert most projects to .NET projects. (#20760)
Convert all projects except xtro-sharpie.csproj to .NET projects.
xtro-sharpie.csproj can't be converted yet, because it depends on
Objective-Sharpie, which hasn't been converted yet.
2024-07-05 14:54:29 +02:00
Rolf Bjarne Kvinge c930ab321b
[monotouch-test] Remove ignore for Mac Catalyst. (#20810)
Apple says the bug on their side causing a runtime crash has been fixed since
macOS 12, so unignore the code and add a version check for macOS 12.

Fixes https://github.com/xamarin/maccore/issues/2345.
2024-07-04 14:16:38 +02:00
Rolf Bjarne Kvinge 6da82734ee
[src/tools] Propagate the BackwardsCompatibleCodeGeneration field from Protocol attributes in bindings to the generated code. (#20804)
Also fix the MustSetBackwardsCompatibleCodeGenerationToFalse test to skip
protocols that actually set BackwardsCompatibleCodeGeneration=false.
2024-07-03 20:18:13 +02:00
Rolf Bjarne Kvinge 323d28c220
[Foundation] Make the generic collection classes' generic GetEnumerator methods public. (#20808)
When finding an enumerator for the given code:

```cs
var collection = new NSSet<NSNumber> ();
foreach (var item in collection) {
	// ...
}
```

the C# compiler will first look for any `GetEnumerator` methods. The non-generic `NSSet` class defines a `IEnumerator<NSObject> GetEnumerator<NSObject> ()` method, which, since the generic `NSSet<T>` class doesn't define such a method, is selected.

The end result is that the type of the foreach element is `NSObject`
(`GetEnumerator`'s return type') - which is somewhat unexpected:

```cs
var collection = new NSSet<NSNumber> ();
foreach (var item in collection) {
	Console.WriteLine (item.LongValue); // error CS1061: 'NSObject' does not contain a definition for 'LongValue'
}
```

The fix is to define a  `IEnumerator<T> GetEnumerator<T> ()` method in the
generic `NSSet<T>` class, which the C# will find and choose over the base
class' method. Then the type of the foreach element is the correct type, and
the following code works:

```cs
var collection = new NSSet<NSNumber> ();
foreach (var item in collection) {
	Console.WriteLine (item.LongValue); // it works!
}
```

Do this for all our generic collection classes.

Also document these methods + all the other public `GetEnumerator` methods.
2024-07-03 20:16:53 +02:00
Šimon Rozsíval 68897de20f
[net9.0] Do not suppress trim analysis warnings when NativeAOT is enabled (#20767)
We noticed we weren't seeing trim analysis warnings in VS Code when
PublishAot was set to true. There was a recent change that correctly
disabled the suppressions when TrimMode is full. We need to make sure
that we're also getting the trim analysis warnings in dotnet build with
PublishAot but suppress them when publishing (in that case the warnings
will come later from ILC). This PR aligns the behavior of
PublishAot=true and TrimMode=true in debug builds.
2024-07-03 18:22:44 +02:00
Rolf Bjarne Kvinge a28cf64a8c
[msbuild] Don't support RuntimeIdentifiers for Hot Restart. (#20750)
There's no need to support `RuntimeIdentifiers` (plural) for Hot Restart
(because we don't have any scenarios where multiple runtime identifiers
applies to iOS; a single runtime identifier can always be used).

Adding support would make our code base more complex, so just avoid it by
showing an early error if someone tries (which is likely to be accidental
anyways).

This way we show an actionable error message for a scenario customers will
probably be confused about (because the build would fail in rather
inexplicable ways) if they run into it.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/19262.
2024-07-01 19:26:57 +02:00
Rolf Bjarne Kvinge dd50b20972 [net9.0] Merge main into net9.0. 2024-06-28 12:40:06 +02:00
Rolf Bjarne Kvinge 5f7792ab91
[tests] Fix BuildBindingsTest expectations. (#20768)
Fix BuildBindingsTest expectations to expect the resources in either a sidecar or a zipped sidecar.

Fixes this test failure:

    Xamarin.Tests.DotNetProjectTest.BuildBindingsTest(TVOS): Bundle existence
    Expected: file or directory exists
    But was: "/Users/builder/azdo/_work/1/s/xamarin-macios/tests/bindings-test/dotnet/tvOS/bin/Debug/net8.0-tvos/bindings-test.resources.zip"
2024-06-27 09:38:12 +02:00
Rolf Bjarne Kvinge 9b7ff19b47
[src] Fix definition of AVSampleCursorAudioDependencyInfo for Mac Catalyst. (#20781)
We need the backwards compatible code for the
AVSampleCursorAudioDependencyInfo struct (i.e. use the
AVSampleCursorAudioDependencyInfo_Blittable version), so adjust the ifdefs
accordingly - which wasn't obvious at first, because __IOS__ is defined for
Mac Catalyst.

Also fix the corresponding test, because it would cache the result of
computing whether a struct was blittable or not, but that's not true across
platforms ("AVSampleCursorAudioDependencyInfo" is blittable on iOS, but not on
Mac Catalyst). The result was that the test would incorrectly pass if we
processed Microsoft.iOS.dll before Microsoft.MacCatalyst.dll. The fix is to
cache per platform, instead of using a global cache.
2024-06-26 14:17:58 +02:00
Rolf Bjarne Kvinge 884522f678 [net9.0] Merge main into net9.0. 2024-06-25 17:30:49 +02:00
dotnet-maestro[bot] 4a9bfcb154
[net9.0] Update dependencies from dotnet/sdk (#20621)
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 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24281.1 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.AspNetCore.App.Ref**: from 9.0.0-preview.5.24256.2 to 9.0.0-preview.6.24305.3 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24281.1 (parent: VS.Tools.Net.Core.SDK.Resolver)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.0-preview.5.24223.2 to 9.0.0-preview.6.24277.2 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24281.1 (parent: VS.Tools.Net.Core.SDK.Resolver)

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

- **Subscription**: 3727984b-7a79-4ba3-37dd-08dbe6bddf31
- **Build**: 20240605.17
- **Date Produced**: June 5, 2024 11:40:08 PM UTC
- **Commit**: 6ecc573c92a1237627b37310c6aec65ff3caacc8
- **Branch**: refs/heads/main

- **Updates**:
  - **VS.Tools.Net.Core.SDK.Resolver**: [from 9.0.100-preview.5.24262.2 to 9.0.100-preview.6.24305.17][65]
  - **Microsoft.NET.ILLink.Tasks**: [from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24281.1][66]
  - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0-preview.5.24256.2 to 9.0.0-preview.6.24305.3][67]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24281.1][66]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: [from 9.0.0-preview.5.24223.2 to 9.0.0-preview.6.24277.2][68]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24281.1][66]

[65]: 1741345c63...6ecc573c92
[66]: 84b3339505...3750ac5161
[67]: da3aa27233...8adff2c3cf
[68]: 53288f87c5...fae2c95346

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2024-06-25 13:49:44 +02:00
Rolf Bjarne Kvinge 2f9ddc1933
[Foundation] Add missing properties to NSCharacterSet. Fixes #20745. (#20761)
Fixes https://github.com/xamarin/xamarin-macios/issues/20745.
2024-06-21 18:37:16 +02:00
Rolf Bjarne Kvinge 7cb7f705ca [net9.0] Merge main into net9.0. 2024-06-21 11:19:27 +02:00
Rolf Bjarne Kvinge 10f3b5ae32
[tests] Convert the testgenerator.csproj to a .NET project. (#20740) 2024-06-19 15:10:54 +02:00
Rolf Bjarne Kvinge 6c2a7a9eac
[msbuild] The DTPlatformName is supposed to be 'macosx' for Mac Catalyst. (#20720)
Change how we compute DTPlatformName so that it's 'macosx' for Mac Catalyst.
The PlatformUtils.GetTargetPlatform returns SdkPlatform for all platforms
except Mac Catalyst, where it returns the same as for macOS (i.e. 'macosx').
It also returns a lowercased value, so we don't need to do that either.

This is a partial fix for https://github.com/xamarin/xamarin-macios/issues/20714.
2024-06-17 20:19:06 +02:00
Rolf Bjarne Kvinge e7586e4411 [net9.0] Merge main into net9.0. 2024-06-12 15:08:25 +02:00
Rolf Bjarne Kvinge 9c2bd68d92
[src] Remove a few MarshalAs attributes in various APIs. (#20704)
In these cases the APIs in question aren't used in P/Invokes at the moment,
but that may change, so just make as much as we can blittable by removing any
MarshalAs attributes.
2024-06-10 19:11:47 +02:00
Rolf Bjarne Kvinge 1216646909
[runtime] Use strnlen instead of strlen. (#20702)
Apparently it's safer.
2024-06-10 13:02:42 +02:00
Rolf Bjarne Kvinge 3ab838ef6d
[GameController] Make a few structs blittable. (#20697)
Make a few GameController structs blittable, which requires some workarounds
to the fact that these changes would be breaking changes - we're keeping the
old structs, and instead introduce internal blittable versions which are then
used in the api definitions (and thus generated P/Invokes).
2024-06-10 11:52:24 +02:00
Rolf Bjarne Kvinge 34f58bbed4
[runtime] Use calloc instead of malloc. (#20692)
It's safer, since the returned memory is zero-initialized.

Also add tests.
2024-06-07 16:56:54 +02:00
Rolf Bjarne Kvinge e9d59d5f58
[bgen] Implement support for using default interface members to bind protocols. (#20681)
Given the following API definition:

```cs
[Protocol]
public interface Protocol {
    [Abstract]
    [Export ("requiredMethod")]
    void RequiredMethod ();

    [Export ("optionalMethod")]
    void OptionalMethod ();
}
```

we're now binding it like this:

```cs
[Protocol ("Protocol")]
public interface IProtocol : INativeObject {
    [RequiredMember]
    [Export ("requiredMethod")]
    public void RequiredMethod () { /* default implementation */ }

    [OptionalMember]
    [Export ("optionalMethod")]
    public void OptionalMethod () { /* default implementation */ }
}
```

The main difference from before is that the only difference between required
and optional members is the [RequiredMember]/[OptionalMember] attributes.

This has one major advantage: it's now possible to switch a member from being
required to being optional, or vice versa, without breaking neither source nor
binary compatibility.

It also improves intellisense for optional members. In the past optional
members were implemented using extension methods, which were not very
discoverable when you were supposed to implement a protocol in your own class.

The main downside is that the C# compiler won't enforce developers to
implement required protocol members (which is a necessary side effect of the
fact that we want to be able to switch members between being required and
optional without breaking compatibility). If this turns out to be a problem,
we can implement a custom source analyzer and/or linker step that detects
missing implementations and issue warnings/errors.

This PR also:

* Adds numerous tests.
* Updates the requiredness of a few members in Metal to test that it works as
  expected.
* Adds documentation.
* Handles numerous corner cases, which are documented in code and docs.

This PR is probably best reviewed commit-by-commit.

Fixes https://github.com/xamarin/xamarin-macios/issues/13294.
2024-06-07 16:35:48 +02:00
Milos Kotlar 603781b63f
Enable dedup optimization in FullAOT mode only (#20687)
## Description

This PR enables the dedup optimization in FullAOT mode only. The
optimization can only run in FullAOT mode with complete application
context. Without it, the AOT compiler may fail to collect all generic
instances, and the runtime can't find them as they are searched in the
dedup assembly.

## Changes

This PR updates the SDK targets to enable dedup optimization in FullAOT
mode only. This change doesn't depend on any runtime changes.

## Verification

This PR also introduces partial AOT tests. They inspect the bundle for
`aot-instances.dll`, which shouldn't be generated in a partial AOT
compilation setup. Additionally, basic functionality is tested by
asserting at app startup.

## Additional notes

This change should be backported to .NET 8 as well.

Fixes https://github.com/dotnet/runtime/issues/99248
2024-06-07 13:21:41 +02:00
Rolf Bjarne Kvinge ae155a9798
[AVFoundation] Numerous improvements to the AVSampleCursor type + some other structs. (#20685)
* The AVSampleCursor type was made available on all platforms two years ago (as
  opposed to only macOS before that), so update availability attributes accordingly.

* Also make a few structs used by AVSampleCursor blittable (AVSampleCursorSyncInfo,
  AVSampleCursorDependencyInfo, AVSampleCursorChunkInfo, AVSampleCursorAudioDependencyInfo)

  This got a bit complicated, because some of the non-blittable members of these structs
  are public. This meant a workaround had to be implemented:

  * Rename the properties that use these structures - appending "_Blittable" - and
    make them internal.
  * Create internal "*_Blittable" versions of the structures, and a make the "_Blittable"
    properties return these structures.
  * Bind the properties again, wrapping the internal versions and manually converting
    from the blittable structures to the non-blittable structures.

  Note that since some of the properties are new on iOS and tvOS, we don't need the
  compatibility workaround for these platforms.

Contributes towards #15684.
2024-06-06 17:19:17 +02:00
Rolf Bjarne Kvinge 7e9abebc8e Merge remote-tracking branch 'origin/main' into bump-main-in-net9.0-2024-06-05 2024-06-06 11:03:04 +02:00
Rolf Bjarne Kvinge 7670afb6aa
[src/docs] Add xml documentation for types. (#20672)
Import all the xml documentation for types from https://github.com/xamarin/apple-api-docs.

Some of this documentation should probably be rewritten, and potentially moved
to conceptual documentation, in particular those that contain images (because
images can't be imported into xml documentation).

Note that the documentation hasn't been modified in any way; that's not the purpose of this PR. If documentation should be modified for whatever reason, it can be done in a later PR.

The xml documentation for members will come in a later PR.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/17399.
2024-06-06 07:37:52 +02:00
Rolf Bjarne Kvinge 0e537376a4 [net9.0] Merge main into net9.0. 2024-06-05 17:23:29 +02:00
Rolf Bjarne Kvinge 5566f4912c
[cecil-tests] Fix blittability check for parameters whose types are pointers. (#20683) 2024-06-05 14:04:14 +02:00
Rolf Bjarne Kvinge 9657179d8c
[cecil-tests] Add new test to verify that we don't have any MarshalAs attributes. (#20678)
This is mostly to ensure that in XAMCORE_5_0 we fix all APIs with MarshalAs
attributes, because in order to not break binary compatibility, we can't fix
all of these failures right now.

Additionally it ensures we don't add more APIs with MarshalAs attributes.
2024-06-04 16:38:43 +02:00
Rolf Bjarne Kvinge 05a9b0872f
[src] Make a few P/Invokes stragglers have blittable signatures. (#20675)
Contributes towards #15684.
2024-06-04 14:51:51 +02:00
Rolf Bjarne Kvinge aa25b1e191
[tests] Fix BundleStructure when building for only tvOS. (#20677)
Fix BundleStructure when building for only tvOS by detecting whether the
bindings are zipped or not by detecting the presence of the zip file, instead
of computing it based on the current platform (which becomes problematic,
because whether or not a binding project produces a zip file may depend on
whether other platforms are enabled or not).
2024-06-04 09:07:51 +02:00
Rolf Bjarne Kvinge 5557fa32bc
[Network] Make the remaining P/Invokes have blittable signatures. (#20668)
Contributes towards #15684.
2024-06-03 14:29:01 +02:00
Rolf Bjarne Kvinge 5c5a4580ec
[Network] Make P/Invokes in NWConnection[Group] have blittable signatures. (#20662)
Contributes towards #15684.
2024-05-31 13:24:20 +02:00
Rolf Bjarne Kvinge 7b3ad09aac
[bgen] Add support for binding static members in protocols. (#20645)
Add support for binding static members in protocols.

Given the following API definition:

```cs
[Protocol]
public interface Protocol {
    [Abstract]
    [Static]
    [Export ("requiredStaticMethod")]
    void RequiredStaticMethod ();

    [Static]
    [Export ("optionalStaticMethod")]
    void OptionalStaticMethod ();

    [Abstract]
    [Static]
    [Export ("requiredStaticProperty")]
    IntPtr RequiredStaticProperty { get; set; }

    [Static]
    [Export ("optionalStaticProperty")]
    IntPtr OptionalStaticProperty { get; set; }
}
```

we're binding it like this:

```cs
[Protocol ("Protocol")]
public interface IProtocol : INativeObject {
    [Export ("requiredStaticMethod")]
    public static void RequiredStaticMethod<T> () where T: NSObject, IProtocol { /* implementation */ }

    [Export ("optionalStaticMethod")]
    public static void OptionalStaticMethod<T> () where T: NSObject, IProtocol { /*  implementation */ }

    [Property ("RequiredStaticProperty")]
    [Export ("requiredStaticProperty")]
    public static IntPtr GetRequiredStaticProperty<T> () where T: NSObject, IProtocol { /* implementation */ }

    [Property ("RequiredStaticProperty")]
    [Export ("setRequiredStaticProperty:")]
    public static void SetRequiredStaticProperty<T> (IntPtr value) where T: NSObject, IProtocol { /* implementation */ }

    [Property ("OptionalStaticProperty")]
    [Export ("optionalStaticProperty")]
    public static IntPtr GetOptionalStaticProperty<T> () where T: NSObject, IProtocol { /* implementation */ }

    [Property ("OptionalStaticProperty")]
    [Export ("setOptionalStaticProperty:")]
    public static void SetOptionalStaticProperty<T> (IntPtr value) where T: NSObject, IProtocol { /* implementation */ }
}
```

Also add documentation and tests.
2024-05-31 13:00:57 +02:00
Rolf Bjarne Kvinge 3efa6c21ff
[tests] Skip framework-test on iOS and tvOS. (#20590)
This test doesn't work when building on iossimulator-arm64 or
tvossimulator-arm64, because we're trying to use a fat framework which doesn't
have that architecture (it contains the device arm64 architecture instead).

So just disable this test on iOS and tvOS - the solution is using an
xcframework, and we already have a different test for that.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-30 10:34:14 +02:00
Rolf Bjarne Kvinge 13cec0c657
[AppKit] Improve bindings for NSPasteboard and NSPasteboardReading a bit. (#20643)
* Create strong enums for NSPasteboardType and NSPasteboardName.
* Bind the NSPasteboardReading constructor.

Ref: https://github.com/xamarin/xamarin-macios/issues/14039
2024-05-30 08:23:54 +02:00
Rolf Bjarne Kvinge 36bc43f7dc
[CryptoTokenKit] Bind this framework. Fixes #7876. (#20587)
Fixes https://github.com/xamarin/xamarin-macios/issues/7876.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-29 20:38:40 +02:00
Rolf Bjarne Kvinge a0b858ad47
[runtime] Call mono_unhandled_exception to raise AppDomain.UnhandledException. (#20656)
Call mono_unhandled_exception to raise AppDomain.UnhandledException when
managed exceptions are unhandled.

Partial fix for #15252 (for MonoVM, still pending for CoreCLR, which
needs https://github.com/dotnet/runtime/issues/102730 fixed first).
2024-05-29 20:14:47 +02:00
Rolf Bjarne Kvinge 1c7604cde2
[Network] Make P/Invokes in NW*Descriptor and NWWebSocket* have blittable signatures. (#20659)
Contributes towards #15684.
2024-05-29 19:20:54 +02:00
Rolf Bjarne Kvinge 2100580024
[Network] Make P/Invokes in NWFramer[Message] have blittable signatures. (#20647)
Contributes towards #15684.
2024-05-29 11:25:34 +02:00
Rolf Bjarne Kvinge 59e84a5e6c
[NSUrlSessionHandler] Only update the request's RequestUri if a redirection occurred. Fixes #20629. (#20633)
The logic to update the request's RequestUri is somewhat old:

518ac1bf19

but it makes sense to do so.

Some testing with a console app, also revealed that a plain .NET does this in
case of a redirect:

```cs
async static Task Main ()
{
    var client = new HttpClient () { BaseAddress = new Uri("https://httpbin.org") };
    var request = new HttpRequestMessage (HttpMethod.Get,
        "/redirect-to?url=https%3A%2F%2Fmicrosoft.com&status_code=302&queries[]={}"
    );
    Console.WriteLine ($"Request uri 1: {request.RequestUri}");
    var response = await client.SendAsync(request);
    Console.WriteLine ($"Request uri 2: {request.RequestUri}");
    var content = await response.Content.ReadAsStringAsync();
    Console.WriteLine ((int) response.StatusCode);
    Console.WriteLine(content.Length);
}
```

prints:

```
Request uri 1: /redirect-to?url=https%3A%2F%2Fmicrosoft.com&status_code=302&queries[]={}
Request uri 2: https://www.microsoft.com/es-es/
200
201252
```

Further looking into .NET's code, `SocketsHttpHandler` updates RequestUri after
following a redirect:

f5eb26e4da/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs (L65-L66)

So it seems the expected behavior is to update RequestUri only in case of a
redirect.

Now the question becomes: how to detect whether we're a redirect or not?
Contrary to `SocketsHttpHandler`, we don't do the actual redirect, it's
handled transparently by `NSUrlSession`.

Fortunately `NSUrlSessionTask` has two properties which help:
[`OriginalRequest`][1] and [`CurrentRequest`][2]. According to Apple's
documentation, these are the same, "except when the server has responded to
the initial request with a redirect to a different URL."

This sounds perfect for us, so use these two properties to determine whether a redirect occurred.

Note that we can't use object identity, because these are 'copy' properties,
which means they'll never be the same instances, only at most a copy of
eachother. So instead compare the `AbsoluteString` property to check for
equality. As far as I'm aware, none of the other properties (request body,
headers, cookies, etc.) can be set by the server in a redirect, so there's no
need to compare those.

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

[1]: https://developer.apple.com/documentation/foundation/nsurlsessiontask/1411572-originalrequest
[2]: https://developer.apple.com/documentation/foundation/nsurlsessiontask/1411649-currentrequest
2024-05-28 17:35:59 +02:00
Rolf Bjarne Kvinge 3c50f16fbe
[MediaToolbox] Make P/Invokes in MTAudioProcessingTap.cs have blittable signatures. (#20642)
Contributes towards #15684.
2024-05-28 14:58:06 +02:00
Rolf Bjarne Kvinge 4d75d06ab2
[msbuild] Unify MonoBundlingExtraArgs and MtouchExtraArgs into AppBundleExtraOptions. Fixes #12807. (#20594)
Fixes https://github.com/xamarin/xamarin-macios/issues/12807.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-28 14:57:52 +02:00
Rolf Bjarne Kvinge 8c39f793ac [net9.0] Merge main into net9.0. 2024-05-28 08:37:23 +02:00
Rolf Bjarne Kvinge 6d764a8bc6
[GameController] GCMouse doesn't conform to NSCoding/NSSecureCoding. (#20641)
GCMouse doesn't conform to NSCoding/NSSecureCoding, so fix the API definition.
Since this would be a breaking change, also add compat code to preserve binary
compatibility.

Fixes this test:

    Introspection.MacApiSelectorTest
        [FAIL] InstanceMethods :   1 errors found in 33428 instance selector validated:
            Selector not found for GameController.GCMouse : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on GameController.GCMouse
                Expected: 0
                But was:  1
        [FAIL] Selector not found for GameController.GCMouse : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on GameController.GCMouse
             at Introspection.ApiSelectorTest.InstanceMethods() in /Users/rolf/work/maccore/net9.0/xamarin-macios/tests/introspection/ApiSelectorTest.cs:line 1121
2024-05-28 08:34:15 +02:00
Rolf Bjarne Kvinge 85ff5f7e53
[AudioUnit] Make P/Invokes in AUGraph.cs have blittable signatures. (#20636)
Contributes towards #15684.
2024-05-27 12:29:01 +02:00
Rolf Bjarne Kvinge 475ef600b8
[monotouch-test] Be a bit more lenient with expected results in CGImageSourceTest. (#20640)
The exact results seem to depend on a lot of factors, so just accept them all.
2024-05-27 12:26:18 +02:00
Rolf Bjarne Kvinge 0e2fec81be
[Network] Make P/Invokes in NWProtocol* have blittable signatures. (#20638)
Contributes towards #15684.
2024-05-24 14:03:37 +02:00
Rolf Bjarne Kvinge f78af68fb2
[bgen] Add support for binding constructors in protocols. Fixes #14039. (#20583)
Add support for binding constructors in protocols.

Given the api definition:

```cs
[Protocol]
public interface Protocol {
    [Abstract]
    [Export ("init")]
    IntPtr Constructor ();

    [Export ("initWithValue:")]
    IntPtr Constructor (IntPtr value);

    [BindAs ("Create")]
    [Export ("initWithPlanet:")]
    IntPtr Constructor ();
}
```

we're binding it like this:

```cs
[Protocol ("Protocol")]
public interface IProtocol : INativeObject {
    [Export ("init")]
    public static T CreateInstance<T> () where T: NSObject, IProtocol { /* default implementation */ }

    [Export ("initWithValue:")]
    public static T CreateInstance<T> () where T: NSObject, IProtocol { /* default implementation */ }

    [Export ("initWithPlanet:")]
    public static T Create<T> () where T: NSObject, IProtocol { /* default implementation */ }
}
```

Also add documentation and tests.

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

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Alex Soto <alex@soto.dev>
2024-05-24 11:29:53 +02:00
Rolf Bjarne Kvinge 536f0a1ab7
[runtime] Add support for additional type encodings. Fixes #18562. (#20521)
Fixes https://github.com/xamarin/xamarin-macios/issues/18562.
2024-05-23 16:21:43 +02:00
Rolf Bjarne Kvinge 1127798185 [net9.0] Merge main into net9.0. 2024-05-23 11:25:55 +02:00
Rolf Bjarne Kvinge 0f91fcdfbc
[cecil-tests] Fix assertion message to use the doc id instead of the typename of a tuple. (#20632)
So instead of this:

> Cecil.Tests.Documentation+AssemblyApi: Documented API not found in the platform assembly. This probably indicates that the code to compute the doc name for a given member is incorrect.

we'll get:

> T:Foundation.SomeType: Documented API not found in the platform assembly. This probably indicates that the code to compute the doc name for a given member is incorrect.
2024-05-23 10:22:06 +02:00
Rolf Bjarne Kvinge a9b23141fd
[AudioUnit] Make P/Invokes in AudioUnit.cs have blittable signatures. (#20620)
Contributes towards #15684.
2024-05-23 08:07:43 +02:00
Rolf Bjarne Kvinge 6f61face84
[Security] Make remaining P/Invokes have blittable signatures. (#20618)
Contributes towards #15684.
2024-05-23 08:07:36 +02:00
Rolf Bjarne Kvinge f5bc8bf02f Canonicalize a bit. 2024-05-22 12:20:28 +02:00
Rolf Bjarne Kvinge f052e014d0 [net9.0] Merge main into net9.0. 2024-05-21 16:12:35 +02:00
Rolf Bjarne Kvinge a76d4946e0
[tests] Correctly run the VerifyRemoteConnection target. (#20616)
There's no target named `SayHello`, the correct name is `_SayHello` (where we
establish a connection to the remote mac).
2024-05-21 11:04:22 +02:00
Rolf Bjarne Kvinge 5a5df07276
[msbuild] Show a better error with invalid app bundles due to Resources subdirectory. Fixes #20135. (#20593)
iOS (and presumably tvOS) app bundles can't contain a subdirectory named "Resources".

Apple says:

> Note: An iOS app bundle cannot include a custom folder named “Resources.”

Ref: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1

Unfortunately Apple's toolchain won't show a helpful error message, the
eventual failure is codesign saying something like this:

    bin/Release/net8.0-ios/ios-arm64/SomeApp.app: code object is not signed at all
    In subcomponent: bin/Release/net8.0-ios/ios-arm64/SomeApp.app/System.Security.Cryptography.aotdata.arm64

Which is confusing, to say the least.

After debugging this myself a few times, and seeing customers running into the
same issue periodically, it's time to make the error more actionable.

I've added code to our Codesign task to detect the "Resources" subdirectory,
and show a better error message. There's also a way to disable the validation
(by setting `CodesignDisallowResourcesSubdirectoryInAppBundle=false`), just in
case we end up being overeager with the validation.

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

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-21 10:40:50 +02:00
Rolf Bjarne Kvinge c3cbab4439
[Security] Make P/Invokes in [Sec]Trust.cs have blittable signatures. (#20595)
Contributes towards #15684.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-05-21 09:53:59 +02:00
Rolf Bjarne Kvinge 6dc1f4c69b
[msbuild/dotnet] Automatically link with Swift's system libraries if a binding project has the IsSwift=true property. (#20546)
Add support for the LinkWithSwiftSystemLibraries metadata to specify whether a native library is a Swift library, in which case we'll automatically set the `LinkWithSwiftSystemLibraries` MSBuild property to `true`.

Also add a test.
2024-05-20 20:17:29 +02:00
Rolf Bjarne Kvinge d6ddfce412
[tests] Ignore trailing slashes in NativeReference items. Fixes #15430. (#20567)
A `*.framework/` native reference and a `*.framework` reference are the same
thing, so treat them the same. We accomplish this by removing any trailing
path separators (both windows style and non-windows-style for consistency)
before doing any processing.

Fixes https://github.com/xamarin/xamarin-macios/issues/15430.
2024-05-20 19:00:41 +02:00
Rolf Bjarne Kvinge 3a4fe453f7
[Security] Make P/Invokes have in SslContext.cs blittable signatures. (#20582)
Contributes towards #15684.
2024-05-09 19:15:56 +02:00
Rolf Bjarne Kvinge c5f93a2061
[bgen] Add support for marking API bindings as preview APIs using the Experimental attribute. (#20591) 2024-05-09 18:54:08 +02:00
Rolf Bjarne Kvinge 4ba38c7224
[tests] Fix misc ARM64 issues when running legacy Xamarin tests. (#20592)
We've recently started using more and more ARM64 bots, so these tests are
failing in those cases.

Fixes:

    MonoTouchFixtures.Security.SecureTransportTest
    	[FAIL] SslSupportedCiphers :   3224092716
      Expected: True
      But was:  False
    		  at MonoTouchFixtures.Security.SecureTransportTest.SslSupportedCiphers () [0x000de] in <f08bd76ea2204d929c96e3bd36ae955a>:0

    Xamarin.Mac.Tests.EveryFrameworkSmokeTests
    	[FAIL] ExpectedLibrariesAreLoaded : QTKitLibrary (/System/Library/Frameworks/QTKit.framework/QTKit) failed to load but this was not expected
        		  at Xamarin.Mac.Tests.EveryFrameworkSmokeTests.ExpectedLibrariesAreLoaded () [0x000e6] in <f08bd76ea2204d929c96e3bd36ae955a>:0
2024-05-09 17:27:52 +02:00
Rolf Bjarne Kvinge af80672ae6
[tests] Fix detecting exposed members (#20577)
The enum value MethodAttributes.IsFamily is 'internal' in C#, which is not exposed
outside an assembly, so don't count such members as exposed. On the other hand, MethodAttributes.IsAssembly
is 'protected' in C#, which *is* exposed, so these members are included.

Update tests accordingly.
2024-05-09 13:21:14 +02:00
Rolf Bjarne Kvinge 7dc68a8c8c
[net9.0] Revert workaround for a VSTest bug. (#20545)
The VSTest bug has been fixed for a while now.

Ref: https://github.com/microsoft/vstest/issues/4852
2024-05-08 15:47:57 +02:00
Rolf Bjarne Kvinge d1f577f684
[Security] Make P/Invokes in Certificate.cs have blittable signatures. (#20571)
Contributes towards #15684.
2024-05-08 09:37:45 +02:00
Rolf Bjarne Kvinge 6d137cbeb2
[AudioUnit] Remove unnecessary MarshalAs attributes from the AudioComponentDescription struct. (#20565)
This makes any P/Invokes that uses this struct have a blittable signature.

Contributes towards #15684.
2024-05-07 11:15:06 +02:00
Rolf Bjarne Kvinge b4c06d7d19
[bgen] Generate xml documentation for the extension class we generate for protocols. (#20564)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-05-07 09:36:57 +02:00
Rolf Bjarne Kvinge 5b62113f85 Merge remote-tracking branch 'origin/main' into bump-main-in-net9.0-2024-05-01 2024-05-06 14:27:42 +02:00
Rolf Bjarne Kvinge d15adeb752
[ObjCRuntime] Make P/Invokes have blittable signatures. (#20547)
Contributes towards #15684.
2024-05-06 09:06:32 +02:00
Rolf Bjarne Kvinge 9feebdcfac
[PrintCore] Make P/Invokes have blittable signatures. (#20542)
Contributes towards #15684.
2024-05-01 10:28:23 +02:00
Rolf Bjarne Kvinge 35ed169200 [net9.0] Merge main into net9.0. 2024-05-01 08:34:40 +02:00
Rolf Bjarne Kvinge 37c11cf0a1
[tools] Don't require a LinkWith attributes to find Objective-C classes in assemblies. (#20479)
Stop requiring a LinkWith attribute in an assembly in order to keep any Objective-C
types within. There are many ways to include a native library in a build nowadays,
and more and more often they don't need any LinkWith attributes to specify custom
linker behavior (in particular for frameworks, which can typically be included as-is).
The result of not searching such assemblies for Objective-C types would be that the
native linker would strip them away, and that would mean incorrect behavior at runtime.

However, this is a rather invasive change, especially for a minor release, so I'm
adding two things to make it better:

1. An opt-out MSBuild property: `RequireLinkWithAttributeForObjectiveCClassSearch`.
   Set to 'true' to opt-out (default is 'false').

2. Improve handling of native symbols with regards to the native linker.

    Add a new item group, ReferenceNativeSymbol, that contains native symbols
    we handle in some way - either to be ignored or we ask the native linker
    to keep it (by passing it as '-u ...' or in a symbol list file).

    There are two supported types of metadata:

    * SymbolType: either 'ObjectiveCClass', 'Function' or 'Field'. Used to
      compute the complete native name of a symbol (for instance, the native
      symbol for the Objective-C class "MyClass" is `_OBJC_CLASS_$_MyClass`,
      while for a function "MyFunction" it's just `_MyFunction`.
    * SymbolMode: either 'Ignore' or 'Default'. "Ignore" means to not pass the given
      symbol to the native linker, the default is to do so.

    SymbolType is required, while SymbolMode isn't.

    Example symbol to keep:

    ```xml
    <ItemGroup>
        <ReferenceNativeSymbol Include="MyClass" SymbolType="ObjectiveCClass" />
    </ItemGroup>
    ```

    Example symbol to ignore:

    ```xml
    <ItemGroup>
        <ReferenceNativeSymbol Include="MyClass" SymbolType="ObjectiveCClass" SymbolMode="Ignore" />
    </ItemGroup>
    ```

Finally use the latter solution to work around an issue that arouse with monotouch-test:
we reference an Objective-C class that doesn't exist in monotouch-test. This worked
because the referencing assembly didn't have a LinkWith attribute (and thus the reference
was ignored), but now that the reference isn't ignored anymore, we need to explicitly
ignore the Objective-C class.
2024-05-01 08:31:47 +02:00
Rolf Bjarne Kvinge 2b33d4d49b
[Foundation] Make P/Invokes have blittable signatures. (#20539)
Contributes towards #15684.
2024-05-01 08:31:10 +02:00
Rolf Bjarne Kvinge f9aa441e4a
[tests] Don't verify that property accessors have xml documentation. (#20538)
There's no way to add xml documentation to them.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-30 19:35:47 +02:00
Rolf Bjarne Kvinge 8bb2048f5f
[GameController] Make P/Invokes have blittable signatures. (#20528)
Contributes towards #15684.
2024-04-30 08:56:20 +02:00
Haritha Mohan ac22d6f3c6
[ADR] Bump maccore to get property docs fix (#20517)
Ref: https://github.com/xamarin/maccore/pull/2788

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-04-29 21:04:45 -07:00
Rolf Bjarne Kvinge 3a623d1227
[GLKit] Make the GLKVertexAttributeParametersFromModelIO P/Invoke have a blittable signature. (#20529)
This was complicated a bit because it uses a non-blittable struct we can't
change because it's public API. So introduce an internal temporary blittable
struct.

Contributes towards #15684.
2024-04-29 16:29:56 +02:00
Rolf Bjarne Kvinge 7292983fbf
[bgen] Generate xml documentation for generated default constructors. (#20525)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-29 12:05:12 +02:00
Rolf Bjarne Kvinge d617aa9aae
[OpenGL/OpenGLES] Make P/Invokes have blittable signatures. (#20512)
Contributes towards #15684.
2024-04-29 09:33:38 +02:00
Rolf Bjarne Kvinge 641475d328
[CoreVideo] Make P/Invokes in CVPixel related types have blittable signatures. (#20510)
Contributes towards #15684.
2024-04-29 09:29:54 +02:00
Rolf Bjarne Kvinge 1a12994513 [net9.0] Merge main into net9.0. 2024-04-26 15:08:47 +02:00
Rolf Bjarne Kvinge 771453d8a4
[bgen] Generate xml documentation for generated enums. (#20511)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-26 14:50:24 +02:00
Rolf Bjarne Kvinge 3744c76391
[bgen] Generate xml documentation for generated UIAppearance logic. (#20502)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-25 13:53:34 +02:00
Rolf Bjarne Kvinge 3ca9851df7
[CoreVideo] Make P/Invokes in CVImageBuffer and CVMetalTexture[Cache] have blittable signatures. (#20500)
Contributes towards #15684.
2024-04-25 10:59:44 +02:00
Rolf Bjarne Kvinge 2d278f672d
[bgen] Fix support for ErrorDomain enums in third-party bindings. (#20499)
The generator needs a library name for the generated `_domain` field.

Here's an example for the generated `ARErrorCodeExtensions` class ("ARKit" is
the library name):

```cs
[Field ("ARErrorDomain", "ARKit")]
static NSString? _domain;
```

In order to find the library name, the generator would look at the first enum
field with a `[Field]` attribute, and get the `LibraryName` property from that
`[Field]` attribute. Unfortunately error enums don't necessarily have `[Field]`
attributes on their enum fields. This works fine for our own bindings, because
the generator will fall back to the enum's namespace, but for third-party
bindings this would be the result:

> error BI1042: bgen: Missing '[Field (LibraryName=value)]' for ErrorDomainNS.EWithDomain. (e.g."__Internal")

Note that the error message is rather confusing: it's trying to report a
missing `LibraryName` property for a `[Field]` attribute, but there's no `[Field]`
attribute anywhere in the enum in question.

So fix this by:

* Adding the `LibraryName` property on the `[ErrorDomain]` attribute.
* Implement support for looking at this new property in the generator.
* Report a better error if it's not there.
2024-04-25 10:52:50 +02:00
Rolf Bjarne Kvinge 6c19986225
[SearchKit] Make P/Invokes have blittable signatures. (#20493)
Contributes towards #15684.
2024-04-24 13:19:08 +02:00
Rolf Bjarne Kvinge cb34348455
[CoreVideo] Make P/Invokes in CVBuffer and CVDisplayLink have blittable signatures. (#20494)
Contributes towards #15684.
2024-04-24 12:01:43 +02:00
Rolf Bjarne Kvinge 8b3ce01c2c
[bgen] Generate xml documentation for notifications. (#20492)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-24 09:36:14 +02:00
Rolf Bjarne Kvinge 0f23bcda3c
[Darwin] Make the 'kevent' P/Invoke have blittable signatures. (#20467)
Contributes towards #15684.
2024-04-23 18:13:13 +02:00
Rolf Bjarne Kvinge 50f8494961 [net9.0] Merge main into net9.0. 2024-04-23 15:35:11 +02:00
Rolf Bjarne Kvinge 6eabd3aece
[tests] Update known failures for cecil tests after a merge race. (#20480) 2024-04-23 14:40:24 +02:00
Rolf Bjarne Kvinge f2308d1ed0
[CoreWlan] Make P/Invokes have blittable signatures. (#20465)
Contributes towards #15684.
2024-04-22 18:54:03 +02:00
Rolf Bjarne Kvinge 216ddf7979
[CoreText] Make P/Invokes in CTFontManager have blittable signatures. (#20464)
Contributes towards #15684.
2024-04-22 18:53:52 +02:00
Rolf Bjarne Kvinge be241769fc
[GameplayKit] Remove the bindings for GKHybridStrategist. (#20468)
The GKHybridStrategist type doesn't exist in iOS. This was probably a type
initially introduced in a beta version, and then removed in a later beta
version, and then we didn't notice.
2024-04-22 07:26:10 +02:00
Rolf Bjarne Kvinge c42b4728ba
[tests] Don't verify that obsolete or hidden members have xml documentation. (#20471)
We have enough APIs to document to think about documenting APIs people
shouldn't be using.
2024-04-22 07:23:38 +02:00
Rolf Bjarne Kvinge fcabca0159
[docs] Stop using the term 'Xamarin'. (#20451)
Stop using the term 'Xamarin' in our error messages.

🙈 🙊 🙉

Note: this may not be complete, since we compute error messages in numerous
places, and those aren't fixed here (if there are any that still says
'Xamarin' in any way).

---------

Co-authored-by: Michael Cummings (MSFT) <mcumming@microsoft.com>
2024-04-18 08:41:07 +02:00
Rolf Bjarne Kvinge 595f1ecb7d
[CoreText] Make P/Invokes in CTRunDelegate have blittable signatures. (#20461)
Contributes towards #15684.
2024-04-18 08:33:29 +02:00
Rolf Bjarne Kvinge 2d619b14c2
[tests] Run the BundleStructure test on Windows in remote mode. (#20045) 2024-04-17 16:21:37 +02:00
Rolf Bjarne Kvinge 64ddb8781c
[CoreText] Make P/Invokes in CTFontDescriptor, CTFramesetter and CTParagraphStyle have blittable signatures. (#20426)
Contributes towards #15684.
2024-04-17 11:36:52 +02:00
Rolf Bjarne Kvinge 950304a898 [net9.0] Merge main into net9.0. 2024-04-16 18:01:21 +02:00
Rolf Bjarne Kvinge 53d21b14db
[xharness] Add launch.json/tasks.json for xharness. (#20428) 2024-04-16 17:36:15 +02:00
Rolf Bjarne Kvinge 92cab1c804
[bgen] Generate xml documentation for the generated constructors every NSObject subclass gets. (#20436)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-16 17:03:47 +02:00
Rolf Bjarne Kvinge 6fabe0b18a
[monotouch-test] Sprinkle UnconditionalSuppressMessage wherever needed to fix trimmer warnings. (#20429) 2024-04-16 17:03:36 +02:00
Rolf Bjarne Kvinge b09d92a988
[tests] Ignore trimmer warnings from NUnit. (#20430)
NUnit is not trimmer-safe, and produces a lot of trimmer warnings.

Ideally we'll fix NUnit or come up with an alternative (see #19911), but
that's a significant amount of work.

We also want to turn warnings into errors (to avoid adding more trimmer
warnings by accident).

So we disable trimmer warnings from NUnit. The method is somewhat complex,
because there's no built-in way to ignore warnings for a given assembly, but
both ILC and ILLink provides a way to collapse multiple warnings into a single
warning (with a specific code) on a per assembly basis, and we can levarage
this:

* We enable all warnings for all assemblies (by setting
  `TrimmerSingleWarn=false`).
* We enable the single-warning mode for NUnit only.
* We ask the trimmer to not warn about the specific warning code given for the
  single-warning produced.

The end result is that we won't get any trimmer warnings for NUnit.

An xharness fix was also needed to make xharness not get confused with
ItemGroups inside Targets when cloning project files.

Ref: https://github.com/xamarin/xamarin-macios/issues/19911
2024-04-16 17:03:07 +02:00
Rolf Bjarne Kvinge 1ff3c2bddd
[devops] Terminate any existing builders and brokers when preparing Macs for remote testing. (#20448)
Also collect more logs to help diagnose any transient failures.
2024-04-16 16:26:01 +02:00
Rolf Bjarne Kvinge d6d0e8abd0
[net9.0] Merge main into net9.0. (#20435) 2024-04-15 09:24:38 +02:00
dotnet-maestro[bot] ea3f78c0cb
[net9.0] Update dependencies from dotnet/installer (#20343)
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 9.0.0-preview.3.24129.2 to 9.0.0-preview.4.24209.8 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 9.0.0-preview.3.24151.1 to 9.0.0-preview.4.24208.6 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.3.24129.2 to 9.0.0-preview.4.24209.8 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.0-preview.3.24126.1 to 9.0.0-preview.4.24204.9 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.3.24129.2 to 9.0.0-preview.4.24209.8 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.24120.1 to 0.11.4-alpha.24168.1 (parent: Microsoft.NETCore.App.Ref)

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

- **Subscription**: 3727984b-7a79-4ba3-37dd-08dbe6bddf31
- **Build**: 20240411.4
- **Date Produced**: April 11, 2024 3:25:11 PM UTC
- **Commit**: c61f05c5628fdba80433184eb00353a908dbdccc
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 9.0.100-preview.3.24153.2 to 9.0.100-preview.4.24211.4][106]
  - **Microsoft.NET.ILLink.Tasks**: [from 9.0.0-preview.3.24129.2 to 9.0.0-preview.4.24209.8][107]
  - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0-preview.3.24151.1 to 9.0.0-preview.4.24208.6][108]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.3.24129.2 to 9.0.0-preview.4.24209.8][107]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: [from 9.0.0-preview.3.24126.1 to 9.0.0-preview.4.24204.9][109]
  - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.3.24129.2 to 9.0.0-preview.4.24209.8][107]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.24120.1 to 0.11.4-alpha.24168.1][110]

[106]: 893b762b6e...c61f05c562
[107]: 5e603d595e...6b9381be09
[108]: 3e5155276f...79ef5e329b
[109]: 0f3e462442...9ad7c262f1
[110]: 0d0bc8e0f4...9c8ea966df

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Alex Soto <alex@soto.dev>
2024-04-12 18:14:21 +02:00
Rolf Bjarne Kvinge 0ff184cd06
[UIKit] Remove UITextAttributes.Dictionary. Fixes #20409. (#20410)
The UITextAttributes.Dictionary property is supposed to work like the
UIStringAttributes.Dictionary property, but there's one big difference: the
UITextAttributes version can (and calling code does) be disposed, while the
UIStringAttributes version can't.

This is because the UITextAttributes version creates a new dictionary every
time, while the UIStringAttributes version doesn't.

Since properties shouldn't really do much, it makes sense to remove the
UITextAttributes version, and instead rely on the
UITextAttributes.ToDictionary method, where the difference in behavior is more
obvious.

This required a few changes in calling code, which used either UITextAttributes
or UIStringAttributes using conditional compilation.

Fixes https://github.com/xamarin/xamarin-macios/issues/20409.
2024-04-12 16:53:25 +02:00
Rolf Bjarne Kvinge e200c21269
[bgen] Generate xml documentation for the generated ClassHandle property. (#20425)
This was mostly copied from the existing API documentation.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-12 10:15:05 +02:00
Rolf Bjarne Kvinge 26ad165cc9 [net9.0] Merge main into net9.0. 2024-04-12 09:50:25 +02:00
Rolf Bjarne Kvinge e5a63b33e6
[tests] Ignore the MessageHandlerTest.GHIssue16339 test if we're in CI and have a bad network. (#20416)
Fixes this test failure:

    MonoTests.System.Net.Http.MessageHandlerTest.GHIssue16339
    	[FAIL] GHIssue16339() :   ReasonPhrase #1
      Expected string length 2 but was 11. Strings differ at index 0.
      Expected: "OK"
      But was:  "Bad Gateway"
2024-04-11 17:16:15 +02:00
Rolf Bjarne Kvinge fa9805dbac
[CoreGraphics] Bind CGEventSetIntegerValueField and CGEventSetDoubleValueField. Fixes #12650. (#20424)
Also expose both getter and setter methods using the enum itself, so we don't
have to make getter and setter properties for each of the enum fields.

This required making CGEventField a public enum, so do that.

And finally document all the new APIs, and some of the old ones.

Fixes https://github.com/xamarin/xamarin-macios/issues/12650.
2024-04-11 07:19:14 +02:00
Rolf Bjarne Kvinge b71582ea31
[tests] Don't verify that delegate members have xml documentation. (#20419)
There's no way to add xml documentation to them.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-10 19:02:20 +02:00
Rolf Bjarne Kvinge 3f6df4d739
[CoreText] Make P/Invokes in CTFont have blittable signatures. (#20418)
Contributes towards #15684.
2024-04-10 19:01:18 +02:00
Rolf Bjarne Kvinge 2874845b85
[tests] Don't verify that the 'value__' enum fields have xml documentation. (#20412)
There's no way to add xml documentation to them.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/20270.
2024-04-10 11:08:43 +02:00