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

12487 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 0e4392624e
[.NET/AppKit] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the managed callbacks called from native code. (#13554)
Ref: https://github.com/xamarin/xamarin-macios/issues/10470.
2021-12-14 17:04:52 +01:00
Rolf Bjarne Kvinge ed1c769017
[tests] Remove dead code from test that's already ignored (#13555) 2021-12-14 17:04:17 +01:00
Manuel de la Pena bffe61eec2
[CI] Fix indentation mistake that made timeouts result in errors. (#13552) 2021-12-14 09:27:40 -05:00
Manuel de la Pena 97ca13a358
[CI] Do not use the ciBuild tag for cronjobs. (#13553)
The tag is used by the release pipeline to indentify builds that we can
release from. This will ensure we do not get releases from the cronjobs.
2021-12-14 09:27:18 -05:00
Rolf Bjarne Kvinge a93d76304e
[src] Modify some logic for Mac Catalyst that tests the current runtime architecture (Runtime.Arch) to behave like macOS instead (which doesn't check Runtime.Arch). (#13536) 2021-12-14 08:26:14 +01:00
Rolf Bjarne Kvinge 7b753916d8
[dotnet-linker] We must store the availability attributes when linking. (#13547)
We must store the availability attributes when linking, so that the registrar
can access them when the linker is done linking the app.

Fixes this test failure:

* Xamarin.Registrar.MT4162_dotnet(iOS,"iOS",LinkAll)

Ref: https://github.com/xamarin/xamarin-macios/issues/13517
2021-12-14 08:20:05 +01:00
Rolf Bjarne Kvinge ce7e49d9df
[dotnet-linker] Touch the build output to avoid make confusion. (#13549)
Make gets confused sometimes if running a rule doesn't update the timestamp of
the target of those rules (and make may in certain cases end up with an
infinite loop).

Avoid this by making sure to always update the timestamp of the
dotnet-linker.dll we build, even if MSBuild decides no re-compilation was
necessary.
2021-12-14 08:19:41 +01:00
Rolf Bjarne Kvinge c708eba312
[runtime] Make sure dlls come before exes in TRUSTED_PLATFORM_ASSEMBLIES. (#13545)
This works around dotnet/runtime's https://github.com/dotnet/runtime/issues/62735.
2021-12-14 08:18:47 +01:00
Rolf Bjarne Kvinge f348e045a1
[AVFoundation] Fix typo in attribute name and add missing availability attributes. (#13548) 2021-12-14 08:11:23 +01:00
Rolf Bjarne Kvinge d0f33c7931
[msbuild] Fix merging of apps with symlinks to directories. (#13546)
Symlinks to directories are treated the same as other symlinks (as files), not
as directories. This way we don't end up re-creating a directory hierarchy
when we only have to create a symlink.
2021-12-14 08:10:23 +01:00
Rolf Bjarne Kvinge 2f33f5b020
[CFNetworkHandler] Only use public API to set cookies in CookieContainers. Fixes #8072. (#13535)
https://github.com/xamarin/xamarin-macios/issues/8072
2021-12-14 08:08:02 +01:00
Rolf Bjarne Kvinge c85d7721d5
[dotnet] Pass -dead_strip to the native linker when we can. (#13541)
Pass -dead_strip to the native linker like we do for legacy Xamarin:

* If there are no custom linker arguments.
* If all third-party bindings in the app has SmartLink = true (this doesn't
  show up in the PR, but the logic exists for legacy Xamarin and is already
  executed for .NET, the resulting Application.DeadStrip value just wasn't
  taken into account).

This shrinks the app size a bot for a Hello World app:

* Before:     10.659.731 (https://gist.github.com/rolfbjarne/b5892a5c7fb8663d38e2b69f67bce90c)
* After:       9.940.240 (https://gist.github.com/rolfbjarne/8404394180fb9971bd2f1475b747c70a)
* Difference:   -719.491 (-6.7 %)
2021-12-13 20:41:43 +01:00
Rolf Bjarne Kvinge c93cd3a99c
[Metal] Usher the Metal API into the golden age of .NET. (#13533)
* Change all XAMCORE_4_0 conditions to NET conditions.
* Add numerous Release attributes that xtro started complaining about.
* Misc other minor API changes/updates.
2021-12-13 20:40:29 +01:00
dotnet-maestro[bot] afe1b85031
[main] Update dependencies from dotnet/installer (#13505)
* Update dependencies from https://github.com/dotnet/installer build 20211206.5

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.101-servicing.21606.5

* Update dependencies from https://github.com/dotnet/installer build 20211207.22

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.102-servicing.21607.22

* Update dependencies from https://github.com/dotnet/installer build 20211208.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.102-servicing.21608.3

* Update dependencies from https://github.com/dotnet/installer build 20211209.9

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.102-servicing.21609.9

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-13 15:42:49 +01:00
Rolf Bjarne Kvinge b8e9c61409
[dotnet] Parse the -gcc_flags and -link_flags mtouch/mmp arguments and pass them to the native linker. (#13521) 2021-12-13 08:33:26 +01:00
Rolf Bjarne Kvinge bc65a52227
[CoreMidi] Fix detecting whether MIDIPacket needs alignment for macOS and Mac Catalyst on ARM64. (#13534) 2021-12-13 08:31:11 +01:00
Manuel de la Pena bf26c64e72
[CI] Add missing import directive. (#13537) 2021-12-11 14:25:24 -05:00
Manuel de la Pena dee9381b4b
Revert "[CI] Use Build artifacts so that they are copied to the release pipeline. (#13501)" (#13538)
This reverts commit 3977d7531d.
2021-12-11 14:25:14 -05:00
Rolf Bjarne Kvinge e5ace3d345
[generator] Generate the same invoke code for Mac Catalyst like we already do for macOS. (#13513)
This makes the generated code much smaller, and also avoids calling Runtime.Arch for Mac Catalyst.

Also don't generate a dual arch-specific call unless needed (this makes the generated code *much* smaller).
2021-12-10 17:36:55 +01:00
Manuel de la Pena 9a07446244
[CI] Add a better comment when we add code in the static page. (#13528) 2021-12-10 08:25:09 +01:00
Manuel de la Pena 5c4db77a15
[CI] Increase timeouts so that we do not have failures. (#13529)
We have added more files and the API seems to take long sometimes,
increase the timeouts to avoid failures like in https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5532523&view=logs&j=704af8c3-a112-593d-cee6-636e1ea22709&t=62b5d5ee-dc4f-530c-7279-a3bef6bd6bc7
2021-12-10 08:24:42 +01:00
Marek Safar c3943dbe58
Enable AggressiveAttributeTrimming (#13523)
This enables removing all kinds of infrastructure attributes for example SupportedOSPlatformAttribute (like old XI did).
2021-12-10 08:23:10 +01:00
Rolf Bjarne Kvinge aa3a17dfc9
[tests] Update the MT4162_dotnet to use new-style .NET availability attributes. Fixes #13517. (#13519)
Fixes https://github.com/xamarin/xamarin-macios/issues/13517.
2021-12-10 08:10:59 +01:00
Rolf Bjarne Kvinge f6ae27215f
[CoreImage] Update CIFilter API for .NET. (#13524) 2021-12-10 08:08:00 +01:00
Rolf Bjarne Kvinge 678a22c889
[src] Tweak makefile to try to avoid confusing make. (#13525)
Make can get confused if a rule doesn't update the timestamp of a target file,
so make sure the target file's timestamp is updated in a few cases.

This hopefully fixes an infinite loop inside parallel make I've been running into.
2021-12-10 08:04:18 +01:00
Rolf Bjarne Kvinge ec94be597e
Use the '.NET 6 MAUI' channel for dotnet/runtime bits. (#13504)
We are in a situation where:

1. .NET MAUI is still in preview
2. We need dotnet/runtime fixes for MAUI, but we don't necessarily want all fixes to go into the .NET 6 service release.

The solution is to simplify use different builds/packs from dotnet/runtime.

Ref: https://github.com/xamarin/xamarin-android/pull/6542
2021-12-10 07:43:03 +01:00
Manuel de la Pena 45340e80f7
[Tests] Fix the retrieval of variables in .Net after quotes were added. Fixes #13516 (#13522)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-09 20:28:35 -05:00
Rolf Bjarne Kvinge a94e575806
[tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags. (#13509)
* [tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags.

* [tests] Update mtouch tests according to mtouch changes.
2021-12-09 17:16:45 +01:00
Rolf Bjarne Kvinge 169b851e63 [link sdk] Update test to work on macOS as well. 2021-12-09 16:08:47 +01:00
Rolf Bjarne Kvinge 52072f02e7 [link sdk] Update test according to recent dotnet/runtime changes. 2021-12-09 07:55:51 +01:00
Rolf Bjarne Kvinge cbc16a5c99
[AppKit] Fix unintentional breaking change in NSTextViewDelegate.DraggedCell. (#13507)
I inversed the .NET conditional logic, thus keeping the old behavior for .NET
and making legacy have the new behavior.
2021-12-09 07:44:26 +01:00
Rolf Bjarne Kvinge 15a7216aa8
[ObjCRuntime] Remove deprecated availability attribute API from .NET. (#13433)
* [ObjCRuntime] Remove deprecated availability attribute API from .NET.

They're quite useful for binding code though, so instead of removing them completely,
make them binding-only attributes (like numerous other binding attributes we have)
for .NET.

* [src] Remove removed attributes from the list of attributes that should be removed by the linker.

* [tests] Update tests to not use the old attributes for .NET.
2021-12-09 07:41:07 +01:00
Manuel de la Pena eb7bb62b6b
[CI] Check that the mac tests are indeed present. (#13510)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-08 17:14:19 -05:00
Manuel de la Pena 94b75d71c0
[CI] Ensure that we do have quotes in a variable with several values. (#13511) 2021-12-08 17:13:26 -05:00
Rolf Bjarne Kvinge b3c6218c5f
[msbuild] Improve logic to clean up the app bundle for macOS and Mac Catalyst apps before signing. (#13479)
There can't be any files in the root directory of the app bundle for macOS and
Mac Catalyst, otherwise code signing will fail. The problem is that Mono will
create a crash report in the current directory if the process crashes, and the
current directory is the root directory of the app bundle, which means that if
running an app crashes, the next build will likely fail because of the crash
report.

We had logic to detect this and remove any crash reports, but our crash report
detection pattern wasn't good enough and let some files through. This PR
updates that pattern, and also improves the code to report warnings for any
other files in the app bundle's root directory.
2021-12-07 21:33:22 +01:00
Rolf Bjarne Kvinge 6db2ef0d90
[msbuild] Enable nullable code for the Ditto task (#13493) 2021-12-07 21:33:13 +01:00
Rolf Bjarne Kvinge 341d7aed9a
[src] Change some NSString API to take/return NativeHandle instead of IntPtr for .NET. (#13492)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-12-07 21:13:41 +01:00
Rolf Bjarne Kvinge 90b8e89859
[src] Remove System.nint and System.nuint from .NET. Fixes #10508. (#13490)
* Remove System.nint and System.nuint from .NET
* Add support for C#'s nint/nuint types to the generator.
* Accept IntPtr/UIntPtr as target types for BindAs attributes for NSNumber conversions.
* Fix a few APIs to take/return NativeHandle instead of IntPtr.

Fixes https://github.com/xamarin/xamarin-macios/issues/10508.
2021-12-07 21:12:46 +01:00
Rolf Bjarne Kvinge 39bdae2b7f
[monotouch-test] Ignore a few tests in non-ARM64 simulators. (#13487)
* [monotouch-test] Ignore a few tests in non-ARM64 simulators.

Some tests fail when running on an M1, but in a x64_86 mode, so just ignore
those unless we're running on ARM64 (this will currently exclude them on
x86_64 hardware too, but that'll eventually not be a problem anymore when
there's no more x86_64 hardware, and just checking for ARM64 is easier than
checking for x86_64 mode on an ARM64 CPU).

* Make more legacy projects unsafe.
2021-12-07 21:10:39 +01:00
Rolf Bjarne Kvinge cc75748c90 [builds] Download & install the Mono workload as well. 2021-12-07 20:59:52 +01:00
Manuel de la Pena aff9d1902c
[CI] Remove all macOS Mohave. (#13508) 2021-12-07 14:41:06 -05:00
Manuel de la Pena 3977d7531d
[CI] Use Build artifacts so that they are copied to the release pipeline. (#13501) 2021-12-07 12:11:08 -05:00
Rolf Bjarne Kvinge d0da8354cd Download the correct .NET runtime version. 2021-12-07 11:33:33 +01:00
Rolf Bjarne Kvinge 82e4345410 Use the '.NET 6 MAUI' channel for dotnet/runtime bits. 2021-12-07 10:26:22 +01:00
Rolf Bjarne Kvinge 2b7c6f8cb9
[generator] Fix typos in comment. (#13491) 2021-12-06 14:14:28 -05:00
Přemek Vysoký 27cd6f78c3
[xharness] Compare the `TestExecutingResult.TimedOut` flag only (#13498) 2021-12-06 14:13:47 -05:00
Manuel de la Pena 8ec686c333
[CI] If we could not create a gist do not throw an error. (#13483) 2021-12-03 17:41:29 -05:00
Manuel de la Pena d0f5e32862
[CI] Move to use the job not the stage. (#13495) 2021-12-03 13:36:33 -05:00
Rolf Bjarne Kvinge d7d2409dc0 [tests] Adjust cecil-tests according to nint/nuint changes. 2021-12-03 18:36:36 +01:00
Rolf Bjarne Kvinge 61b897e054 [xtro] Update. 2021-12-03 18:26:22 +01:00