From 6ee4d3e239de2eeda28ca18d029b397791a5bcbd Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 12 Aug 2022 13:56:58 +0000 Subject: [PATCH 01/11] Update dependencies from https://github.com/dotnet/installer build 20220812.1 Microsoft.Dotnet.Sdk.Internal From Version 7.0.100-rc.1.22409.23 -> To Version 7.0.100-rc.1.22412.1 Dependency coherency updates Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22411.2 (parent: Microsoft.Dotnet.Sdk.Internal --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9b014c04e76..cb747e03f4f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,16 +1,16 @@ - + https://github.com/dotnet/installer - 716bd17882e62abb008911461ea4ff5a75c26788 + 904aad05ed06249e590ed22c75ed0cfbd6064916 - + https://github.com/dotnet/linker - f09bacf09ef10b61cf9f19825f8782171a816dab + 81ffbb5af38a45ff60648999df8f35a79061ae43 - + https://github.com/dotnet/runtime - 26a71c61fbda229f151afb14e274604b4926df5c + 7be37908e5a1cbb83b1062768c1649827eeaceaa https://github.com/dotnet/emsdk diff --git a/eng/Versions.props b/eng/Versions.props index 4bf83b2c99c..f7da37add53 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,9 +1,9 @@ - 7.0.100-rc.1.22409.23 - 7.0.100-1.22377.1 - 7.0.0-rc.1.22403.8 + 7.0.100-rc.1.22412.1 + 7.0.100-1.22411.2 + 7.0.0-rc.1.22410.9 7.0.0-beta.22103.1 7.0.0-beta.22103.1 7.0.0-rc.1.22368.1 From f77c0fad5a5ec2f0d1edb219e8a25e98b7e7a74e Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 12 Aug 2022 09:15:26 -0500 Subject: [PATCH 02/11] Revert "export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=true" This reverts commit eefe470b13d690bfe15f614cb8fddb813cc5917e. --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index b283f85ba6e..952d405a564 100644 --- a/Makefile +++ b/Makefile @@ -38,9 +38,6 @@ endif export NO_SUDO ?= false -# Workaround: https://github.com/dotnet/sdk/issues/26965 -export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER = true - ifneq ($(NO_SUDO),false) _PREPARE_ARGS += --auto-provisioning-uses-sudo=false endif From a64274d128b730decf7d61e5d957e2cef68de566 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 12 Aug 2022 09:15:48 -0500 Subject: [PATCH 03/11] Revert "DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=true in yaml?" This reverts commit 3f3c9c0c95ee36d312f857f2ea4513f99eb54d46. --- build-tools/automation/yaml-templates/variables.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 6a9356215d6..558930e11db 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -35,6 +35,3 @@ variables: value: net7.0 - name: DotNetStableTargetFramework value: net6.0 -# Workaround: https://github.com/dotnet/sdk/issues/26965 -- name: DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER - value: true From 303f41f16abebd390654b1d571982c0831777e27 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 12 Aug 2022 14:02:02 -0500 Subject: [PATCH 04/11] Include `marshal-ilgen` Mono component by default Context: https://github.com/dotnet/runtime/pull/71203 Fixes: https://github.com/xamarin/xamarin-android/issues/7249 Apps on this PR currently crash with: mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in (wrapper managed-to-native) object:wrapper_native_0x7725af156f10 (intptr): IL_0012: calli 0x00000003 mono-rt : at System.Runtime.InteropServices.Marshal.PtrToStructureHelper(IntPtr , Object , Boolean ) mono-rt : at System.Runtime.InteropServices.Marshal.PtrToStructure(IntPtr , Type ) mono-rt : at Java.Interop.JniRuntime.CreateInvoker(IntPtr ) mono-rt : at Java.Interop.JniRuntime..ctor(CreationOptions ) mono-rt : at Android.Runtime.AndroidRuntime..ctor(IntPtr , IntPtr , Boolean , IntPtr , IntPtr , Boolean ) mono-rt : at Android.Runtime.JNIEnv.Initialize(JnienvInitializeArgs* ) Which, I assume is due to a missing Mono component. We should add the component by default: <_MonoComponent Condition=" '$(_IncludeMarshalIlGen)' != 'false' " Include="marshal-ilgen" /> In the future, someone could experiment by setting `$(_IncludeMarshalIlGen)` to `false`. --- .../targets/Microsoft.Android.Sdk.AssemblyResolution.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index 6318cd5f48f..4b2432f7419 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -198,6 +198,7 @@ _ResolveAssemblies MSBuild target. <_MonoComponent Condition=" '$(AndroidEnableProfiler)' == 'true' " Include="diagnostics_tracing" /> <_MonoComponent Condition=" '$(AndroidUseInterpreter)' == 'true' " Include="hot_reload" /> <_MonoComponent Condition=" '$(AndroidIncludeDebugSymbols)' == 'true' " Include="debugger" /> + <_MonoComponent Condition=" '$(_IncludeMarshalIlGen)' != 'false' " Include="marshal-ilgen" /> Date: Mon, 15 Aug 2022 12:39:47 +0000 Subject: [PATCH 05/11] Update dependencies from https://github.com/dotnet/installer build 20220814.7 Microsoft.Dotnet.Sdk.Internal From Version 7.0.100-rc.1.22409.23 -> To Version 7.0.100-rc.1.22414.7 Dependency coherency updates Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22412.1 (parent: Microsoft.Dotnet.Sdk.Internal --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cb747e03f4f..5e754ebce42 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,16 +1,16 @@ - + https://github.com/dotnet/installer - 904aad05ed06249e590ed22c75ed0cfbd6064916 + 1dc3340838d6a59dd1c83e7064358e3a42fb150c - + https://github.com/dotnet/linker - 81ffbb5af38a45ff60648999df8f35a79061ae43 + 95ea1842abc8634d1e98d995577c4202ad3fc5c5 - + https://github.com/dotnet/runtime - 7be37908e5a1cbb83b1062768c1649827eeaceaa + f52d8c59bb49360eb2cbeeb863c5856ebd62adda https://github.com/dotnet/emsdk diff --git a/eng/Versions.props b/eng/Versions.props index f7da37add53..c091f305d15 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,9 +1,9 @@ - 7.0.100-rc.1.22412.1 - 7.0.100-1.22411.2 - 7.0.0-rc.1.22410.9 + 7.0.100-rc.1.22414.7 + 7.0.100-1.22412.1 + 7.0.0-rc.1.22411.12 7.0.0-beta.22103.1 7.0.0-beta.22103.1 7.0.0-rc.1.22368.1 From bb0b5bc0e3abb99255743bf977de76b49e2c752a Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 15 Aug 2022 10:39:18 -0500 Subject: [PATCH 06/11] [illink] enable serialization discovery for the linker Context: https://github.com/dotnet/linker/pull/2929 Context: https://github.com/dotnet/linker/blob/6e8e139a484f74c524c821c7a4a08287d77257a4/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets#L227-L229 Fixes: https://github.com/xamarin/xamarin-android/issues/7256 Serialization heuristics in the .NET 7 linker is now opt-in. We now need to pass a new flag to the linker by default: <_ExtraTrimmerArgs>--enable-serialization-discovery $(_ExtraTrimmerArgs) This might also solve project builds in `Release` mode that appear to hang: Task "ILLink" (TaskId:272) Builds appear to be running this task and never exit. Let's hope this also solves this? --- .../targets/Microsoft.Android.Sdk.ILLink.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets index 8faee03ab31..3b1d24256d5 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets @@ -15,6 +15,7 @@ This file contains the .NET 5-specific targets to customize ILLink DependsOnTargets="GetReferenceAssemblyPaths;_CreatePropertiesCache"> true + <_ExtraTrimmerArgs Condition=" '$(_EnableSerializationDiscovery)' != 'false' ">--enable-serialization-discovery $(_ExtraTrimmerArgs) - 7.0.100-rc.1.22414.7 - 7.0.100-1.22412.1 + 7.0.100-rc.2.22417.1 + 7.0.100-1.22415.4 7.0.0-rc.1.22411.12 7.0.0-beta.22103.1 7.0.0-beta.22103.1 From 45d3f6fe824b95e3ec220e5513ca3b3ace40b97a Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 17 Aug 2022 11:48:32 -0500 Subject: [PATCH 10/11] Update .apkdesc files --- .../BuildReleaseArm64SimpleDotNet.apkdesc | 33 ++++--- .../BuildReleaseArm64XFormsDotNet.apkdesc | 95 ++++++++++--------- 2 files changed, 67 insertions(+), 61 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc index e96c7f00f43..068915f853b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc @@ -5,61 +5,64 @@ "Size": 3032 }, "assemblies/Java.Interop.dll": { - "Size": 58756 + "Size": 58665 }, "assemblies/Mono.Android.dll": { - "Size": 87933 + "Size": 87971 }, "assemblies/rc.bin": { - "Size": 1129 + "Size": 1182 }, "assemblies/System.Console.dll": { - "Size": 6401 + "Size": 6404 }, "assemblies/System.Linq.dll": { - "Size": 9083 + "Size": 9092 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 473290 + "Size": 462335 }, "assemblies/System.Runtime.dll": { - "Size": 2379 + "Size": 2375 }, "assemblies/UnnamedProject.dll": { - "Size": 3597 + "Size": 3560 }, "classes.dex": { "Size": 360744 }, + "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { + "Size": 96832 + }, "lib/arm64-v8a/libmonodroid.so": { "Size": 425336 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3084552 + "Size": 3052320 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723840 }, "lib/arm64-v8a/libSystem.Native.so": { - "Size": 92800 + "Size": 93032 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { "Size": 148696 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 9488 + "Size": 9784 }, "META-INF/BNDLTOOL.RSA": { "Size": 1213 }, "META-INF/BNDLTOOL.SF": { - "Size": 2570 + "Size": 2690 }, "META-INF/MANIFEST.MF": { - "Size": 2443 + "Size": 2563 }, "res/drawable-hdpi-v4/icon.png": { - "Size": 4791 + "Size": 4762 }, "res/drawable-mdpi-v4/icon.png": { "Size": 2200 @@ -83,5 +86,5 @@ "Size": 1904 } }, - "PackageSize": 2648031 + "PackageSize": 2664509 } \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc index 21c9b5ca0f6..8804f9c369c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc @@ -8,121 +8,121 @@ "Size": 7114 }, "assemblies/Java.Interop.dll": { - "Size": 66630 + "Size": 66533 }, "assemblies/Mono.Android.dll": { - "Size": 441986 + "Size": 441958 }, "assemblies/mscorlib.dll": { - "Size": 3849 + "Size": 3857 }, "assemblies/netstandard.dll": { - "Size": 5565 + "Size": 5570 }, "assemblies/rc.bin": { - "Size": 1129 + "Size": 1182 }, "assemblies/System.Collections.Concurrent.dll": { - "Size": 10477 + "Size": 10479 }, "assemblies/System.Collections.dll": { - "Size": 15298 + "Size": 15299 }, "assemblies/System.Collections.NonGeneric.dll": { - "Size": 7426 + "Size": 7429 }, "assemblies/System.ComponentModel.dll": { - "Size": 1930 + "Size": 1939 }, "assemblies/System.ComponentModel.Primitives.dll": { - "Size": 2541 + "Size": 2551 }, "assemblies/System.ComponentModel.TypeConverter.dll": { - "Size": 6022 + "Size": 6030 }, "assemblies/System.Console.dll": { - "Size": 7290 + "Size": 7294 }, "assemblies/System.Core.dll": { - "Size": 1973 + "Size": 1983 }, "assemblies/System.Diagnostics.TraceSource.dll": { - "Size": 6512 + "Size": 6549 }, "assemblies/System.dll": { - "Size": 2331 + "Size": 2340 }, "assemblies/System.Drawing.dll": { - "Size": 2016 + "Size": 2024 }, "assemblies/System.Drawing.Primitives.dll": { - "Size": 11967 + "Size": 11963 }, "assemblies/System.IO.Compression.dll": { - "Size": 16804 + "Size": 16658 }, "assemblies/System.IO.IsolatedStorage.dll": { - "Size": 9985 + "Size": 9991 }, "assemblies/System.Linq.dll": { - "Size": 19131 + "Size": 19133 }, "assemblies/System.Linq.Expressions.dll": { - "Size": 163892 + "Size": 163893 }, "assemblies/System.Net.Http.dll": { - "Size": 66008 + "Size": 65957 }, "assemblies/System.Net.Primitives.dll": { - "Size": 21947 + "Size": 21873 }, "assemblies/System.Net.Requests.dll": { - "Size": 3593 + "Size": 3599 }, "assemblies/System.ObjectModel.dll": { - "Size": 8095 + "Size": 8103 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 808082 + "Size": 769737 }, "assemblies/System.Private.DataContractSerialization.dll": { - "Size": 184896 + "Size": 184912 }, "assemblies/System.Private.Uri.dll": { - "Size": 42577 + "Size": 42214 }, "assemblies/System.Private.Xml.dll": { - "Size": 215501 + "Size": 215291 }, "assemblies/System.Private.Xml.Linq.dll": { - "Size": 16627 + "Size": 16633 }, "assemblies/System.Runtime.dll": { - "Size": 2573 + "Size": 2578 }, "assemblies/System.Runtime.Serialization.dll": { - "Size": 1939 + "Size": 1948 }, "assemblies/System.Runtime.Serialization.Formatters.dll": { - "Size": 2473 + "Size": 2477 }, "assemblies/System.Runtime.Serialization.Primitives.dll": { - "Size": 3751 + "Size": 3756 }, "assemblies/System.Security.Cryptography.dll": { - "Size": 7741 + "Size": 7785 }, "assemblies/System.Text.RegularExpressions.dll": { - "Size": 153702 + "Size": 153833 }, "assemblies/System.Xml.dll": { - "Size": 1827 + "Size": 1836 }, "assemblies/System.Xml.Linq.dll": { - "Size": 1846 + "Size": 1857 }, "assemblies/UnnamedProject.dll": { - "Size": 117278 + "Size": 117251 }, "assemblies/Xamarin.AndroidX.Activity.dll": { "Size": 5872 @@ -193,23 +193,26 @@ "classes.dex": { "Size": 3473216 }, + "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { + "Size": 96832 + }, "lib/arm64-v8a/libmonodroid.so": { "Size": 425336 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3084552 + "Size": 3052320 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723840 }, "lib/arm64-v8a/libSystem.Native.so": { - "Size": 92800 + "Size": 93032 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { "Size": 148696 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 98912 + "Size": 99208 }, "META-INF/android.support.design_material.version": { "Size": 12 @@ -323,13 +326,13 @@ "Size": 1213 }, "META-INF/BNDLTOOL.SF": { - "Size": 78859 + "Size": 78979 }, "META-INF/com.google.android.material_material.version": { "Size": 10 }, "META-INF/MANIFEST.MF": { - "Size": 78732 + "Size": 78852 }, "META-INF/proguard/androidx-annotations.pro": { "Size": 339 @@ -776,7 +779,7 @@ "Size": 470 }, "res/drawable-hdpi-v4/icon.png": { - "Size": 4791 + "Size": 4762 }, "res/drawable-hdpi-v4/notification_bg_low_normal.9.png": { "Size": 212 @@ -1964,5 +1967,5 @@ "Size": 341228 } }, - "PackageSize": 8008089 + "PackageSize": 7995895 } \ No newline at end of file From cf10bfe8affd7c82362aa85cfced815b6b6745bf Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 18 Aug 2022 08:37:16 -0500 Subject: [PATCH 11/11] [tests] ignore `WarnAboutAppDomains(true)` --- .../Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs index 144e5584e0f..530a3de0f07 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs @@ -182,6 +182,11 @@ public void PreserveCustomHttpClientHandlers () [Test] public void WarnAboutAppDomains ([Values (true, false)] bool isRelease) { + if (isRelease) { + // NOTE: trimmer warnings are hidden by default in .NET 7 rc1 + Assert.Ignore("https://github.com/dotnet/linker/issues/2982"); + } + var path = Path.Combine (Root, "temp", TestName); var lib = new XamarinAndroidLibraryProject { IsRelease = isRelease,