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
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.
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.
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 %)
* Change all XAMCORE_4_0 conditions to NET conditions.
* Add numerous Release attributes that xtro started complaining about.
* Misc other minor API changes/updates.
* 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>
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).
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.
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
* [tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags.
* [tests] Update mtouch tests according to mtouch changes.
* [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.
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.
* 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.
* [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.