This pull request updates the following dependencies
[marker]: <> (Begin:Coherency Updates)
## Coherency Updates
The following updates ensure that dependencies with a
*CoherentParentDependency*
attribute were produced in a build used as input to the parent
dependency's build.
See [Dependency Description
Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
[DependencyUpdate]: <> (Begin)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23328.3 to
8.0.0-preview.7.23359.2 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1 (parent: Microsoft.Dotnet.Sdk.Internal)
[DependencyUpdate]: <> (End)
[marker]: <> (End:Coherency Updates)
[marker]: <> (Begin:f9b68d84-9c90-4bd0-5499-08db4112d57e)
## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230710.1
- **Date Produced**: July 10, 2023 9:47:19 AM UTC
- **Commit**: 62ef57f1140e7fa71cf452542b263e7999cac168
- **Branch**: refs/heads/main
[DependencyUpdate]: <> (Begin)
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23329.2 to
8.0.100-preview.7.23360.1][31]
- **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1][32]
- **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23328.3 to
8.0.0-preview.7.23359.2][33]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1][32]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1][32]
[31]:
12bfecc01d...62ef57f114
[32]: cfae69f624...31106939ba
[33]:
c7b4724a7d...be566b1f4e
[DependencyUpdate]: <> (End)
[marker]: <> (End:f9b68d84-9c90-4bd0-5499-08db4112d57e)
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
Since NativeAOT generates native libraries and executables that do not
rely on assemblies they were compiled from, all managed assemblies can
be excluded from the application bundle.
This reduces the size of the application bundle by `3,17Mb` (or ~19%
compared to the baseline)
| MAUI ios app | Base | This PR | diff (%) |
|--------------|-----------|-----------|----------|
| SOD (Mb) | 50,13 | 41,93 | -16,3% |
| .ipa (Mb) | 16,59 | 13,43 | -19% |
Fixes: https://github.com/xamarin/xamarin-macios/issues/18472
This pull request updates the following dependencies
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23327.19 to 8.0.0-preview.7.23328.3 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.7.23321.3 to 8.0.0-preview.7.23326.1 (parent: Microsoft.NETCore.App.Ref)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23319.2 to 0.11.4-alpha.23327.1 (parent: Microsoft.NETCore.App.Ref)
## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230629.2
- **Date Produced**: June 29, 2023 11:33:10 AM UTC
- **Commit**: 12bfecc01dfa05c84102893928ddc3840f97bb70
- **Branch**: refs/heads/main
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23328.2 to 8.0.100-preview.7.23329.2][1]
- **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9][2]
- **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23327.19 to 8.0.0-preview.7.23328.3][3]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9][2]
- **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.7.23321.3 to 8.0.0-preview.7.23326.1][4]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9][2]
- **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23319.2 to 0.11.4-alpha.23327.1][5]
[1]: f6fa6a301f...12bfecc01d
[2]: f0b4bb9c62...cfae69f624
[3]: fca06e70ae...c7b4724a7d
[4]: e004a85d84...60a73f97a0
[5]: f449dc9923...3e46711f5a
Detect if a url we use in our tests actually works, and if not, save the
results and ignore any subsequent test that tries to use that url.
---------
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
This pull request updates the following dependencies
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23325.4 to 8.0.0-preview.7.23327.19 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5 (parent: Microsoft.Dotnet.Sdk.Internal)
## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230628.2
- **Date Produced**: June 28, 2023 10:48:59 AM UTC
- **Commit**: f6fa6a301f0e090d9a4dbebf0127a845bcd825f4
- **Branch**: refs/heads/main
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23326.3 to 8.0.100-preview.7.23328.2][1]
- **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5][2]
- **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23325.4 to 8.0.0-preview.7.23327.19][3]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5][2]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5][2]
[1]: fe40884b18...f6fa6a301f
[2]: eaa9717d90...f0b4bb9c62
[3]: b640052a0a...fca06e70ae
Closes#18356
In the static UnmanagedCallersOnly methods we don't know the generic
parameters of the type we're working with and we need to use this trick
to be able to call methods on the generic type without using reflection.
When we call a non-generic interface method implemented on a generic
class, the .NET runtime will resolve the generic parameters for us. In
the implementation of the interface method, we can simply use the
generic parameters and generate the same code we usually generate in the
UnmanagedCallersOnly callback method.
This is an example of the code we generate in addition to user code:
```csharp
internal interface __IRegistrarGenericTypeProxy__CustomNSObject_1__
{
void __IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (IntPtr p0);
}
public class CustomNSObject<T> : NSObject, __IRegistrarGenericTypeProxy__CustomNSObject_1__
where T : NSObject
{
[Export ("someMethod:")]
public void SomeMethod (T someInput)
{
// ...
}
// generated implementation of the proxy interface:
public void __IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
{
try {
var obj0 = (T) Runtime.GetNSObject<T> (p0);
SomeMethod (obj0);
} catch (Exception ex) {
*exception_gchandle = Runtime.AllocGCHandle (ex);
}
}
// generated registrar callbacks:
private static class __Registrar_Callbacks__
{
[UnmanagedCallersOnly (EntryPoint = "_callback_1_CustomNSObject_1_SomeMethod")]
public unsafe static void callback_1_CustomNSObject_1_SomeMethod (IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
{
var proxy = (__IRegistrarGenericTypeProxy__CustomNSObject_1__)Runtime.GetNSObject (pobj);
proxy.__IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (sel, p0, exception_gchandle);
}
}
}
```
```csharp
// regular non-generic class for comparison:
public class CustomNSObject : NSObject
where T : NSObject
{
[Export ("someMethod:")]
public void SomeMethod (NSSet someInput)
{
// ...
}
private static class __Registrar_Callbacks__
{
[UnmanagedCallersOnly (EntryPoint = "_callback_1_CustomNSObject_1_SomeMethod")]
public unsafe static void callback_1_CustomNSObject_1_SomeMethod (IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
{
try {
NSSet obj0 = Runtime.GetNSObject<NSSet> (p0);
SomeMethod (obj0);
} catch (Exception ex) {
*exception_gchandle = Runtime.AllocGCHandle (ex);
}
}
}
}
```
---------
Co-authored-by: Alex Soto <alex@alexsoto.me>
This pull request updates the following dependencies
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23324.1 to 8.0.0-preview.7.23325.4 (parent: Microsoft.Dotnet.Sdk.Internal)
## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230626.3
- **Date Produced**: June 26, 2023 10:09:12 PM UTC
- **Commit**: fe40884b18314b618457c61f59fe6b044deb4b33
- **Branch**: refs/heads/main
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23325.5 to 8.0.100-preview.7.23326.3][1]
- **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23324.1 to 8.0.0-preview.7.23325.4][2]
[1]: d2a244f560...fe40884b18
[2]: 213eb282fc...b640052a0a
For a given dylib named '/path/to/libMyLibrary.dylib', we pass this to the native linker:
-L/path/to -lMyLibrary
however, that doesn't work unless the dylib's name starts with 'lib'.
So detect this, and if the dylib doesn't start with 'lib' (say it's just
'MyLibrary.dylib'), then just pass the path to the dylib as-is to the native
linker:
/path/to/MyLibrary.dylib
Fixes https://github.com/xamarin/xamarin-macios/issues/15044.
This pull request updates the following dependencies
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.6.23316.5 to 8.0.0-preview.7.23324.1 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.6.23312.1 to 8.0.0-preview.7.23321.3 (parent: Microsoft.NETCore.App.Ref)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23312.1 to 0.11.4-alpha.23319.2 (parent: Microsoft.NETCore.App.Ref)
## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230625.5
- **Date Produced**: June 26, 2023 6:19:18 AM UTC
- **Commit**: d2a244f560b9f89387a5e748c19adf3114153f89
- **Branch**: refs/heads/main
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.6.23320.7 to 8.0.100-preview.7.23325.5][14]
- **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
- **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.6.23316.5 to 8.0.0-preview.7.23324.1][16]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
- **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.6.23312.1 to 8.0.0-preview.7.23321.3][17]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
- **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23312.1 to 0.11.4-alpha.23319.2][18]
[14]: 7a0bb9fd74...d2a244f560
[15]: 76da696f3f...eaa9717d90
[16]: 974d15e3b0...213eb282fc
[17]: 1640faa87e...e004a85d84
[18]: ad66dcb8a0...f449dc9923
This has a few advantages:
* A step towards simplifying the generator.
* A step towards being able to build binding projects on Windows, since it's easier
to build C# code in MSBuild using the Csc task rather than figuring out how to
call csc as an external program (which we've already done on macOS, but having
a single solution that works on all platforms is preferrable).
Note that this is only implemented for .NET, doing this for legacy Xamarin required a lot more work.
Added the following new checks:
```csharp
// dotnet_style_coalesce_expression = true
var v = x ?? y;
// dotnet_style_coalesce_expression = false
var v = x != null ? x : y; // or
var v = x == null ? y : x;
```
```csharp
// dotnet_style_null_propagation = true
var v = o?.ToString();
// dotnet_style_null_propagation = false
var v = o == null ? null : o.ToString(); // or
var v = o != null ? o.String() : null;
```
```csharp
// dotnet_style_prefer_is_null_check_over_reference_equality_method = true
if (value is null)
return;
// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if (object.ReferenceEquals(value, null))
return;
// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if ((object)o == null)
return;
```
Add support for using NativeAOT on all our platforms.
This contains numerous changes in a lot of places to add support for
NativeAOT:
* build logic
* runtime
* managed code
* tests
And it all pretty much consists of special-casing NativeAOT everywhere
we need to.
Note: NativeAOT doesn't work on macOS yet, because a dotnet/runtime fix
is required, and thus the corresponding test variations for
monotouch-test have been commented out.
This PR is best reviewed commit-by-commit.
This contributes towards https://github.com/xamarin/xamarin-macios/issues/17339.
We had to bump NUnitLite and Touch.Unit's TargetFramework properties to
net8.0-* (otherwise projects using NativeAOT fails if these projects are
referenced), which means they can't be used from .NET 7 (aka our .NET 7
tests).
So just don't reference NUnitLite and Touch.Unit in this test.
Detect if we're using a non-stable Xcode, and in that case produce packages
that show an error if they're used and the EnablePreviewFeatures flag isn't
enabled.
Also add logic to set this flag for our own build, otherwise all our tests
would fail.
This is the same as Android does.
Contributes towards https://github.com/xamarin/xamarin-macios/issues/18343.
This is because NativeAOT contains swift code, and we'd have to add code to
embed the Swift libraries in any apps that target early OS versions. We could
eventually implement this, but let's wait and see if there's a demand first.