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

10785 Коммитов

Автор SHA1 Сообщение Дата
Alexander Köplinger d7d69a6bf8
[dotnet][msbuild] Fix property for native http handler (#11388)
We were documenting the wrong name (fix in https://github.com/dotnet/runtime/pull/52055) which lead Sebastien to change it to the wrong one in 095b7e1105
2021-04-29 15:40:41 -04:00
Sebastien Pouliot 426d6d6bea
[tests][xtro] Fix catalyst changes with xcode12.5 RC (#11340)
xtro should soon be re-enabled and spot those on the (backport) PR
2021-04-29 10:14:05 -04:00
Sebastien Pouliot 8679482cc0
[dotnet] Fix release builds on devices (#11367)
Fixed by removal of
```
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
```
which is (should be) the default.

All our local usage compare with it with `true` so this likely comes from
somewhere else (sdk / runtime).

It does not really have a huge impact on build size (and the small diff
is probably the source of the crash)

* fails (17,479,981): https://gist.github.com/spouliot/6f8defb8f940e68314ba167ea76dc9bf
* works (17,502,741): https://gist.github.com/spouliot/d06f0b1b95e114fe469ce49081c70e33

Also fix target to run a release (no debug) build, which is more helpful
"out of the box" :)

Tracking issue with: https://github.com/xamarin/xamarin-macios/issues/11366
2021-04-29 09:44:14 -04:00
Rolf Bjarne Kvinge 174bafe9b0
[runtime] MapKit is available on macOS/arm64. (#11363) 2021-04-29 14:45:58 +02:00
Rolf Bjarne Kvinge fdd386b68f
[runtime] Remove dead code. (#11354)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 13:56:54 +02:00
Rolf Bjarne Kvinge d9ec37ca2d
[tests] Build a macOS/arm64 version of libtest. (#11364)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 13:41:52 +02:00
Mauro Agnoletti b4b8ee735c
Updated Xamarin.Messaging version (#11369)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 09:05:52 +02:00
Rolf Bjarne Kvinge ec7dc80b59
[tests] Add a bluetooth usage description to monotouch-test/macOS. (#11355)
This seems to be required when running monotouch-test with lldb (!) - no idea
why it doesn't fail otherwise.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 08:37:36 +02:00
Rolf Bjarne Kvinge 24cf0becd2
[generator] Improve performance for the printing inner loop. (#11365)
* Remove 1 array allocation per print statement.
* Remove 2 string concatenations per print statement.
* Don't indent empty lines.

For the generated code for watchOS, this is the difference (time-wise I wasn't
able to measure anything significant, although the memory savings are
significant):

Before:

    Allocation summary
           Bytes        Count  Average Type name
     535.485.544    7.115.025       75 System.String
     145.340.480    2.270.945       64 IKVM.Reflection.CustomAttributeData
     110.149.624    1.238.394       88 System.Char[]
    ...
    Total memory allocated: 1.793.323.536 bytes in 28.827.325d objects

After:

    Allocation summary
           Bytes        Count  Average Type name
     494.592.328    6.624.441       74 System.String
     145.340.480    2.270.945       64 IKVM.Reflection.CustomAttributeData
      99.345.984      968.303      102 System.Char[]
    ...
    Total memory allocated: 1.741.626.784 bytes in 28.066.650d objects

Difference:

    Allocation summary
           Bytes       Count  Average Type name
     -40.893.216    -490.584       -1 System.String
               0           0       64 IKVM.Reflection.CustomAttributeData
     -10.803.640    -270.091      +14 System.Char[]
    ...
    Total memory allocated: -51.696.752 bytes in -760.675 objects

This was measured by executing the following in an already built working copy:

    /Library/Frameworks/Mono.framework/Versions/Current/bin/mono --profile=log:nocalls,alloc --debug build/common/bgen.exe @build/watchos.rsp

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 07:54:21 +02:00
Manuel de la Pena a4426e8a5c
[CI] Unblock the CI by using our own channel for provisionator. (#11368) 2021-04-28 16:22:22 -04:00
Rolf Bjarne Kvinge e818c99bc8
[NSObject] Don't call into Objective-C (the Description property) for disposed objects. (#11353)
Calling into Objective-C for disposed objects may crash, and calling ToString
shouldn't crash.
2021-04-28 07:42:35 +02:00
Rolf Bjarne Kvinge 8cb8fd9a32
[dotnet] Fix casing for ARM64 architecture. (#11350) 2021-04-28 07:41:35 +02:00
Rolf Bjarne Kvinge a01a96a407
[runtime] Implement xamarin_[get|set]_flags_for_nsobject. (#11347) 2021-04-28 07:40:43 +02:00
Rolf Bjarne Kvinge 2b0a9f5bc1
[CoreCLR] Implement xamarin_get_nsobject_handle. (#11346) 2021-04-28 07:34:57 +02:00
Rolf Bjarne Kvinge e4960ad9e3
[dotnet] Build the partial static registrar for CoreCLR. (#11345)
* The generated static registration code will eventually be different.
* The generated code has to be compiled with different compiler flags.

This also required adding a new overload of xamarin_mono_object_release for the generated
code to compile.
2021-04-28 07:34:40 +02:00
Manuel de la Pena a1a5c01935
[Xharness] Fix the test selector. (#11315)
Fix the tests selector by setting the PR number in an env variable that
is not longer linked with Jenkins.

Fixes #11299
2021-04-27 09:23:21 -04:00
Rolf Bjarne Kvinge 43f1d02dae
[CoreCLR] Implement xamarin_gchandle_get_target. (#11333)
This also meant reviewing calling code to make sure that MonoObject*s are
released when they should be, which meant reviewing every method that returns
a MonoObject*, and release the result.
2021-04-27 14:59:03 +02:00
Sebastien Pouliot cd4e5b543e
[videotoolbox] Update for dotnet attributes (#11342)
and ajust xtro for unavbailable Catalyst API
2021-04-27 08:43:59 -04:00
Peter Collins b88c3bb031
[build] Create Microsoft.iOS.Windows.Sdk workload pack (#11251)
Converts the Microsoft.iOS.Windows.Sdk NuGet package into a proper
[workload SDK pack][0].  The entry point for this pack has been changed,
and it is now imported through the `WorkloadManifest.targets` file
included in `Microsoft.NET.Workload.iOS`, rather than being imported
directly from `Microsoft.iOS.Sdk`.

Import ordering has otherwise changed slightly.  The following files are
now imported before the majority of the `Microsoft.iOS.Sdk` (and the 
majority of the .NET SDK targets):

 * Xamarin.iOS.Common.Before.props
 * Xamarin.iOS.Common.Before.targets

After this the majority of the .NET SDK targets will load, followed by
the `Microsoft.iOS.Sdk` targets. Finally, everything declared in the
`<AfterMicrosoftNETSdkTargets/>` hook loads, which consists of:

 * Microsoft.iOS.Windows.Sdk.targets
 * tools/msbuild/*

[0]: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md#sdk-packs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-04-27 07:44:51 +02:00
Manuel de la Pena 5de96fd9f8
[CI] Continue on error when we cannot publish a nuget. (#11336) 2021-04-26 18:45:49 -04:00
Marius Ungureanu b930f9cce9
Make NSWindow appearanceSource null allowed (#11334)
Native headers show it's null_resettable.

```objc
/// If set, the receiver will inherit the appearance of that object, as well as use KVO to observe its effectiveAppearance for changes. Typically this is used for child windows that are shown from a parent window or specific view. Defaults to NSApp.
@property (weak, null_resettable) NSObject<NSAppearanceCustomization> *appearanceSource API_AVAILABLE(macos(10.14));
```
2021-04-26 18:02:25 -04:00
Manuel de la Pena 99fa931a27
[CI] Fix nuget messaging in case of failure. (#11335) 2021-04-26 13:29:24 -04:00
Manuel de la Pena 9ff88c19a1
[CI] Workaorund misconfig pools. (#11323)
For some reason, some of the internal hosted pools have been set without
the OS version (WRONG WRONG). The simples way is to allow to skip this
check in those pools over re-configuring all bots.

'We can lick gravity, but sometimes the paperwork is overwhelming.'
2021-04-26 10:22:29 -04:00
Manuel de la Pena 52ae1dd1da
[CI] Fix mac tests provisioning. (#11324) 2021-04-26 10:21:14 -04:00
Emanuel Fernandez Dell'Oca 7415b898f8
[dotnet] Sets missing ILLink parameter from Windows (#11319)
This was making the linker to not behave correctly, and apps were crashing on the simulator.
2021-04-26 10:06:34 +02:00
Rolf Bjarne Kvinge 7b5a1c251c
[runtime] There's no need to attach/detach the current thread in CoreCLR. (#11307) 2021-04-26 07:46:55 +02:00
Alex Soto 1f65e8bdca [Versions] Bump version after d16-10 branch creation 2021-04-25 22:20:21 -04:00
Manuel de la Pena fee57615f9
[CI] Add the context in the failed device bots. (#11318) 2021-04-24 06:46:09 -04:00
Manuel de la Pena 541bfded17
[Maccore] Bump maccore to the latests. (#11312)
Commits:

* [Xamarin.Hosting] Show installation progress for higher verbosity (#2424) cddbd1915d

Full diff: d11721f55e..cddbd1915d
2021-04-23 17:25:52 -04:00
Manuel de la Pena 26d64a1a24
[CI] Unify both failing statuse. (#11311) 2021-04-23 16:45:59 -04:00
Rolf Bjarne Kvinge 5d42c933f1
[runtime] Move xamarin_create_managed_ref internal call to managed code. (#11271)
Move the xamarin_create_managed_ref internal call to managed code, to ease things
with CoreCLR.

In order to preserve performance, this wasn't a straight forward port.

* monotouch_create_managed_ref used to detect if there already was a GCHandle for
  a native object. To avoid a managed->native transition, this logic has now been
  moved into the code that sets the GCHandle (the xamarinSetGCHandle🎏 / xamarin_set_gchandle_trampoline
  code), and these methods return a value saying whether the GCHandle was set or
  not.

* xamarin_create_gchandle will check the retain count to determine whether to create
  a weak or a strong GCHandle for the managed object. In this particular case we
  should never need to create a strong GCHandle, which means that we don't need to
  check the retain count (saving a managed->native transition).

Using the new perftest (#11298), I get very similar numbers for both old code and new code: https://gist.github.com/rolfbjarne/e0fc2ae0f21da15062b4f051138679af (multiple runs). Sometimes the old code is faster, sometimes the new code is faster (although the old code tends to be the one who wins).

In any case there aren't any significant performance hits due to this change, so it should be good to go.
2021-04-23 18:42:11 +02:00
Emanuel Fernandez Dell'Oca 9afd2aa300
[msbuild] Fixes DebugType for VS (#11297)
We stopped converting full pdbs to mdbs on Windows, so we need to override the `DebugType` property to `portable` if it's `full`, otherwise the debugger won't work from Visual Studio.
2021-04-23 15:55:05 +02:00
Emanuel Fernandez Dell'Oca b4afe27f75
[msbuild] Removes explicit Mqtt dependency (#11302)
There were 2 "problems":
1- Messaging depends on `System.Net.Mqtt` and not in `System.Net.Mqtt.Server`. It still worked because the latter depends on the former package, but we were restoring unnecessary dependencies.
2- We don't need an excplicit reference, since `Xamarin.Messaging.Build.Client` already depends on it, and by removing it we avoid having another dependency to keep up to date.
2021-04-23 15:53:36 +02:00
Rolf Bjarne Kvinge d15f683500
[tests] Add a performance test using BenchmarkDotNet. (#11298) 2021-04-23 13:29:06 +02:00
Jonathan Peppers b1080ee9bf
[catalyst] remove splash screens (#11300)
Context: https://github.com/dotnet/maui/pull/807

When implementing a new `@(MauiSplashScreen)` feature for .NET MAUI, I
found out that Catalyst doesn't have support for splash screens.

I even tested this in Xcode:

* Create a new Objective-C iOS app
* Make `LaunchScreen.storyboard` red and `Main.storyboard` green.
* Check the new `macOS` checkbox in project settings to enable
  Catalyst and be a multiplatform app.

I see red, then green on iOS but only green on macOS. I think Catalyst
completely ignores `UILaunchStoryboardName`.

This removes splash screens from the `dotnet new maccatalyst` template
as well as the `MyCatalystApp` sample project.
2021-04-23 07:38:05 +02:00
Sebastien Pouliot 095b7e1105
[dotnet] Enable more trimming switches (#11295)
Documentation
https://github.com/dotnet/runtime/blob/main/docs/workflow/trimming/feature-switches.md

Very small effect on the final app size.

Before
https://gist.github.com/spouliot/9f6fa4f15c117149905141f80fbad399

After
https://gist.github.com/spouliot/c9cefac8aa77c8c68edb9bbc77f553d0
2021-04-22 20:37:02 -04:00
Manuel de la Pena 9c2ca9ccf5
[CI] Add triggers for new release branches. (#11303) 2021-04-22 18:50:47 -04:00
Sebastien Pouliot 94caf968cc
Bump Touch.Unit to fix/report silently skipped fixtures (#11294)
Commit list for spouliot/Touch.Unit:

* spouliot/Touch.Unit@be72947 Report the reason why a fixture is being skipped by the runner
* spouliot/Touch.Unit@c3ac172 Fix grammar in comment. (#101)

Diff: f19eb45cb6...be7294761e
2021-04-22 15:33:04 -04:00
Rolf Bjarne Kvinge a3613a187f
[tools] Fix a typo in the error message for MX2301 that caused a format exception. (#11291)
Makes this error show properly:

> error MM2301: The linker step 'Setup' failed during processing: This version of {0} requires the {1} {2} SDK (shipped with Xcode {3}). Either upgrade Xcode to get the required header files or use the dynamic registrar or set the managed linker behaviour to Link Platform or Link Framework SDKs Only in your project's Mac Build Options > Linker Behavior} (to try to avoid the new APIs).. String.Format failed! Arguments were: "Microsoft.macOS" "macOS" "11.3" "12.5". Please file an issue to report this incorrect error handling.
2021-04-22 20:51:58 +02:00
Manuel de la Pena 196b4fa371
[CI] Fix pwsh. (#11296) 2021-04-22 14:01:02 -04:00
Rolf Bjarne Kvinge 0924ce55ef
Remove dead code. (#11289) 2021-04-22 16:03:05 +02:00
Filip Navara be14188892
Use the SDK UseMonoRuntime property instead of _XamarinRuntime in MSBuild (#11255)
* Use the SDK UseMonoRuntime property instead of _XamarinRuntime in MSBuild

* Fix typo

* Update Xamarin.Shared.Sdk.targets

Mono -> MonoVM
2021-04-22 16:02:56 +02:00
Sebastien Pouliot bbee8a0a57
[tests][link all] Fix nunit silent exception causing some tests not to be enabled (#11287)
This exposed a few tests that are failing on dotnet (adjusted or fixed)
Also fix a typo in an exception message in `src/ObjCRuntime/PlatformAvailability.cs`
and a build warning in `tests/common/TestRuntime.cs`

Fix part of https://github.com/xamarin/xamarin-macios/issues/11243
And allows enabling the tvOS/dotnet link all tests
2021-04-22 09:14:33 -04:00
Rolf Bjarne Kvinge add11fbe39
[mmp] Use the resolver (and configure it correctly) when using --runregistrar. (#11288)
* Extract the code we use to configure the assembly resolver during a normal
  mmp run to make it usable for --runregistrar.
* Configure the assembly resolver we use for --runregistrar.
* Pass the assembly resolver to the registrar so that it's actually used.
* Adjust the System.Void lookup to look everywhere even if we find a corlib,
  since behavior changes a bit now that we're using an assembly resolver:
	* Previous behavior:
		1. In .NET mode, look for a corlib named System.Private.CoreLib, and fail to find it.
		2. Look in all the loaded assemblies for System.Void (and find it in System.Runtime.dll).
	* Broken behavior as a result of the resolver changes:
		1. Find corlib as System.Private.CoreLib.dll
		2. Fail to find System.Void in System.Private.CoreLib.dll, since we'd only look in corlib.
	* New behavior
		1. Find corlib as System.Private.CoreLib.dll
		2. Fail to find System.Void in System.Private.CoreLib.dll, but find it in System.Runtime.dll,
		   since we're now looking in all the loaded assemblies.

This is required to make VSMac's usage of --runregistrar
2021-04-22 14:47:47 +02:00
Emanuel Fernandez Dell'Oca 965ab98b84
[msbuild] Fixes archiving and copying files to Windows (#11277)
* [msbuild] Fixes Windows task namespace

* [msbuild] Fixes unzipping files from Windows

This is the same approach we're using on the Xamarin.iOS.Tasks project, we need to replace the System.Text.Encoding.CodePages reference assembly by it's runtime implementation before ilmerging it, otherwise when trying to unzip files from Windows we'll get a null ref exception because that's what the ref assembly implemented.

* [msbuild] Try to copy output to Windows before ending the XMA connection

When relying on BuildDependsOn we can end up running the targets after _SayGoodBye, which ends the XMA connection. `CopyDSYMFromMac` and `CopyAppBundleFromMac` need an active connection, since both copy files from the Mac to Windows.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-22 12:02:38 +02:00
Rolf Bjarne Kvinge 94ca4e7a03
[ObjCRuntime] Print to stderr if using xamarin_log fails. Fixes #11239. (#11262)
* [ObjCRuntime] Print to stderr if using xamarin_log fails. Fixes #11239.

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

* Update xtro.
2021-04-22 11:57:41 +02:00
Rolf Bjarne Kvinge e2082fd04c
[CoreCLR] Implement mono_jit_exec. (#11264)
This required adding a helper method to get the assembly name for a given
MonoAssembly, since that's what CoreCLR uses to determine what to execute.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-22 07:46:56 +02:00
Manuel de la Pena 25715b8b5f
[CI] Remove duplicated status. (#11274) 2021-04-21 21:34:27 -04:00
Mauro Agnoletti 8f0dffebfc
Updated Xamarin.Messaging version (#11245) 2021-04-21 21:34:07 -04:00
Peter Collins 7a5c28f6cc
[msbuild] Rename $(_UsingXamarinSdk) to $(UsingAppleNETSdk) (#11270)
The `$(_UsingXamarinSdk)` property has been renamed to help improve
external usability.  This change increases parity with the Android SDK,
which currently defines `$(UsingAndroidNETSdk)` for internal and
external use.
2021-04-21 21:32:33 -04:00