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

10785 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 551be877bd
[monotouch-test] Ignore the SslSupportedCiphers test on .NET due to #11498. (#11613)
The underlying size of the SslCipherSuite is wrong, so the test fails.

Ref: https://github.com/xamarin/xamarin-macios/issues/11498
2021-05-20 07:33:55 +02:00
Rolf Bjarne Kvinge d60514b02b
[runtime] Postpone implementing mono_domain_set_config for CoreCLR. (#11610) 2021-05-20 07:33:26 +02:00
Rolf Bjarne Kvinge a33a86a9b7
[runtime] Implement mono_get_exception_out_of_memory for CoreCLR. (#11608) 2021-05-20 07:33:16 +02:00
TJ Lambert 72496111df
[Localization] Sync Localization branch with Main (#11603)
Add changes to sync main into Localization branch

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Connor Adsit <cadsit@microsoft.com>
2021-05-19 15:36:41 -05:00
Manuel de la Pena cecc343301
[CI] Fix API diff uploads since they broke when we wanted to continue on failure. (#11609) 2021-05-19 13:32:03 -04:00
Rolf Bjarne Kvinge 7c9cf9c378
[Runtime] Make Runtime.IsUserType optimizable. (#11607)
Fixes this mmptest:

    * Xamarin.ApiTest.ApiTest.AlwaysOptimizable(macOSMobile): All methods calling optimizable API must be optimizable
        The method System.Boolean ObjCRuntime.Runtime::IsUserType(System.IntPtr) calls System.Boolean ObjCRuntime.Runtime::get_DynamicRegistrationSupported(), but it does not have a [BindingImpl (BindingImplOptions.Optimizable)] attribute.
    * Xamarin.ApiTest.ApiTest.AlwaysOptimizable(macOSFull): All methods calling optimizable API must be optimizable
        The method System.Boolean ObjCRuntime.Runtime::IsUserType(System.IntPtr) calls System.Boolean ObjCRuntime.Runtime::get_DynamicRegistrationSupported(), but it does not have a [BindingImpl (BindingImplOptions.Optimizable)] attribute.
2021-05-19 14:52:25 +02:00
Manuel de la Pena e246a83b82
[CI] Update the config and parse it in the cascade pipeline. (#11587) 2021-05-19 08:22:38 -04:00
Rolf Bjarne Kvinge 62bb97e11c
[src] Add the method's name when computing a method's full name for display purposes. (#11597) 2021-05-19 07:43:18 +02:00
Rolf Bjarne Kvinge 4dc2ef7da9
[runtime] Be a bit defensive after handling Objective-C exceptions and return a consistent value. (#11601)
The value should never be used if everything is working fine, but if something
is wrong, then this value will at least get consistent behavior.

The visible result for us right now is that monotouch-test will fail with a
test failure instead of crashing.
2021-05-19 07:35:46 +02:00
Rolf Bjarne Kvinge 022fa9c697
[runtime] Throw a runtime exception instead of execution engine exception. (#11599)
* One less Mono Embedding method used: good for CoreCLR.
* More consistent with the rest of our code / behavior.
2021-05-19 07:34:13 +02:00
Rolf Bjarne Kvinge 69e6e83cc7
[tests] Add a .NET/MacCatalyst variation of monotouch-test. (#11539)
Also:

* Use the right arm64 runtime identifier depending on the target platform.
* Don't add CoreCLR variations of Mac Catalyst tests.
* Exclude UISearchDisplayController from tests, since it isn't available in
  Mac Catalyst anymore.
2021-05-18 18:39:12 +02:00
Rolf Bjarne Kvinge 4cb58b0225
[CoreCLR] Disable debug spew by default. (#11595)
It just ends up flooding everything now because of the progress made.
2021-05-18 18:33:04 +02:00
Manuel de la Pena eaa91190a6
[CI] If api & generator fail also ignore in publish html. (#11570) 2021-05-18 11:44:07 -04:00
Rolf Bjarne Kvinge 34772d23bc
[Runtime] Don't skip dynamic user type checking as long as dynamic registration is supported. (#11588)
When checking whether a type is a user type or not, we might have to do a
dynamic check if the dynamic registrar is available. Otherwise we may run into
a situation where the static registrar ran during the app build, but then the
app loaded additional assemblies at runtime, and those assemblies contained
user types that were registered using the dynamic registrar, so the static
registrar doesn't know about those custom types (in other words: we need to
check at runtime).
2021-05-18 16:28:09 +02:00
Sebastien Pouliot bab6827b8d
[dotnet][linker] Eliminate code that is only required for CoreCLR on iOS and tvOS (#11577)
CoreCLR is being added for macOS only. We can eliminate a lot of recent
code additions (about half a megabyte in the past week) by eliminate code
branches under `if (IsCoreCLR)`.

Unlike handling (non required at runtime) custom attributes the
`ILLink.Substitutions.xml` will vary quite a bit across platforms so we
use a unique file for each platform.
2021-05-18 09:33:41 -04:00
Rolf Bjarne Kvinge 94196bf767
[dotnet] Don't use an Output property to retrieve the list of native object files to link. (#11592)
If the task that creates the native object files doesn't execute (because the
native object files already exists and are up-to-date), the resulting list of
native object files to link will be empty.

This typically happens for a rebuild: if a native linker error occurs when
linking the main executable, building again will result in a successful build,
because we wouldn't try to link the main executable again.
2021-05-18 15:13:40 +02:00
Rolf Bjarne Kvinge fc52f2c7ff
[Runtime/CoreCLR] Only read/write a single byte for booleans when marshalling parameters in dynamic method calls for CoreCLR. (#11594)
Fixes this unit test:

    TestINativeObject: #b1
        Expected: 0
        But was: 140187942967200
2021-05-18 15:13:32 +02:00
Rolf Bjarne Kvinge 3f507b3ede [monotouch-test] Ignore tests that require globalization to work for Mac Catalyst.
Globalization doesn't work yet for Mac Catalyst: https://github.com/xamarin/xamarin-macios/issues/11392
2021-05-18 11:42:37 +02:00
Rolf Bjarne Kvinge 2272ee9696 [src] Ship Xamarin.iOS.dll as an implementation assembly as well in .NET/Mac Catalyst.
The Xamarin.iOS.dll assembly may be required at runtime (for non-linked apps,
if they consume other libraries that reference Xamarin.iOS.dll), and only
implementation assemblies will be put in the app bundle, thus Xamarin.iOS.dll
must be an implementation assembly.
2021-05-18 11:17:27 +02:00
Rolf Bjarne Kvinge bbfa3feee9 Merge remote-tracking branch 'origin/main' into tests-mac-catalyst-dotnet 2021-05-18 09:03:29 +02:00
Rolf Bjarne Kvinge 0e957d347f
[registrar] Define CORECLR_RUNTIME when in the generated registrar code for CoreCLR (#11584)
This makes sure that we build the right thing, our shipped headers behave
differently whether CORECLR_RUNTIME is defined or not.
2021-05-18 07:36:29 +02:00
Rolf Bjarne Kvinge b00b354f04
[xharness] Add a variation that uses the static registrar for monotouch-test/.NET/CoreCLR. (#11583) 2021-05-18 07:30:28 +02:00
Sebastien Pouliot cb7ece6e6b
[msbuild] Fix error message MSBStrings.W0073 -> W0074 (#11585)
Due to incorrect update while adapting code for translations.

```
    <data name="W0073" xml:space="preserve">
        <value>The App Extension '{0}' has a CFBundleVersion ({1}) that does not match the main app bundle's CFBundleVersion ({2})
        </value>
    </data>

    <data name="W0074" xml:space="preserve">
        <value>The App Extension '{0}' has an unrecognized NSExtensionPointIdentifier value ('{1}').
        </value>
    </data>
```

Fixes https://github.com/xamarin/xamarin-macios/issues/11581
2021-05-17 23:09:07 -04:00
Rolf Bjarne Kvinge db8b688704
[ObjCRuntime] Fix pointer logic with regards to MonoObject*s. (#11582)
Instead of passing a pointer to pointer to a pointer of a MonoObject to
xamarin_mono_object_retain, we pass a pointer to a MonoObject (like
xamarin_mono_object_retain expects).
2021-05-17 23:19:54 +02:00
Sebastien Pouliot 63ad08ed44
[src] Fix some breaking changes detected when bumping APIDIFF (#11567)
They were not visible (or handled differently in `main`) but
become _small_ breaking changes once we released xcode12.5 support.
2021-05-17 15:56:18 -04:00
Manuel de la Pena c49c241f43
[CI] Do run 32b tests. (#11571) 2021-05-17 11:17:37 -04:00
Rolf Bjarne Kvinge e8f26723ef
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)
* CoreCLR doesn't support generic Action delegates in reverse (P/Invokes), so
  we need to find a different solution.
* The native CGPDFOperatorTable callback API is not very friendly to us,
  because we can't pass it callback-specific data, which means that the
  managed caller must conform to the FullAOT requirement of the managed
  callback (must be a static function; must have a MonoPInvokeCallback
  attribute).
* We can leverage the new function pointer syntax in C# 9 to make these
  requirements enforced by the C# compiler (unmanaged function pointer +
  UnmanagedCallersOnly attribute). The resulting API is still clunky to use,
  but I don't see any way around that.

Fixes this monotouch-test failure with CoreCLR:

    [FAIL] Tamarin : System.Runtime.InteropServices.MarshalDirectiveException : Cannot marshal 'parameter #3': Non-blittable generic types cannot be marshaled.
               at CoreGraphics.CGPDFOperatorTable.CGPDFOperatorTableSetCallback(IntPtr table, String name, Action`2 callback)
               at CoreGraphics.CGPDFOperatorTable.SetCallback(String name, Action`2 callback)
               at MonoTouchFixtures.CoreGraphics.PDFScannerTest.Tamarin() in xamarin-macios/tests/monotouch-test/CoreGraphics/PDFScannerTest.cs:line 102

Ref: https://github.com/dotnet/runtime/issues/32963
2021-05-17 07:45:04 +02:00
Rolf Bjarne Kvinge ab14e07146
[runtime] Implement mono_class_value_size for CoreCLR. (#11554) 2021-05-14 15:19:34 +02:00
Rolf Bjarne Kvinge eab3accf26
[runtime] Implement mono_class_is_enum and mono_class_enum_basetype for CoreCLR. (#11553)
* [runtime] Implement mono_class_is_enum for CoreCLR.

* [runtime] Implement mono_class_enum_basetype for CoreCLR.
2021-05-14 15:19:23 +02:00
Sebastien Pouliot 34c55f4ed4
[dotnet][tests][intro] Update ApiPInvokeTest (#11557)
* `QCall` seems to be gone
* `libSystem.Globalization.Native` symbols are part of the executable
  since they come from a static library
2021-05-14 09:00:18 -04:00
Sebastien Pouliot d8e1c600a4
[apidiff] Bump definitions now that `xcode12.5` support is on stable (#11558) 2021-05-14 08:41:56 -04:00
Rolf Bjarne Kvinge 9e6704ea4e Merge remote-tracking branch 'origin/main' into tests-mac-catalyst-dotnet 2021-05-14 08:04:07 +02:00
Manuel de la Pena c1981b0b7e
[Tests] Undo change that broke intro in BS. (#11556) 2021-05-14 07:49:47 +02:00
Rolf Bjarne Kvinge 9a013fd4a7
[runtime] Implement xamarin_get_[nsnumber|nsvalue]_type for CoreCLR. (#11552)
* Remove a few unused xamarin_get_*_class functions.
* Make the remaining two (xamarin_get_[nsnumber|nsvalue]_type) return a
  MonoType* instead of MonoClass* - that makes things slightly simpler for
  CoreCLR (the MonoClass* return values from the previous functions were
  always converted to MonoType*s anyway).
* Implement the xamarin_get_[nsnumber|nsvalue]_type functions.
* Make the existing mono_get_string_class use the new (and more generic)
  xamarin_bridge_lookup_class method instead of the specific
  xamarin_bridge_get_string_class (which can now be removed).
2021-05-14 07:29:48 +02:00
Rolf Bjarne Kvinge 42740a5c95
[runtime] Make xamarin_bridge_free_mono_signature accept NULL signatures. (#11550) 2021-05-14 07:28:53 +02:00
Rolf Bjarne Kvinge adb355b757
[runtime] Add support for creating managed exceptions from native code for CoreCLR. (#11538) 2021-05-14 07:27:42 +02:00
Rolf Bjarne Kvinge cf932d8f61
[msbuild] Add support for smelting metal for Mac Catalyst. (#11537)
This makes monotouch-test's Metal test file compile for Mac Catalyst.
2021-05-14 07:26:44 +02:00
Sebastien Pouliot 9591a47ac3
[dotnet][tests][link all] Ignore failures on devices (#11551)
Already known issues (already filled for similar tests in Link SDK)
2021-05-13 20:42:52 -04:00
Sebastien Pouliot 30c877ce45
[dotnet][tests][link sdk] Remove [Ignore] for https://github.com/dotnet/runtime/issues/49201 (#11549) 2021-05-13 20:39:50 -04:00
Manuel de la Pena bdfa8ca344
[CI] If the api & generator is not built do not fail the build. (#11525)
If can happen that when we bump xcode we do not get an api & generator
diff. This results in a set of cascading events that make the build
fail.

We know track when the result is not 0, store it in a var and pass that
variable to all the tempaltes that need it. The pwsh script already has
an if to check if the file if present and if not, it shows a warning.
2021-05-13 17:18:32 -04:00
Sebastien Pouliot b46cea29c7
[dotnet][tests] Fix monotouch-test RegistrarRemoval (#11527)
The registrar removal was fixed recently but the test was still failing.
Turns out xharness modify the linker setting for this test (as the
linker is required for this optimization) but the newer dotnet csproj
did not have an entry (to modify).

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

[xharness] Fix monotouch-test build when LinkSdk is used for dotnet projects

Skip failing assertion, issue filled
2021-05-13 17:01:20 -04:00
Sebastien Pouliot aaefe7bcf2
[tests][intro] Add back `[Test]` on some methods (#11542)
Those were likely removed when we excluded the tests from Catalyst
2021-05-13 16:58:10 -04:00
Rolf Bjarne Kvinge 5795a62f77
[runtime] Implement mono_method_full_name for CoreCLR. (#11536) 2021-05-13 22:04:09 +02:00
Rolf Bjarne Kvinge 0a0a849b02
[runtime] Implement mono_class_is_nullable for CoreCLR. (#11528) 2021-05-13 22:03:22 +02:00
Rolf Bjarne Kvinge 427c5447db
[tools] Make exception marshalling the default for CoreCLR (and make it an error to choose otherwise). (#11535)
* Make 'throw Objective-C exception' the default for managed exception marshalling.
* Make 'throw managed exception' the default for Objective-C exception marshalling.
* Disallow the 'unwind through native frames' option: CoreCLR won't do it.
* Disallow the 'unwind through managed frames' option: it's the safeset
  option by far, and also matches the reverse case.
* Disallow the 'disable' option: this is also not safe, let's try to go the
  safe route with CoreCLR.
* Change the default in native code too.

Partial fix for #10940.
2021-05-13 20:59:18 +02:00
Rolf Bjarne Kvinge 23fedf8389
[MediaToolbox] Don't use Action<T> in reverse P/Invokes. (#11541)
CoreCLR doesn't support it.

Ref: https://github.com/dotnet/runtime/issues/32963
2021-05-13 20:58:38 +02:00
Rolf Bjarne Kvinge 83dbeda8c6
[runtime] Refactor xamarin_get_nsnumber_converter to use string comparisons instead of mono_type_get_type. (#11530)
This makes it easier for CoreCLR. Also, at least for CoreCLR, it's unlikely to
be slower, since we'd have to compute the MONO_TYPE_* value in any
compatibility function.
2021-05-13 20:56:02 +02:00
Rolf Bjarne Kvinge 64e19d2d34
[runtime] Implement mono_class_get_nullable_param for CoreCLR. (#11531) 2021-05-13 20:39:07 +02:00
Rolf Bjarne Kvinge 95dfc4fa39
[runtime] Implement mono_value_box for CoreCLR. (#11533) 2021-05-13 20:38:21 +02:00
Rolf Bjarne Kvinge 8f1f367424
[runtime] Fix call to xamarin_print_all_exceptions. (#11532)
Passing a 'MonoObject*' to a function that expects a GCHandle doesn't quite
work, so make sure to get a GCHandle for the exception we want to print
information about.
2021-05-13 20:38:12 +02:00