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

918 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a123e460f5
[watchOS] Remove the build logic for watchOS. (#21440) 2024-10-16 12:30:13 +02:00
Rolf Bjarne Kvinge 953a2b4564
[src] Remove legacy build logic. (#21353) 2024-10-10 11:26:25 +02:00
Rolf Bjarne Kvinge 00ec47ae39 Merge remote-tracking branch 'origin/main' into dev/rolf/bump-main-in-xcode16-2024-09-13 2024-09-17 06:57:03 +02:00
Rolf Bjarne Kvinge cfcfd42947
[tools] Fix typo 'occured' -> 'occurred'. (#21208) 2024-09-16 10:16:27 +02:00
Rolf Bjarne Kvinge a52f186066 [xcode16] Merge main into xcode16. 2024-09-13 15:53:38 +02:00
Rolf Bjarne Kvinge 3abcc3c9dd
[tools] Improve error message when deployment target is too old. (#21211)
Ref: https://github.com/xamarin/xamarin-macios/issues/21204
2024-09-12 10:47:15 +02:00
Rolf Bjarne Kvinge cf8d2ad695
[BrowserEngineKit] Implement this new framework. (#21168)
Note: this framework was introduced in Xcode 15.4.

Up-to-date until RC.
2024-09-11 20:34:52 +02:00
Rolf Bjarne Kvinge 73683f8124 [xcode16] Merge main into xcode16. 2024-09-02 19:51:07 +02:00
Rolf Bjarne Kvinge ff707c145e
[dotnet-linker] Trim away the static constructor for protocol interfaces if we're registering protocols in the static registrar. (#21012)
When we implemented support for using default interface members for binding protocols, we also unintentionally introduced a size regression. This happened because we now tell the linker to keep all methods in a protocol interface, thus all the corresponding types end up marked as well, etc.

This had an additional side effect: depending on the types that weren't linked away anymore, the App Store could flag an app, saying that additional entitlements is needed. This is what's happening in #21002: the App Store detects that the app references the `application:didRegisterForRemoteNotificationsWithDeviceToken:` selector [1] (from the method `RegisteredForRemoteNotifications` on `IUIApplicationDelegate`) and tells the developer they probably need the push notification entitlement.

The good news is that we don't need these protocol interface methods at runtime if the optimization to register protocols with the static registrar is enabled (which it is by default).

In this PR I teach the optimizer to remove the DynamicDependency attributes keeping these protocol interface methods from being trimmed out.

## Size improvements

* monotouch-test build for Release/ios-arm64 shrinks by [2.9mb (-2.6%)](https://gist.github.com/rolfbjarne/5e8ca6ea6854dc4a46f8e838dff11e6b)
* A very simple app (tests/dotnet/MySimpleApp) shrinks by [176kb (-0.3%)](https://gist.github.com/rolfbjarne/f0e062900528eb499fd96d124d18376f)

[1]: This is somewhat speculative, but it's probably not far from what the App Store actually does.

Fixes #21002.
2024-09-02 15:02:10 +02:00
Alex Soto 5b72d86f02 Merge remote-tracking branch 'xamarin/main' into xcode16 2024-07-16 22:58:16 -04: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 b7d3e54f26 [mtouch] Don't pass -fembed-bitcode[-marker] to the compiler on later Xcode versions. 2024-07-09 10:22:36 +02:00
Rolf Bjarne Kvinge c2845a5226 [tools] Don't register any AssetsLibrary classes, the framework is deprecated and will be removed. 2024-07-09 10:22:35 +02:00
Rolf Bjarne Kvinge 76cef6cc7d
[Blocks] Remove a block callback validation that's apparently too eager. (#20625)
The validation verifies that the function pointer for a block callback is the
same the return value from the method's
MethodInfo.MethodHandle.GetFunctionPointer() method.

In actual code, it's equivalent to validating that the following always prints "Equal: true":

```cs
[UnmanagedCallersOnly]
public static void Invoke () {}

static void Test ()
{
    delegate* unmanaged<void> fptr1 = &Invoke;
    IntPtr fptr2 = GetType ().GetMethod ("Invoke").MethodHandle.GetFunctionPointer ();
    Console.WriteLine ($"fptr1: 0x{((IntPtr) fptr1).ToString ("x")}");
    Console.WriteLine ($"fptr2: 0x{fptr2.ToString ("x")}");
    Console.WriteLine ($"Equal: ((IntPtr) fptr1) == fptr2}"); // prints "Equal: true" for me
}
```

However, this isn't documented, and some feedback indicates it's certainly not
a valid assumption for CoreCLR:

https://discord.com/channels/732297728826277939/732582981163548703/1242473425759633488

And there's also a customer running into this validation, apparently without cause:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2054534

So just remove it.
2024-05-23 10:22:54 +02:00
Rolf Bjarne Kvinge 7e8e887d5d
[runtime] Throw exception for condition we don't handle in the dynamic registrar. (#20568)
Throw an exception for a condition we don't handle in the dynamic registrar:
calling a base Objective-C constructor (init method) with arguments. Our
current implementation to call the base Objective-C constructor doesn't handle
any arguments, so if the method actually takes any arguments, those will just
be random memory. In other words: a consistent exception is better than a
random invalid memory access.
2024-05-20 18:57:42 +02:00
Rolf Bjarne Kvinge 25357697e3
[dotnet] Throw an exception if the developer tries to use server garbage collection. Fixes #16853. (#20569)
Our runtime doesn't support server garbage collection:

https://github.com/xamarin/xamarin-macios/blob/main/runtime/coreclr-bridge.m#L203-L210

Fixes https://github.com/xamarin/xamarin-macios/issues/16853.
2024-05-08 09:38:19 +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 76482387c8
[SafetyKit] Added bindings for SafetyKit. (#20263)
This also required a minor generator fix to fix generation of async methods
with a nullable NSError.

---------

Co-authored-by: Israel Soto <issoto@microsoft.com>
2024-03-15 08:15:01 +01:00
Rolf Bjarne Kvinge 2348736a2b
[DeviceDiscoveryExtension] Added bindings for DeviceDiscoveryExtension. (#20272)
---------

Co-authored-by: Israel Soto <issoto@microsoft.com>
2024-03-14 07:58:45 +01:00
Rolf Bjarne Kvinge 1220fa030c
[mtouch] Remove packages.config, doesn't seem to be used anymore. (#19742)
The packages in packages.config for mtouch don't seem be used anymore (the
localization process for mtouch doesn't use the xliff localization workflow
anymore), so just remove the file.
2024-01-08 07:43:00 +01:00
Rolf Bjarne Kvinge 1ddc0b4b74
Get Mono.Cecil from NuGet everywhere. (#19535)
Also:

* Store the version in Directory.Build.props, which makes it much easier to update.
* Bump all versions to latest (0.11.5).
2023-12-04 20:15:03 +01:00
Rolf Bjarne Kvinge f9ba5467e8
Use Mono.Options NuGet instead of building from source in a few projects. (#19438)
This reduces a source dependency on the legacy Mono package.
2023-11-14 10:32:23 +01:00
VS MobileTools Engineering Service 2 b93fba0b87
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 8543391 (#19221)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-10-17 11:08:11 -05:00
Rolf Bjarne Kvinge b39a0f3f2a Merge remote-tracking branch 'origin/net8.0' into merge-net8.0-into-main 2023-10-11 16:40:24 +02:00
VS MobileTools Engineering Service 2 bae7760087
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 8441644 (#19094)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-09-26 11:19:42 -05:00
Haritha Mohan 4f1cbbccaa
[SensitiveContentAnalysis] Add support for Xcode 15 (#19020)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Alex Soto <alex@soto.dev>
2023-09-15 09:49:05 -07:00
Rolf Bjarne Kvinge be6c348cfd [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-09-14 07:25:58 +02:00
Rolf Bjarne Kvinge 7b3779fb71
[xcode15] Add back armv7k support for watchOS. Fixes #18902. (#18947)
Only i386 is gone from watchOS 4.0, not armv7k.

Fixes https://github.com/xamarin/xamarin-macios/issues/18902.
2023-09-11 19:00:40 +02:00
Rolf Bjarne Kvinge 9d8962c06c [net8.0] Merge main into net8.0. 2023-09-11 10:31:07 +02:00
Rolf Bjarne Kvinge 673dd5782b [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-09-08 10:31:44 +02:00
VS MobileTools Engineering Service 2 79da6c2c46
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 8349044 (#18917)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-09-06 13:01:07 -05:00
Rolf Bjarne Kvinge ef408d24a9 [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-08-29 11:53:41 +02:00
Rolf Bjarne Kvinge 78b649c4e1 [net8.0] Merge main into net8.0. 2023-08-29 11:24:40 +02:00
Rolf Bjarne Kvinge 45225dc88d
[dotnet] Parameterize the pack names. (#18732)
We're going to change the pack names to support multi-targeting, so ahead
of the pack name change I'm changing the existing logic to use a variable
for the pack name in most places (this will make the rename much easier and
simpler).

These changes should have no effect by themselves.
2023-08-29 10:06:46 +02:00
Rolf Bjarne Kvinge 339582383b [net8.0] Merge main into net8.0. 2023-08-25 08:26:06 +02:00
Rolf Bjarne Kvinge 2e7846d190
[registrar] Skip registering types removed in Xcode 15. (#18812)
Apple completely removed the NewsstandKit framework and the
PKDisbursementAuthorizationController[Delegate] types in Xode 15, so
let's not generate any corresponding code in the static registrar.

This effectively adds basic support for using Xcode 15 with .NET 7 (take
2).
2023-08-25 07:42:34 +02:00
Šimon Rozsíval 4ddee61b66
[NativeAOT] Add support for conditional [Preserve] attributes (#18803)
This is a follow-up to #18666

The idea is to transform `[Preserve(Conditional = true)]` into
`[DynamicDependency(signature, type)]` on the static constructor of the
given type:

```c#
class MyClass {
    [Preserve (Conditional = true)]
    public void MyMethod () { }

    // transformed into ...

    [DynamicDependency ("MyMethod", typeof (MyClass))]
    static MyClass() { /* either the existing cctor or a new empty cctor */ }

    public void MyMethod () { }
}
```
2023-08-25 07:41:16 +02:00
Rolf Bjarne Kvinge 7d5e1a4e7e [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-08-23 17:35:17 +02:00
Rolf Bjarne Kvinge 2091e09592
[net8.0] Merge main into net8.0 (#18770) 2023-08-22 15:19:06 +02:00
Rolf Bjarne Kvinge 19b2b3744f
[NativeAOT] Add support for [Preserve] attributes (#18666)
Add partial support for the `[Preserve]` attribute for NativeAOT. This
is done by injecting an equivalent `[DynamicDependency]` attribute. The
partial support comes from the fact that there's no way to map a
conditional preserve attribute (`[Preserve (Conditional = true)]`) to a
`[DynamicDependency]` attribute, so we report a warning instead.

For non-conditional `[Preserve]` attributes, we'll now add a
`[DynamicDependency]` attribute to the assembly's module constructor for
the type/member in question, effectively rooting it.

This makes it possible to fully link all our test suites when NativeAOT
(otherwise NativeAOT would just link out all the tests, leaving the test
suites empty - and unfortunately green, so this was a rather accidental
discovery).
2023-08-18 16:49:47 +02:00
Rolf Bjarne Kvinge c8ae3dc072 [net8.0] Merge main into net8.0. 2023-08-16 11:19:56 +02:00
Rolf Bjarne Kvinge 38e4e08d35
[tools] Improve logging/reporting when running into problems with binding projects / assemblies. (#18683) 2023-08-16 10:31:38 +02:00
Manuel de la Pena d5d14f6cd8
[Symbols] Add support for the new Xcode 15 Symbols framework. (#18642)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-08-15 11:53:48 -04:00
Šimon Rozsíval 7f67aa0bae
[registrar] Create instances of NSObjects and INativeObjects without using reflection in the managed static registrar (#18519)
This PR adds lookup tables and factory methods for INativeObjects and
NSObjects. These generated methods allow us to create instances of these
objects without needing reflection.

Closes #18358.
2023-08-15 08:30:46 +02:00
Manuel de la Pena d5c6d22905 [Mtouch] Ignore warning about duplicated libs. 2023-08-04 11:47:29 -04:00
Rolf Bjarne Kvinge e082cf136f [NewsstandKit] Remove this framework.
The NewsstandKit framework has been completely removed, both from the headers and
Apple's documentation, so assume they want it gone and remove it ourselves as well.
2023-08-04 11:47:27 -04:00
Rolf Bjarne Kvinge 3beafbb9bb [build] Add support for skipping 32-bit watchOS device architectures by bumping the min watchOS version. 2023-08-04 11:47:27 -04:00
Rolf Bjarne Kvinge 34667ebce6 [net8.0] Merge main into net8.0. 2023-08-01 17:10:44 +02:00
VS MobileTools Engineering Service 2 8d875fd3e9 Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 8130882 2023-07-23 05:05:23 -07:00
Rolf Bjarne Kvinge 15b7907eab [net8.0] Merge main into net8.0. 2023-06-23 17:03:50 +02:00