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

10298 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge d778cc28c8
[runtime/dotnet] Call coreclr_initialize/monovm_initialize at startup. (#10909)
We need to call coreclr_initialize/monovm_initialize at startup, so do that.
This is a partial implementation, in that we're not setting all the properties
that we should, and also the PINVOKE_OVERRIDE callback is not doing everything
it should either yet.

Ref: #10504.
2021-03-22 08:04:56 +01:00
Manuel de la Pena 350c8493ce
[CI][VSTS] Add support to run the tests on 10.12. (#10684) 2021-03-21 20:11:17 -04:00
Manuel de la Pena fbf1d2871e
Bump xharness to a version without an async change. (#10902) 2021-03-21 19:55:29 -04:00
Mauro Agnoletti c9d1760cfc Fixing CoreiOSSdkDirectory definition for legacy project system
The way that CoreiOSSdkDirectory was definded ($(MSBuildThisFileDirectory.Replace('...', '...'))) was returning an encoded string value that caused issues in legacy project systems. The reason of the issues is that the CoreiOSSdkDirectory value for legacy project systems is `Program Files (x86)`, and the "Replace'" function was encoding the '(' and ')' causing the "UsingTask" for fail because the Assembly File path was wrong (because it contains those encoding values).

The fix consist of applying the "Replace" function only when the path of the targets belongs to a .net SDK path, in which case it won't fail because it's under "Program Files".

We need to discuss with the MSBuild team to show this issue and know if it's a bug or how we can avoid the failure
2021-03-18 18:20:24 -03:00
Mauro Agnoletti dcdfe8ebfa Fixed iOS Binding projects build in Windows
iOS Binding projects were not building remotely since 16.9. This commit fixes that and allows to start building remotely.

Xamarin.iOS.ObjCBinding.CSharp.After.props is imported too early and because it was also importing the Messaging targets, some things like RebuildDependsOn and BuildDependsOn were being overridden by other targets, resulting on not hooking up on the remote execution.
2021-03-18 18:20:24 -03:00
Rolf Bjarne Kvinge 1da2d452dd
[msbuild/dotnet] Add support for parsing --setenv from bundler arguments. (#10896)
Add support for parsing --setenv from bundler arguments and passing them to
dotnet-linker so that the environment variables can be baked into the app at
launch (like they would be for mtouch/mmp).
2021-03-18 15:15:02 +01:00
Rolf Bjarne Kvinge 307f97e529
[dotnet] Add a IsCoreCLR initialization flag. (#10900)
So that we can detect in managed code whether we're running with CoreCLR or
MonoVM.
2021-03-18 14:29:06 +01:00
Sebastien Pouliot 60da845437
[xtro] Fix 'make gen-all' for Catalyst (when xtro has not run yet) (#10907) 2021-03-18 09:14:17 -04:00
Rolf Bjarne Kvinge af5651accf
[runtime] Move MonoVM-specific initialization to MonoVM-specific code. (#10899)
* [runtime] Download the CoreCLR embedding header file

* [runtime] Create VM-specific code and header files and include them in the build

* [runtime] Move MonoVM-specific initialization to MonoVM-specific code.
2021-03-18 07:23:39 +01:00
mathieubourgeois a921ee2fb1
Xamarin.Mac native Apple Silicon targetting support (#10115)
* Add support for Xamarin.Mac arm64

* Add compile product definition task

Xamarin.Mac can be provided with a ProductDefinition file for the generated pkg. Normally, providing a product definition was optional. However, with Apple Silicon, we have an extra issue : `productbuild` needs to know what architectures your package target. If not provided with them, it will guess to the best of its abilities. However, on Catalina and lower, the guess is x86_64, even if you have an arm64 slice. To fix this, we add a new task to compile the product definition and use this file to create the pkg. If you provide your own Product Definition, we can check and warn if the architectures don't match what we expect. If the file doesn't exist or there is no architecture, we set it ourselves based on our target architectures.

* Don't reference dynamic objC_send on arm64

When building in debug, we currently try to link dynamic objC_send symbols when targeting a 64-bit architecture. However, this is actually only defined on Intel architectures, not on arm64, so we end up failing because we're referring symbols that don't exist. Rework the `GetRequiredSymbols` to take an abi, and tag those symbols to only be valid on i386/x86_64, so they don't get referred at all when building on arm64, but still get referred in x86_64.

* Fix improper delete/move with already existing directories

* Fix stret requirement for Xamarin.Mac in arm64.

The generator supposes that we're running in x64 mode, refactor to take into account the possibility of running in arm64.

* Implement OS version generation in Product.plist, based on MinimumSystemVersion of the app

* Re-generalize some mmp registrar rules

`Microsoft.macOS.registrar` was missed by the current rule set

* Fix mmp tests

* Set E7072 as not translated

Tests were failing otherwise

* Rename Xamarin.Mac lib/x86_64 folder to 64bits (currently all targeted archs are the same)

* Fix style issues

* Fix `ToLower` usage for invariant usage

* Fix xtro-sharpie test
2021-03-17 21:48:02 -04:00
Rolf Bjarne Kvinge 3f018eedb6
[tests] Don't forcefully exit macOS tests. (#10844)
* [tests] Don't forcefully exit macOS tests.

Instead give the process a chance to exist (3 seconds), before we take drastic
measures.

* Bump Touch.Unit.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f19eb45 [TouchRunner] Try to make MacRunner exit nicely. (#100)

Diff: a33e0c3f2e..f19eb45cb6

* It looks like mono from 2020-02 doesn't want to exit no matter what, so limit this to .NET.
2021-03-17 18:46:29 +01:00
Manuel de la Pena cb18cb881f
Revert "[Xharness] Bump to the new nuget in the xharness main branch. (#10761)" (#10898)
This reverts commit 7db547617a.
2021-03-17 11:35:14 -04:00
Connor Adsit 8785b954b1
[CI] Remove login keychain references (#10778)
* Remove references to the login keychaintools/devops/automation/templates/build/build.yml

* remove login-keychain envvar, add credential envvars

* use special branch of maccore

* Fix variable references

* Add keyringPass back in

* and here, too

* Change maccore to HEAD of current needed version + keychain fixes

* Bump back to maccore/main.

New commits in xamarin/maccore:

* xamarin/maccore@e81fac5451 [CI] remove login keychain password and xqa cert passwords (#2404)
* xamarin/maccore@548fa45432 [mlaunch] Disable building mlaunch when not including the legacy Xamarin build. (#2403)

Removed commits from xamarin/maccore:

* xamarin/maccore@ef5502ee51 remove login keychain password and xqa cert passwords

Diff: ef5502ee51..e81fac5451

* revert pipeline branch of maccore to main

* [maccore] Bump maccore

New commits in xamarin/maccore:

* xamarin/maccore@b9aaee7254 Remove unneeded block intended to add creds to login.keychain
* xamarin/maccore@0ac61f1fba [dotnet] Changes the msbuild.zip to include Windows files (#2408)
* xamarin/maccore@e81fac5451 [CI] remove login keychain password and xqa cert passwords (#2404)

Diff: 548fa45432..b9aaee7254

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2021-03-17 08:16:58 +01:00
Rolf Bjarne Kvinge 79cd5d203f
[NSObject] Rework the SuperHandle property to not return a pointer into managed memory. (#10888)
Previously, the SuperHandle property returned a pointer into the middle of the
NSObject instance. This is not safe, because we can't make pin the NSObject
instance past the return of the SuperHandle property getter.

So rework the logic, to allocate a chunk of native memory that SuperHandle can
return, and use that instead. This means a little bit of book-keeping to
create and destroy this native memory.

Unfortunately it will also increase the memory usage for each NSObject
instance, but I don't see a way around that, while still fixing the problem
with SuperHandle, given that we can't change the signature of SuperHandle.
2021-03-17 08:01:51 +01:00
Rolf Bjarne Kvinge 46c999f0ad
[runtime] Resolve symlinks using API provided by NSString instead of Mono. (#10889)
Mono's way doesn't work with CoreCLR anyway.
2021-03-17 07:54:52 +01:00
Rolf Bjarne Kvinge 913d6e6f0e
[xharness] Fix execution results for mac tests. (#10852)
The test run can fail even if all the tests pass: in case the process crashes
or deadlocks at exit for instance. Don't overwrite such failures with the unit
test results.
2021-03-17 07:38:16 +01:00
Manuel de la Pena 7db547617a
[Xharness] Bump to the new nuget in the xharness main branch. (#10761) 2021-03-16 18:10:30 -04:00
TJ Lambert 5006fb8fce
[Localization] Add Step to Generate LocProject.json (#10876)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-03-16 17:34:19 -04:00
Sebastien Pouliot 584b45a25e
[catalyst] Remove extraneous API detected by xtro (#10872)
This fixes almost [1] all `extra` API detected from the extrospection
(header-based) tests for MacCatalyst. This is needed to complete the
introspection fixes (without having _too large PR).

[1] except `!extra-null-allowed!` since those are still in progress for
all platforms
2021-03-16 16:04:01 -04:00
Rolf Bjarne Kvinge 13e458ebff
[msbuild] Fix logic to copy windows files (#10873)
By creating a directory before trying to copy files into it.
2021-03-16 18:48:44 +01:00
Rolf Bjarne Kvinge 32e4d05195
[dotnet] Add support for specifying the VM with the _XamarinRuntime property. (#10881)
Use a private property (prefixed with underscore) for now, until we can decide
on a better/general name.

Also add a variation to xharness to build monotouch-test with CoreCLR
(building works fine, but it crashes at startup, which is expected at this
point).
2021-03-16 18:32:04 +01:00
Rolf Bjarne Kvinge ddf1645748
[runtime] Remove unnecessary cast (#10875) 2021-03-16 15:23:58 +01:00
Rolf Bjarne Kvinge 7ac3c658e0
[tests] Preserve all test fixtures. (#10870)
* [tests] Preserve all test fixtures.

This fixes the wildly diffetent number of tests when running xammac tests with and without linking.

Without linking:

> Tests run: 2446 Passed: 2321 Inconclusive: 9 Failed: 0 Ignored: 125

vs with linking:

> Tests run: 1885 Passed: 1802 Inconclusive: 4 Failed: 0 Ignored: 83

Now we run the same tests either with or without linking.

One test was updated to not fail when linking is enabled.

Also add a test to ensure all future test fixtures are preserved.

* Remove whitespace noise.
2021-03-16 15:15:30 +01:00
Rolf Bjarne Kvinge 3087174202
[runtime] Use xamarin_gchandle_free instead of mono_gchandle_free. (#10874)
Our own functions support pointer-sized GCHandles, so this is one less place
to fix for CoreCLR.
2021-03-16 14:00:35 +01:00
Sebastien Pouliot 079b683a02
[coremidi] Add missing API for macOS (10.15+) (#10878)
The API were already available (iOS) and this helps fixing tests for
MacCatalyst (as it's based on our iOS API but expose the same issue
as macOS wrt extra ctor/init).
2021-03-16 08:35:14 -04:00
Rolf Bjarne Kvinge bc340502fe
[runtime] Move parts of NSObject creation from native to managed. (#10869)
Move the creation of an uninitialized NSObject from native to managed, which:

* Removes the need for the mono_object_new Embedding API.
* Removes one location where we write to managed memory from native code (to
  write the handle + flags in the uninitialized NSObject).
* Makes things easier for CoreCLR.
2021-03-16 07:40:19 +01:00
Juan Marcelo Tondato d13caa504f
[msbuild] make a way to keep LaunchProfile capability (#10868)
`$(_KeepLaunchProfiles)` will be defined on single projects to use `LaunchProfiles` capability required on VisualStudio, see:

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1291515

When a single-project is loaded on VisualStudio, to enable the switch between target frameworks the LaunchProfiles capability need to be enabled.

By default, it is enabled but this capability is removed by our SDKs because the HEAD projects (Android and iOS) does not use this IDE feature to display devices on the start button.

`$(_KeepLaunchProfiles)` property avoids that removal in order to have LaunchProfiles enabled on VisualStudio.

MAUI targets adds `$(_KeepLaunchProfiles)` with the value true to enable it for single-project.
2021-03-15 16:35:50 -05:00
TJ Lambert 2a7423054f
continuing on error (#10879) 2021-03-15 16:19:56 -05:00
Manuel de la Pena facf8ac2c7
[CI] Fix configuration step. Keys are unique in yaml. (#10877) 2021-03-15 15:58:23 -04:00
TJ Lambert 8ea2dcac0c
[Localization] Turning on OneLocBuild (#10843) 2021-03-15 13:50:21 -05:00
Rolf Bjarne Kvinge 795e48c7e5
[src] Skip building watchOS assemblies for .NET if .NET/watchOS is not enabled. (#10865) 2021-03-15 15:24:32 +01:00
Rolf Bjarne Kvinge a5f970069a
[runtime] Make xamarin_release_managed_ref a normal P/Invoke. (#10864)
* We already switch to GC Safe mode anyway, so there were no benefits from
  entering native code in a GC unsafe mode. In fact we used to switch to GC
  Safe mode for every statement in xamarin_release_managed_ref, and now we can
  execute everything in GC Safe mode without switching back and forth. This
  also means there should be no difference in behavior.

* All parameters are blittable, so there's no extra marshalling cost.

* Easier for CoreCLR.
2021-03-15 08:02:59 +01:00
Sebastien Pouliot 00a69e1654
[dotnet] Update `Min*` constants and fix builds for tests (#10835)
We're bumping the minimum OS versions for all supported platforms
https://github.com/dotnet/core/blob/master/release-notes/6.0/6.0-supported-os.md

Intro's `Introduced` test is ignored as it require (a lot of) changes. This
will be fixed in separate PRs and gradually re-enabled.

iOS
```
[FAIL] Introduced : 7573 API with unneeded or incorrect version information
```

tvOS
```
[FAIL] Introduced : 299 API with unneeded or incorrect version information
```

Tracking progress in https://github.com/xamarin/xamarin-macios/issues/10834
2021-03-13 10:38:46 -05:00
Rolf Bjarne Kvinge 52aa993bba
[runtime] Move setting the NSObject flags in xamarin_create_managed_ref from native to managed code. (#10858)
* Less poking into managed memory from native code.
* Makes things easier for CoreCLR support.
2021-03-12 23:19:07 +01:00
Rolf Bjarne Kvinge c4db1697e3
[configure] Use bash instead of sh and fix a shellcheck warning about unquoted variables. (#10856) 2021-03-12 23:14:16 +01:00
Rolf Bjarne Kvinge 1003c987f2
[runtime] Move the call to Runtime.UnregisterNSObject from native to managed code. (#10857)
* Avoids a native->managed transition
* Avoids creating/destroying a GCHandle.
* Makes it possible to remove an argument from the call to
  xamarin_release_managed_ref.
* Makes things easier for CoreCLR.
2021-03-12 23:14:10 +01:00
Rolf Bjarne Kvinge 4e0978e46c
[runtime] Link the CoreCLR version of libxamarin with CoreCLR instead of Mono. (#10853)
* [runtime] Link the coreclr version of libxamarin with CoreCLR instead of Mono.

The diff might look a bit weird, because there's no changes specific to CoreCLR -
the difference is that we're in fact removing a special-case to link with Mono: we
used the DOTNET_$(rid)_LIBDIR variable to specify the directory where to find libcoreclr,
we now use DOTNET_CORECLR_$(rid)_LIBDIR when building for CoreCLR, but that's handled
by the default case, so no need to add any special casing. We still override DOTNET_osx-<arch>_LIBDIR
for MonoVM (no change needed for that).

* [runtime] Generate stubs for the mono embedding API when building for CoreCLR.

This makes libxamarin link successfully when building for CoreCLR.
2021-03-12 18:40:48 +01:00
Alex Soto 4bde41c508
[mono] Bump mono to get M1 binaries (#10836)
* [mono] Bump mono to get M1 binaries

New commits in mono/mono:

* mono/mono@be9218f4d1 Don't include mono-dtrace.h when generating offsets
* mono/mono@14ac6d4f0b [2020-02] Backport Apple silicon support (#20909)
* mono/mono@7dc02abf99 Build Mac/MacCat SDK archives on Xcode 12.4
* mono/mono@fdf57e7744 Disable DebuggerTests.Crash since it fails on Linux i386 in CI
* mono/mono@8c552e98bd Bump bockbuild to include https://github.com/mono/bockbuild/pull/168
* mono/mono@b1e2a54c6a Remove signing from Jenkins MSI pipeline
* mono/mono@a8f265550b Remove signing from Jenkins PKG/MSI pipelines
* mono/mono@c621c35ffa Fix early return in Process.Start (#20833)
* mono/mono@715757301f [2020-02][System.Drawing] Work around libgdiplus Metafile dispose ordering (#20828)
* mono/mono@305b6cff96 Revert some unrelated bumps
* mono/mono@c66141a8c7 [AOT] Make native linker name configurable (#20816)
* mono/mono@64368a00d8 Bump msbuild
* mono/mono@364c87b1a7 Disable acceptance-tests/roslyn.mk
* mono/mono@9b139294c0 Bump msbuild to fix build break
* mono/mono@b9c050faf2 [aot] Quote the -Wl,install_name argument to clang. (#20660)

Diff: 5e9cb6d1c1..be9218f4d1

* [Make.Config] Use actual mono binaries

Since mac binaries are built using Xcode 12.4 and iOS using
Xcode 11.3 we are not accounting for this difference and we
are building mono from source. Fix this scenario.

* [tests] mmptests account for the arm64 binaries in mono
2021-03-12 12:33:40 -05:00
Rolf Bjarne Kvinge e6247e0c6f
[runtime] Port the is_user_type function from native to managed code. (#10841)
* [runtime] Port the is_user_type function from native to managed code.

* This is a straight forward port of native code to managed code, and
  shouldn't have any significant side effects.

* Makes it possible to move more code from native to managed for
  xamarin_create_managed_ref and xamarin_release_managed_ref in the future.

* Update xtro.
2021-03-12 07:38:27 +01:00
Rolf Bjarne Kvinge e53176383e
[builds] Remove the code to optionally inject an x64 slice into our binaries. (#10846)
It's been disabled for a while, which indicates that Apple has fixed the issue
on their side, and we don't need this code anymore.
2021-03-12 07:38:07 +01:00
Rolf Bjarne Kvinge a392035fa7
[runtime] Move a few mono function declaration to the generated logic for mono function declarations instead of doing it manually. (#10849)
This makes things a little bit easier to when starting work with CoreCLR.
2021-03-12 07:37:27 +01:00
Rolf Bjarne Kvinge 4cfa6928ae
[runtime] Simplify the various print_all_exceptions methods a bit. (#10847)
Unify them into a single one (xamarin_print_all_exceptions), which takes the
GCHandle of the exception to create an NSString representation of.
2021-03-12 07:37:13 +01:00
Rolf Bjarne Kvinge 37723f600c
[runtime] Speed up make (#10848)
Make variables can have dashes, which means we don't have to convert dashes in
rids to underscores to be able to compose variable names.

This speeds up make because now we don't have to execute hundreds of
subprocesses when parsing the makefile.

Before:

    $ make -j16 > /dev/null && /usr/bin/time make && /usr/bin/time make && /usr/bin/time make
        2.11 real         0.57 user         1.26 sys
        2.15 real         0.57 user         1.28 sys
        2.17 real         0.58 user         1.30 sys

After:

    $ make -j16 > /dev/null && /usr/bin/time make && /usr/bin/time make && /usr/bin/time make
        0.52 real         0.18 user         0.25 sys
        0.52 real         0.18 user         0.25 sys
        0.52 real         0.18 user         0.26 sys

So now it's ~4x faster (1.6s) for make to figure out there's nothing to do.
2021-03-12 07:36:41 +01:00
TJ Lambert 1018d02e2d
changing the configure vm-image to 'windows-latest' (#10832) 2021-03-11 10:01:24 -06:00
Rolf Bjarne Kvinge efee4d2832
[xharness] Bump timeout to evaluate MSBuild properties by running msbuild. (#10840)
Sometimes msbuild wants to restore packages during this process, which may
take a while.

Hopefully fixes errors like this:

    Harness exception for 'Tests for C6353E8B-BFDA-4F54-93D9-FF0F838BF8EE': System.Exception: Unable to evaluate the property OutputPath.
        at Xharness.AppBundleLocator.GetPropertyByMSBuildEvaluationAsync (System.Xml.XmlDocument csproj, System.String projectPath, System.String evaluateProperty, System.String dependsOnTargets, System.Collections.Generic.Dictionary`2[TKey,TValue] properties) [0x00327] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/AppBundleLocator.cs:109
        at Xharness.AppBundleLocator.LocateAppBundle (System.Xml.XmlDocument projectFile, System.String projectFilePath, Microsoft.DotNet.XHarness.iOS.Shared.TestTarget target, System.String buildConfiguration) [0x000d2] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/AppBundleLocator.cs:49
        at Microsoft.DotNet.XHarness.iOS.Shared.AppBundleInformationParser.ParseFromProject (System.String projectFilePath, Microsoft.DotNet.XHarness.iOS.Shared.TestTarget target, System.String buildConfiguration) [0x00147] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/AppBundleInformationParser.cs:71
        at Xharness.AppRunner.InitializeAsync () [0x00046] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/AppRunner.cs:120
        at Xharness.Jenkins.TestTasks.RunSimulator.SelectSimulatorAsync () [0x002df] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/RunSimulator.cs:108
        at Xharness.Jenkins.TestTasks.AggregatedRunSimulatorTask.ExecuteAsync () [0x00335] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/AggregatedRunSimulatorTask.cs:63
        at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync () [0x00226] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:283
2021-03-11 16:05:47 +01:00
Rolf Bjarne Kvinge fee2ecf943
[CoreFoundation] Fix collected delegate in CFStream. (#10831)
Fixes this fatal error at runtime:

> A callback was made on a garbage collected delegate of type 'Xamarin.Mac!CoreFoundation.CFStream+CFStreamCallback::Invoke'.
2021-03-11 16:02:09 +01:00
Rolf Bjarne Kvinge 3af399e21f
[runtime] Remove unused mono functions. (#10825) 2021-03-11 08:48:17 +01:00
Rolf Bjarne Kvinge 4854d7b4da
[runtime] Simplify calls to xamarin_create_managed_ref. (#10826)
I don't see why we should avoid calling xamarin_create_managed_ref from
NSObject's managed code, and then immediately call xamarin_create_managed_ref
upon return from NSObject's managed code.

This code is old ([1]), and from my reading of it, there's no specific reason
it was done this way.

Simplify the logic to call xamarin_create_managed_ref from a single place
(NSObject's managed code).

[1]: e59c45d3f9
2021-03-11 08:47:36 +01:00
Rolf Bjarne Kvinge a8b3d9c296
[runtime] Call into managed code to call GC.Collect instead of using embedding API. (#10828)
Any performance difference will be neglible compared to running the GC, so
there's no compelling reason to use the embedding API.

This makes things a bit easier with CoreCLR, since the new code works there too.

This also required a few changes in delegates.t4 to make code generation for
functions without arguments work correctly.
2021-03-11 07:37:45 +01:00
Rolf Bjarne Kvinge 603746c33f
[CoreText] Clean up CTRunDelegate[Operations] implementation. (#10830)
* Make CTRunDelegateCallbacks a struct instead of class, since it's being
  passed as a parameter to a P/Invoke. Passing an instance of a class to a
  P/Invoke is just weird.

* Make CTRunDelegate subclass NativeObject. This allows us to remove a big
  chunk of boiler-plate code.

* Make CTRunDelegateOperations.handle a private field. Handle fields should be
  private.

* Put the CTRunDelegateCallbacks struct with the delegates passed to native
  code on the CTRunDelegateOperations instance instead of the CTRunDelegate
  instance, since the callbacks are tied to the CTRunDelegateOperations instance.

  Fixes this fatal error on CoreCLR, because otherwise the Deallocate callback could be called after the CTRunDelegate instance was freed, in which case the Deallocate delegate could also be freed:

  > A callback was made on a garbage collected delegate of type 'Xamarin.Mac!CoreText.CTRunDelegateDeallocateCallback::Invoke'.
2021-03-11 07:36:45 +01:00