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

9417 Коммитов

Автор SHA1 Сообщение Дата
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
monojenkins ccc8f89d53 [d16-8] [SBApplication][Bug] SBApplication.FromBundleIdentifier<T> should return null when bundle ID is unknown (#9668)
* SB updates + tests

Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-09-18 18:19:23 -04:00
Manuel de la Pena 10d363faf5 Merge branch 'd16-8' into d16-8-xcode12 2020-09-18 18:04:32 -04:00
Manuel de la Pena eb9b690fe0 Merge xcode12 into d16-8. 2020-09-18 17:51:52 -04: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
monojenkins b51201ca91
[d16-8] [SBApplication][Bug] SBApplication.FromBundleIdentifier<T> should return null when bundle ID is unknown (#9668)
* SB updates + tests

Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-09-18 15:29:54 -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
monojenkins 15b87ca140
[Mono] Bump mono to match xamarin-android on be2226b (#9664)
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

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-09-17 20:53:25 -04:00
Manuel de la Pena 4028e53d98
[Cecil] Try to fix tests by stating the version in the console runner. (#9655)
Try to fix the issue by stating the version of the runner. This change
will not be needed when we merge with main.

fixes https://github.com/xamarin/maccore/issues/2315
2020-09-17 09:03:20 -04:00
Manuel de la Pena 615932d21e
[Tests]Fixed broken tests.sln. (#9656) 2020-09-17 08:01:00 -04:00
Rolf Bjarne Kvinge 2071a13aa4
[mtouch] Refactor how we detect and avoid broken frameworks when building for the simulator. (#9647)
* Use the existing information we have in the Frameworks class to determine
  whether a particular framework works in the simulator or not.
* Show a warning (MX5223) when we run into such a framework, but only if
  the linker is enabled (otherwise we'll often get warnings for API the developer
  doesn't use).
2020-09-17 13:31:29 +02: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
Manuel de la Pena 3e3111d44b
[Metal] Add missing GC.KeeAlive. (#9653)
Do it after the review comments on https://github.com/xamarin/xamarin-macios/pull/9651
2020-09-16 17:37:29 -04:00
Rolf Bjarne Kvinge 7ec3751a10
Bump Xamarin.iOS to 14.0. (#9646)
* Bump Xamarin.iOS to 14.0.

* Don't verify that the commit distances for Xamarin.iOS and Xamarin.Mac match unless we're building both of them.
2020-09-16 11:02:44 -04:00
monojenkins c8e056166b
[jenkins] Don't try to upload any packaged Xamarin.Mac tests if there aren't any or the failed to compile. (#9645)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-09-16 10:25:59 -04:00
Alex Soto bfc98f8059
[xcode12] Initial bump for Xcode 12 GM (#9644)
* [xcode12] Initial bump for Xcode 12 GM

* [tests][intro] We cannot load CoreNFC framework on iOS simulator anymore

* [tests][xtro] New Metal API are not abstract (before XAMCORE_4_0)

* [tests][intro] Fix crash when CSLocalizedString 'description' selector is called

* [tests][xtro] Add support for excluding platforms

Based on `Make.config` variables `INCLUDE_[IOS|TVOS|WATCH|MAC]`

This required moving some entries (common -> macOS) to keep the
sanitizer happy.

* [xtro] Ignore Intents watchOS differences since they will likely match iOS in the future

* Update to use Xcode 12 GMb instead of the old GM

* [tests][xtro] Remove OSLog for iOS and tvOS (changed in GM)

* [tests][msbuild] Disable FrameworkListTest based on the active/disabled platforms

* [tests][msbuild] Track new directory/file inside CoreML projects

* [mlaunch] Bump maccore and disable mlaunch if mac build is disabled

New commits in xamarin/maccore:

* xamarin/maccore@ba332d4d07 Disable mlaunch if Mac is not built (#2314)

Diff: 87a96d21c9..ba332d4d07

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2020-09-16 11:41:44 +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
Rolf Bjarne Kvinge a0797eb822
[jenkins] Fix version logic with macOS 11.0. (#9635)
Fix version logic with macOS 11.0 so that we don't compute all versions by
doing a range computation on the minor version only.

This makes it so that we run on older macOS bots again.

There are also a few other fixes for macOS 11.0.
2020-09-16 09:41:38 +02:00
monojenkins cd891d43ab
[xcode12] [Network] Add nullability support. (#9643)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-09-15 16:58:30 -04:00
monojenkins 5c06bddc93
[d16-8] [Bug] AVAudioSourceNodeRenderHandler delegate is incorrectly bound (#9624)
Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-09-15 15:04:37 -04: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
Sebastien Pouliot 9f7a57ec65
[xcode12][tests] Fix typos (#9640) 2020-09-15 13:09:18 -04:00
Sebastien Pouliot 25c361f43e
[xcode12][intro] Fix running introspection on old macOS versions (#9638)
Most fixes are inside Intents. Some types were not available on macOS
and marked as such, except it backfired.

* Adding `[NoMac]` on `XAMCORE_4_0` was fine
* Adding `[Obsolete]` outside `XAMCORE_4_0` was fine
* Removing the `[Mac (x,y)]` was not quite fine. It's true (since it was never on macOS) but removing it means it default to the oldest (10.9) macOS version we support. This is what the introspection tests were expecting.

Adding an `[Obsoleted (..., 10,0, ...)]` solve this.
2020-09-15 12:59:21 -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
Sebastien Pouliot a8c5216148
[xcode12] Introspection-based fixes for Big Sur (#9632) 2020-09-15 08:56:24 -04:00
Alex Soto 8383b14382
[xcode12] Rename master to main (#9631)
* Fix links that point to master to point to main instead.
* Implement support in the sample tester for specifying the default branch for
  each sample repo.
* Fix various text / documentation to say 'main' instead of 'master.'
* Push to 'main' instead of 'master' in xamarin-macios-data.
* Fix xharness to make 'main' the special branch with regards to documentation tests as opposed to 'master'.
* Fix various CI to use 'main' instead of 'master'.

This is a backport of PR #9561
2020-09-15 07:09:29 -04: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
monojenkins ee0516d46a
[Foundation] Fix NSUrl's implicit Uri operators. Fixes #9607. (#9611)
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.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-09-14 08:08:12 +02:00
Whitney Schmidt f12d9e7d4d
[Bug] AVAudioSourceNodeRenderHandler delegate is incorrectly bound (#9565)
* Fix binding
2020-09-11 16:41:42 -04:00
Manuel de la Pena 2147976458
[Metal] Update framework for xcode 12 beta 6. (#9569)
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-09-11 16:06:22 -04:00
Manuel de la Pena 5a9139bcd6
[AudioToolbox] Update API to xcode 12 beta 6. (#9603)
The most important changes in the API are ignored until we fix issue https://github.com/xamarin/xamarin-macios/issues/9602
2020-09-11 10:36:54 -04:00
Rolf Bjarne Kvinge 8cc314654f
[dotnet] Add support for the static registrar. (#9615) 2020-09-11 14:08:48 +02:00
Sebastien Pouliot c91b45162b
[xcode12][mediaplayer] Fix MPMusicPlayerController NowPlayingItem on recent iOS versions (#9619)
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.

backport of https://github.com/xamarin/xamarin-macios/pull/9604
reference: https://github.com/xamarin/xamarin-macios/issues/9578
2020-09-10 11:54:16 -04: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