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

8955 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7756d957f9
[dotnet] Tell the linker about any xml descriptors we might have. (#9676)
Also add a linker descriptor to the monotouch-test/.NET project file to
preserve the parts of nunit.framework.dll that aren't linker safe.

This fixes an unhandled exception that causes a crash during the
monotouch-test test run when the linker is enabled:

    Unhandled Exception:
    System.NullReferenceException: Object reference not set to an instance of an object

    Thread 11 Crashed:: tid_15403  Dispatch queue: com.apple.root.default-qos
    0   libsystem_kernel.dylib        	0x00007fff5220c33a __pthread_kill + 10
    1   libsystem_pthread.dylib       	0x00007fff522b6e60 pthread_kill + 430
    2   libsystem_c.dylib             	0x00007fff5219bb7c abort + 120
    3   libxamarin-debug.dylib        	0x000000010c93979f xamarin_unhandled_exception_handler + 47
    4   libmonosgen-2.0.dylib         	0x000000010cc04980 mono_invoke_unhandled_exception_hook + 131
    5   libmonosgen-2.0.dylib         	0x000000010cb40166 mono_handle_exception_internal + 5915
    6   libmonosgen-2.0.dylib         	0x000000010cb3ea47 mono_handle_exception + 11
    7   libmonosgen-2.0.dylib         	0x000000010cb8ea06 mono_amd64_throw_exception + 158
    8   ???                           	0x000000010d4125b0 0 + 4517340592
    9   libxamarin-debug.dylib        	0x000000010c9394fb xamarin_process_managed_exception + 379 (runtime.m:2361)
    10  libxamarin-debug.dylib        	0x000000010c939377 xamarin_process_managed_exception_gchandle + 55 (runtime.m:1144)
    11  libxamarin-debug.dylib        	0x000000010c939333 xamarin_ftnptr_exception_handler + 19 (runtime.m:1133)
    12  libmonosgen-2.0.dylib         	0x000000010cb3feeb mono_handle_exception_internal + 5280
    13  libmonosgen-2.0.dylib         	0x000000010cb3ea47 mono_handle_exception + 11
    14  libmonosgen-2.0.dylib         	0x000000010cb8f2dd handle_signal_exception + 67
    15  ???                           	0x000070000fd730d8 0 + 123145568071896
    16  ???                           	0x000000011a3ab99b 0 + 4735023515
    17  ???                           	0x000000011a3aa643 0 + 4735018563
    18  libdispatch.dylib             	0x00007fff52090a0f _dispatch_queue_override_invoke + 1071
    19  libdispatch.dylib             	0x00007fff5209dcc5 _dispatch_root_queue_drain + 350
    20  libdispatch.dylib             	0x00007fff5209e46a _dispatch_worker_thread2 + 102
    21  libsystem_pthread.dylib       	0x00007fff522b39f7 _pthread_wqthread + 220
    22  libsystem_pthread.dylib       	0x00007fff522b2b77 start_wqthread + 15
2020-09-22 09:15:33 +02:00
Rolf Bjarne Kvinge 0e56df74a4
[tools] Simplify code a little bit by making DerivedLinkContext.StaticRegistrar a fetch property instead of a push property (#9677) 2020-09-21 17:54:23 +02:00
Rolf Bjarne Kvinge 3c89b80b3b
[dotnet-linker] Set the dynamic registration mode at runtime. (#9675)
This way we know at runtime what's available and what's not, which means that
the runtime won't try to register assemblies when the dynamic registrar has
been linked away.

Fixes this startup crash in monotouch-test when all optimizations have been enabled:

    Unhandled Exception:
    ObjCRuntime.RuntimeException: The runtime function register_assembly has been linked away.
2020-09-21 17:54:04 +02:00
Rolf Bjarne Kvinge 39e3184f02
[src] Build the .NET version of our product assemblies using a .NET 5 BCL. (#9637)
* [src] Build the .NET version of our product assemblies using a .NET 5 BCL.

We're not shipping the .NET product assemblies in any stable release, so we
can use a preview version of the .NET 5 BCL.

Also:

* Add all the nuget feeds we need to the top-level NuGet.config, even for .NET
  5/6, there shouldn't be any conflicts with stable feeds since we use exact
  version numbers.

* Generate a top-level global5.json which is copied to every directory that
  needs a .NET 5 global.json (overriding the .NET 3.1 global.json in the root
  directory).

* Use the expected dotnet binary during our local build.

* [tests] Fix the bgen tests to use .NET 5.

* [xharness] Set the current directory to the project directory when running .NET tests.

This way we end up using the dotnet version that's configured in global.json for the tests.
2020-09-21 13:22:44 +02:00
Rolf Bjarne Kvinge 569b484ba7
[msbuild/dotnet] Execute bgen using dotnet from the MSBuild tasks when in .NET mode. (#9662) 2020-09-21 08:25:27 +02:00
Manuel de la Pena e72ef18beb
[Mono] Bump mono to match xamarin-android on be2226b (#9663)
Commits:

  * mono/mono@be2226b5a1: Revert "[crashing] Improve crash chaining (#19973)"
  * mono/mono@cdeef84f3c: Added hard limit to sub-make jobs. Fixes #19784 (#20389)
  * mono/mono@9b9e4ba6e8: WiX cannot package UNIX symlinks; force Cygwin to use Windows symlinks (#20374)
  * mono/mono@7507fb2859: [2020-02] Issue18826 fix (#20358)
  * mono/mono@e368cf51d8: Bump external/llvm-project to 2ca761dc8b83a75ad950f468fb68e764e61d9cfa (#20365)
  * mono/mono@abfd341464: [Android] Enable access to up-to-date tzdata on Android 10+ (#20350)
  * mono/mono@32c0b1aaf9: Support overriding SDK_DIR/NDK_DIR in sdks/android/Makefile
  * mono/mono@620cf53820: [2020-02] Avoid following invalid pointers in mono_w32process_get_modules on Darwin. (#20297)
  * mono/mono@41494af55d: Bump corefx to disable DateTime test
  * mono/mono@66e2b84002: [aot] Fix an assert which is hit for generic instances with a lot of arguments. (#20239)
  * mono/mono@d3daacdaa8: Bump msbuild to latest commit
  * mono/mono@e59c1cd70f: Fix Cairo issue on macOS Big Sur (#20154)
  * mono/mono@648655b86d: [aot] Avoid a crash in generic sharing for invalid generic instances. (#20158)
  * mono/mono@ec71e8a7ae: [2020-02] Reapply "Emit DWARF debug_abbrev offset for compile units as a label instead of 0" (#20046)
  * mono/mono@20bb4f9a6d: [mono][mini] Do a non-virtual call for bound delegates (#20039)
  * mono/mono@9ca6fa646a: [merp] Remove dead code (#20043)
  * mono/mono@2ff424be29: [crashing] Improve crash chaining (#20018)

Full diff: 83105ba224...be2226b5a1
Related android PR: https://github.com/xamarin/xamarin-android/pull/5128
2020-09-18 15:42:10 -04:00
Rolf Bjarne Kvinge 79068f7038
Bump to .NET 5.0.100-rc.1.20426.3. (#9666)
* Bump to .NET 5.0.100-rc.1.20426.3.

* [dotnet] SupportedTargetPlatform is now SdkSupportedTargetPlatform.

It was renamed in .NET: 4c6c7338fb
2020-09-18 17:40:39 +02:00
Whitney Schmidt f8eca9fb53
[SBApplication][Bug] SBApplication.FromBundleIdentifier<T> should return null when bundle ID is unknown (#9620)
* update SB bindings, add unit tests
2020-09-18 11:18:26 -04:00
Rolf Bjarne Kvinge 1463967d00
[xharness] Skip the 'dont link / AssemblyBuildTarget: SDK framework (release)' variation by default for tvOS. Fixes #xamarin/maccore@2282. (#9659)
This test variation ends up being too big (1.5 GB), so it doesn't install
properly and the app crashes at startup.

So just skip it.

Fixes https://github.com/xamarin/maccore/issues/2282.
2020-09-18 09:08:32 +02:00
Rolf Bjarne Kvinge 3461d8186f
[monotouch-test] Don't assert any specific value for the ReusedConnection value in UrlSessionTaskTransactionMetricsTest. Fixes #xamarin/maccore@2281. (#9660)
Fixes https://github.com/xamarin/maccore/issues/2281.
2020-09-18 09:08:16 +02:00
Rolf Bjarne Kvinge d53a2336ad
[monotouch-test] Rework CBCentralManagerTest to handle not having permissions. (#9661)
1. Assert that we got permission to CoreBluetooth before doing anything. This
   makes it so that if permission has been denied, or if we're running on the
   bots and permission has not been granted, these tests won't run. It does
   not affect local test runs where permissions haven't been granted nor
   denied.

2. Rework the code to wait for CoreBluetooth to power on in the SetUp method.
   Mark the test as inconclusive if CoreBluetooth never powers on (this
   happens if nobody answers the bluetooth permission dialog, quite typical
   when running tests locally).

Fixes these tests when running locally on a tvOS device:

    MonoTouchFixtures.CoreBluetooth.CBCentralManagerTest
        [FAIL] Constructors
        [FAIL] ScanForPeripherals
2020-09-18 09:07:31 +02:00
Manuel de la Pena 615932d21e
[Tests]Fixed broken tests.sln. (#9656) 2020-09-17 08:01:00 -04:00
Aaron Bockover 41ba8c7f42
CGRect, CGPoint, CGSize: add tuple deconstruction methods (#9641)
New APIs:

  CGPoint:
    public void Deconstruct(
      out nfloat x,
      out nfloat y)

  CGSize:
    public void Deconstruct(
      out nfloat width,
      out nfloat height)

  CGRect:
    public void Deconstruct(
      out nfloat x,
      out nfloat y,
      out nfloat width,
      out nfloat height)

    public void Deconstruct(
      out CGPoint location,
      out CGSize size)

Usage:

  var (location, size) = View.Frame;
  var (x, y, width, height) = View.Frame;
  var (x, y) = View.Frame.Location;
  var (width, height) = View.Frame.Size;
2020-09-17 10:41:13 +02:00
Rolf Bjarne Kvinge 2c3634dbcc
[msbuild] Parse the --xml extra bundler argument in ParseBundlerArgumentsTask. (#9639)
Also add some tests.
2020-09-16 09:42:21 +02:00
Manuel de la Pena cf6c8e6632
[Network] Add nullability support. (#9630)
Fixes two issue found by the compiler.
2020-09-15 14:47:01 -04:00
Whitney Schmidt 01254a04a4
fix inconsistent use of punctuation in argument descriptions (#9621) 2020-09-15 12:33:18 -04:00
Rolf Bjarne Kvinge e1ac701421
[tests] Rework a few tests to not throw exceptions in a background thread. (#9636)
Uncaught exceptions in a background thread will cause the process to crash.
Instead marshal any exceptions to the main thread, which asserts that no
exceptions were thrown.
2020-09-15 16:50:50 +02:00
Rolf Bjarne Kvinge 4915566c46
[xharness] The linkall tests are green for .NET/Release now. (#9629) 2020-09-14 19:16:13 +02:00
Rolf Bjarne Kvinge a3713119f0
Improve the layout of the table of old packages in the README. (#9627) 2020-09-14 17:08:44 +02:00
Whitney Schmidt f12d9e7d4d
[Bug] AVAudioSourceNodeRenderHandler delegate is incorrectly bound (#9565)
* Fix binding
2020-09-11 16:41:42 -04:00
Rolf Bjarne Kvinge 8cc314654f
[dotnet] Add support for the static registrar. (#9615) 2020-09-11 14:08:48 +02:00
Rolf Bjarne Kvinge 1a582ed59a
[tests] Ignore a few link sdk tests in .NET for now. (#9614)
There are easier fish to fry right now, so implementing the linker support for
these tests to pass (metadata reduction and code removal) can wait.

This makes the link sdk/Release variation green for .NET.

Ref: https://github.com/xamarin/xamarin-macios/issues/9612
Ref: https://github.com/xamarin/xamarin-macios/issues/9613
2020-09-10 16:01:19 +02:00
Rolf Bjarne Kvinge a2d50c7d19
[xharness] Add support for adding PropertyGroups if none are applicable when adding a property. (#9616)
Some .NET test projects (monotouch-test) require this to set properties for
some test variations, and .NET projects are quite minimal, making it likely
that they won't have a particular property that needs to be set/modified.

This makes it possible to execute the various monotouch-test variations for
.NET in xharness (some of the variations still fail though, so they're still
ignored by default).
2020-09-10 15:09:51 +02:00
Sebastien Pouliot 3b5c19a81d
[mediaplayer] Fix MPMusicPlayerController NowPlayingItem on recent iOS versions (#9604)
Rolf nailed the issue in https://github.com/xamarin/xamarin-macios/issues/9578#issuecomment-688409802
> The problem is that iOS returns an instance of a private type (_MPMusicPlayerMediaItemProxy) which is an NSProxy subclass, and currently we don't support NSProxy.

https://github.com/rolfbjarne/xamarin-macios/commit/873a1e1 was on the
right track but it turns out `[ForcedType]` on properties don't need, nor
work (same generated code), with `return:`.

Inside `DynamicRegistrar.cs` the method
```csharp
public Type Lookup (IntPtr @class, bool throw_on_error)
```
did not respect (was unused) the `throw_on_error`. That made it
impossible to force the type to the pointer we got.

In `Runtime.cs` the method `LookupINativeObjectImplementation` must also
be able to work without an exception (from the `Lookup`) at least when we
want to force the type.
2020-09-10 13:32:50 +02:00
Rolf Bjarne Kvinge 37a6569aee
[registrar] Make the registrar code non-conditional. (#9609)
Some appextension mtouch code had to be moved to shared code. This code is currently
only used for iOS/tvOS/watchOS, but it will eventually be applicable to macOS as
well.

This makes it possible to re-use the registrar code in dotnet-linker.
2020-09-10 08:31:12 +02:00
Rolf Bjarne Kvinge eb5206f082
[dotnet-linker] Add OptimizeGeneratedCodeSubStep into the pipeline. (#9608)
Fixes these linkall tests:

    Linker.Shared.OptimizeGeneratedCodeTest
        [FAIL] IsARM64CallingConvention :   optimized: no ldsfld instruction
        Expected: 0
        But was:  1
            at Linker.Shared.BaseOptimizeGeneratedCodeTest.IsARM64CallingConvention() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 527
    
    [FAIL] SetupBlockPerfTest :   At least 6x speedup
        Expected: greater than 6
        But was:  1.0876440665344851d
            at Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 120

And linkall is now green for .NET/Debug.
2020-09-10 08:30:45 +02:00
Rolf Bjarne Kvinge ae1fe7a53d
[Foundation] Fix NSUrl's implicit Uri operators. Fixes #9607. (#9610)
Calling Uri.PathAndQuery is not allowed on a relative Uri, which made the
previous Uri -> NSUrl implicit operator always throw if given a relative
NSUrl.

So I fixed that, added several tests, and found another issue (it turns out
that 'url.RelativePath == url.Path' is not a reliable way to detect absolute
urls, because it's true for relative urls as well) and fixed that too.

Fixes https://github.com/xamarin/xamarin-macios/issues/9607.
2020-09-10 08:29:09 +02:00
Rolf Bjarne Kvinge d1db57fa74
[msbuild] Parse the --registrar extra bundler argument in ParseBundlerArgumentsTask. (#9606)
Also add some tests.
2020-09-09 15:42:33 +02:00
Rolf Bjarne Kvinge 941d65f016
[dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration. (#9599)
* [dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration.

Also call Application.InitializeCommon to initialize the application instance. The
important part here is that InitializeCommon calls Optimizations.Initialize to compute
the default optimizations. It also calls Set*ExceptionMode and sets the default EnableCoopGC
value (so we don't need to call/set those anymore), and it does a few other initialization
tasks which we don't need yet, but eventually will.

And finally remember to parse the bundler arguments before using them in the dotnet
build logic. How did this not cause problems before? 🤦

* [tests] Set the verbosity using the additional args instead of an internal variable.

The internal _BundlerVerbosity variable is overwritten now (with the verbosity
value from the additional args).

* [xharness] Disable tvOS generation for the introspection/.NET test, it incorrect and needs fixing.
2020-09-09 14:52:46 +02:00
Rolf Bjarne Kvinge 7a79845d86
[tests] Add DYNAMIC_REGISTAR when we're using the dynamic registrar in the .NET version of monotouch-test. (#9605)
This makes sure the tests know which registrar we're using, and can act accordingly.
2020-09-09 12:07:53 +02:00
Sebastien Pouliot cf3d9f7d23
[linker] Fix warnings on type references that still exists. Fix #8814 (#9600)
The type references are not cleaned (anymore?) and what's in memory can
be different from what will be saved to disk (which is the part that
matter).

So before linking we can check for type references (in a module) but
after linking need to see if it resolve (which means the definition,
of the reference, can still be found) and, just be be thorough, check
that's it's marked (if found).
2020-09-09 03:04:35 -04:00
Rolf Bjarne Kvinge 1d3c9f4a04
[UIKit] Sprinkle NullAllowed on UIImage according to Apple's headers. Fixes #9597. (#9598)
Fixes https://github.com/xamarin/xamarin-macios/issues/9597.
2020-09-09 08:49:08 +02:00
Rolf Bjarne Kvinge f1e22e369d
[tools] Refactor the Optimizations class to have no conditionally compiled code. (#9596)
Refactor the Optimizations class to have no conditionally compiled code, which makes
it re-usable from our dotnet-linker code.

Also return any errors or warnings instead of showing/throwing them, which makes
the caller able to show them using whatever means is easiest for the caller.

One test needed an update to the list of valid optimizations, because we now have
a per-platform map of valid optimizations, instead of just a iOS/tvOS/watchOS vs
macOS split ('remove-unsupported-il-for-bitcode' is only valid for watchOS, and now
we say so, while we previously said it was a valid optimization for iOS and tvOS
as well, even though we'd warn about it and do nothing if you tried to set it).
2020-09-08 20:26:28 +02:00
TJ Lambert 3f7f0425c2
nunit2 format for supported in MSBuild Tests Workaround (#9545) 2020-09-08 09:51:13 -05:00
Rolf Bjarne Kvinge f0f47b6a46
[dotnet] Make the linker always process debug symbols, and remove debugging support if we're building a release build. (#9594)
Unfortunately due to when things happen in the .NET build logic, we need to
define the DebuggerSupport property (which determines whether the app should
include debugging support or not) before importing the .NET build files. Since
we want to use the _BundlerDebug property (a.k.a. MtouchDebug/MmpDebug) to
determine if the app should include debugging support, we must figure out the
value of the _BundlerDebug property before we can define the DebuggerSupport
property. This turned out complicated, because we're currently defining
_BundlerDebug in our old-style MSBuild logic, which is imported after we
import the .NET build logic.

The end result is that we can either shuffle around a lot of MSBuild code, or
copy a few lines to set the _BundlerDebug property. Neither option makes me
very happy, but copying a few lines of code seemed the better option, so
that's what I did.

Fixes these linkall test failures in Release mode:

    LinkAll.Attributes.AttributeTest
        [FAIL] DebugAssemblyAttributes :   DebuggableAttribute
            Expected: False
            But was:  True
                at LinkAll.Attributes.AttributeTest.DebugAssemblyAttributes()

        [FAIL] DebugConstructorAttributes :   No debug attribute in release mode
            Expected: 0
            But was:  2
                at LinkAll.Attributes.AttributeTest.DebugConstructorAttributes()

        [FAIL] DebugPropertyAttributes :   DebuggerBrowsable
            Expected: False
            But was:  True
                at LinkAll.Attributes.AttributeTest.DebugPropertyAttributes()

        [FAIL] DebugTypeAttributes :   no debug attribute in release mode
            Expected: 0
            But was:  5
                at LinkAll.Attributes.AttributeTest.DebugTypeAttributes()

        [FAIL] DebuggerTypeProxy_24203 :   proxy
            Expected: null
            But was:  <System.Collections.Generic.IDictionaryDebugView`2[K,V]>
                at LinkAll.Attributes.AttributeTest.DebuggerTypeProxy_24203()
2020-09-08 14:55:34 +02:00
Rolf Bjarne Kvinge d9822057ab
[tests] Prebuilt the Touch.Client projects when packaging the Xamarin.Mac tests. (#9595)
Prebuild the Touch.Client projects for macOS when packaging the Xamarin.Mac
tests, so that when we try to build all the Xamarin.Mac test projects in
parallel, we don't end up trying to build the Touch.Client projects from
multiple build processes at the same time, causing numerous random failures
because all the processes are stomping on eachother.
2020-09-08 14:45:58 +02:00
Rolf Bjarne Kvinge 680c3c9347
[ObjCRuntime] Improve a few error/log messages to show the class name instead of the class handle. (#9593) 2020-09-08 07:59:48 +02:00
Rolf Bjarne Kvinge 9496e6db7e
[dotnet] Define and implement a 'framework' or 'sdk' assembly as an assembly that comes from the .NET BCL NuGet. (#9571)
The Assembly.IsFrameworkAssembly property is used in two places:

* In Driver.IsBoundAssembly to return early when determining if an assembly has any NSObject subclasses: c1c5b9aac6/tools/mtouch/mtouch.cs (L1155-L1168)
* In Assembly.ExtractNativeLinkInfo to return early when looking for assemblies with LinkWith attributes: c1c5b9aac6/tools/common/Assembly.cs (L150-L154)

In both cases this definition of framework assembly works today and seems likely to work in the future as well.

I also went through and looked at all the usages of Profile.IsSdkAssembly, and it's used to:

* Decide which assemblies are selected for "link sdk"
* Decide which assemblies are considered an 'sdk' assembly for creating a user framework of all the sdk assemblies
* Bail out early when deciding whether:
    * An assembly references the product assembly (Xamarin.iOS.dll, etc.)
    * An assembly can contain references to UIWebView
    * An assembly can contain user resources
    * An assembly is a binding project / has third-party native resources
    * An assembly needs the dynamic registrar
    * An assembly has FieldAttributes whose native fields must be preserved by the native linker

In all cases our .NET definition of 'SDK' seems to work both for now and in the future.

There are also a few usages which does not apply to .NET, so I've ignored them:

* When looking for a few BCL APIs that must be preserved (MobileApplyPreserveAttribute.cs): this is to be done in the upstream .NET linker now, so it doesn't apply to our own code
* When linking away parameter names (MonoTouchMarkStep.cs): this is to be done in the upstream .NET linker now, so it doesn't apply to our own code
2020-09-07 18:33:53 +02:00
Rolf Bjarne Kvinge c56b893b68
[tests] Disable some of linkall's SealerTest in .NET/Release until we can implement them. (#9575)
Fixes these test failures:

    Linker.Sealer.SealerTest
    [FAIL] Final :   A
        Expected: True
        But was:  False
            at Linker.Sealer.SealerTest.Final()

    [FAIL] Sealed :   Sealable
        Expected: True
        But was:  False
            at Linker.Sealer.SealerTest.Sealed()

    [FAIL] Virtual :   C
        Expected: False
        But was:  True
            at Linker.Sealer.SealerTest.Virtual()
2020-09-07 10:20:38 +02:00
Rolf Bjarne Kvinge 0a1a68ab9f
[msbuild] Parse the --optimize extra bundler arguments in ParseBundlerArgumentsTask. (#9572)
Also add some tests.
2020-09-02 15:05:31 +02:00
Rolf Bjarne Kvinge c1c5b9aac6
[tests] Ignore/fix/adjust several link all tests to make them pass in .NET. (#9570)
This gets linkall to an almost green state (there are still a few more failing
tests, those are a bit more complex to fix and will get seperate PRs).
2020-09-02 08:50:31 +02:00
Rolf Bjarne Kvinge 93eb592fba
[tests] Add test case for issue #9566. (#9567)
LinkAll.Interfaces.InterfaceTest

        [FAIL] Issue9566 : System.InvalidCastException : Specified cast is not valid.
            at LinkAll.Interfaces.InterfaceTest.Issue9566 () [0x00001] in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/InterfacesTest.cs:97
            at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
            at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in
2020-09-02 08:45:58 +02:00
Rolf Bjarne Kvinge 9ed9c7f5b9
[jenkins] Clean up old simulators and Xcodes before every build. (#9547) 2020-09-01 22:29:42 +02:00
Whitney Schmidt dbf7d50836
fix typo (#9555) 2020-09-01 10:09:01 -04:00
Rolf Bjarne Kvinge c3af3304a8 [tests] Update linkall's CommonLinkAllTest.BindingsAndBeforeInitField[_2] tests to work around linker heuristics.
Also ignore the BindingsAndBeforeInitField test because we're missing a few linker bits to make it work.

Fixes this linkall test failure:

    LinkAll.CommonLinkAllTest
        [FAIL] BindingsAndBeforeInitField :   one
            Expected: 1
            But was:  0
                at LinkAll.CommonLinkAllTest.BindingsAndBeforeInitField() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 65
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 1bbc6c8cbf [tests] Ignore linkall's XmlSerializationTest because .NET's linker doesn't support Xml serialization yet.
Ref: https://github.com/dotnet/runtime/issues/41389#issuecomment-682668670

Fixes this test failure:

    LinkAll.Serialization.Xml.XmlSerializationTest
        [FAIL] GenericProperty_Bug5543 : System.InvalidOperationException : There was an error reflecting type 'LinkAll.Serialization.Xml.XmlResult`1[System.String]'.
            ----> System.InvalidOperationException : There was an error reflecting property 'Result'.
            ----> System.InvalidOperationException : You need to add XmlChoiceIdentifierAttribute to the 'Result' member.
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
            at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
            at System.Xml.Serialization.XmlSerializer..ctor(Type type)
            at LinkAll.Serialization.Xml.XmlSerializationTest.GenericProperty_Bug5543() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/XmlSerializationTest.cs:line 52
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
            --InvalidOperationException
            at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
            --InvalidOperationException
            at System.Xml.Serialization.XmlReflectionImporter.CheckAmbiguousChoice(XmlAttributes a, Type accessorType, String accessorName)
            at System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType, Boolean rpc, Boolean openModel, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, String ns, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 22f67c0103 [tests] Adjust linkall's ClassLayoutTest's DefaultLayoutClass and AutoLayoutClass tests to continue outsmarting a somewhat smarter linker.
Fixes these test failures:

    LinkAll.Layout.ClassLayoutTest
        [FAIL] AutoLayoutClass :   Length
            Expected: 1
            But was:  2
                at LinkAll.Layout.ClassLayoutTest.AutoLayoutClass() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/ClassLayoutTest.cs:line 73

        [FAIL] DefaultLayoutClass :   Length
            Expected: 1
            But was:  2
                at LinkAll.Layout.ClassLayoutTest.DefaultLayoutClass() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/ClassLayoutTest.cs:line 57
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge bc668916e7 [tests] Ignore linkall's DataContractTest in .NET due to a linker bug.
Ref: https://github.com/mono/linker/issues/1460

Fixes this test failure:

    LinkAll.Serialization.DataContract.DataContractTest
        [FAIL] Flags : System.NullReferenceException : Object reference not set to an instance of an object
            at System.Runtime.Serialization.CodeGenerator.VerifyParameterCount(MethodInfo methodInfo, Int32 expectedCount)
            at System.Runtime.Serialization.CodeGenerator.Call(Object thisObj, MethodInfo methodInfo, Object param1, Object param2)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue, Type memberType, Boolean writeXsiType)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteValue(LocalBuilder memberValue, Boolean writeXsiType)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteMembers(ClassDataContract classContract, LocalBuilder extensionDataLocal, ClassDataContract derivedMostClassContract)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteClass(ClassDataContract classContract)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.GenerateClassWriter(ClassDataContract classContract)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.GenerateClassWriter(ClassDataContract classContract)
            at System.Runtime.Serialization.ClassDataContract.CreateXmlFormatWriterDelegate()
            at System.Runtime.Serialization.ClassDataContract.get_XmlFormatWriterDelegate()
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
            at LinkAll.Serialization.DataContract.DataContractTest.ToXml[TestClass](TestClass obj) in [...]/xamarin-macios/tests/linker/ios/link all/DataContractTest.cs:line 35
            at LinkAll.Serialization.DataContract.DataContractTest.Flags() in [...]/xamarin-macios/tests/linker/ios/link all/DataContractTest.cs:line 73
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 3940df936b [tests] Exclude test case in linkall's InterfacesTest.Bug10866 test due to a bugfix in the linker.
Ref: https://github.com/mono/linker/issues/1459
Ref: https://github.com/xamarin/xamarin-macios/issues/9566

Fixes this test failure:

    LinkAll.Interfaces.InterfaceTest
        [FAIL] Bug10866 :   B::Bar
            Expected: null
            But was:  <Void Bar()>
                at LinkAll.Interfaces.InterfaceTest.Bug10866() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/InterfacesTest.cs:line 91
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge bdb91f9272 [tests] Update linkall's CommonLinkAllTest.TypeConverter_Custom to take into account that .NET will generate assembly attributes by default.
Fixes this test failure:

    LinkAll.CommonLinkAllTest
        [FAIL] TypeConverter_Custom :   ConverterTypeName
            String lengths are both 88. Strings differ at index 43.
            Expected: "...nk all, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
            But was:  "...nk all, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            ------------------------------^
                at LinkAll.CommonLinkAllTest.TypeConverter_Custom() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 88
2020-09-01 13:29:05 +02:00