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

10795 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 8ec9182b12
[CI] Allow to ignore tests if dotnet is enabled. (#11604) 2021-05-20 09:37:22 -04:00
Sebastien Pouliot 52c75d30b4
[dotnet][linker] Use substitution files to remove UIButton debug code (#11623)
The debug code is removed only on release builds.

Unlike the _legacy_ linker the method itself is still present (not
removed) from the assembly - but it will be empty (no code).

Unit test was adapted to work under all conditions.

Fixes https://github.com/xamarin/xamarin-macios/issues/9613
2021-05-20 09:36:05 -04:00
Sebastien Pouliot 4ea2c8b2c0
[catalyst][accounts] Update xtro - framework is not available (#11624) 2021-05-20 09:35:09 -04:00
Sebastien Pouliot 9c78ba39cd
[catalyst][adsupport] Update xtro - framework is not available (#11625)
* [catalyst][adsupport] Update xtro - framework is not available

also found out an API was removed by Apple... turned it into
a stub for compatibility.
2021-05-20 09:30:55 -04:00
Sebastien Pouliot e4ce5bb828
[catalyst][authenticationservices] Update xtro - framework is not available (#11626) 2021-05-20 09:26:55 -04:00
Rolf Bjarne Kvinge 1b655344df
[mmp] Don't define CORECLR_RUNTIME when compiling the partial static registrar code (#11618)
We already define it in the generated code, so the native compiler shows a warning:

    Microsoft.macOS.registrar.coreclr.x86_64.m:1:9: warning: 'CORECLR_RUNTIME' macro redefined [-Wmacro-redefined]
    #define CORECLR_RUNTIME
            ^
    <command line>:2:9: note: previous definition is here
    #define CORECLR_RUNTIME 1
            ^
2021-05-20 07:35:52 +02:00
Rolf Bjarne Kvinge f8a19c7cbf
[runtime] Remove the declarations for mono_jit_parse_options and mono_gc_max_generation. (#11617)
We don't used these mono functions anymore.
2021-05-20 07:35:38 +02:00
Rolf Bjarne Kvinge f38187f054
[runtime] Refactor the toggle ref code to separate MonoVM-specific code and generic logic. (#11616)
This makes it simpler to impement the toggle ref logic for CoreCLR once we can
do that.
2021-05-20 07:35:23 +02:00
Rolf Bjarne Kvinge ee5e2f0b09
[monotouch-test] Ignore tests that require exception marshalling on CoreCLR for now, they fail. (#11615)
This makes monotouch-test green when using CoreCLR, both when using the
dynamic and the static registrar.

Ref: https://github.com/xamarin/xamarin-macios/issues/10940
2021-05-20 07:34:30 +02:00
Rolf Bjarne Kvinge a6f0dbdd67
[runtime] Fix declaration of xamarin_bridge_get_method_declaring_type. (#11614)
The native xamarin_bridge_get_method_declaring_type method and the
corresponding managed method (GetMethodDeclaringType) takes and returns a
MonoObject*, not a GCHandle.

Due to the wonders of void pointers, this worked just fine before - there's no
actual change to the compiled code - but the code is now more consistent and
less confusing.
2021-05-20 07:34:17 +02:00
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