Skip to content

Commit

Permalink
Bump to dotnet/installer@779a644 8.0.100-alpha.1.23070.23 (dotnet#7728)
Browse files Browse the repository at this point in the history
Changes: dotnet/installer@9962c6a...779a644
Changes: dotnet/linker@4b3f78c...c790896
Changes: dotnet/runtime@5da4a9e...ddb6988
Changes: dotnet/emsdk@66b9845...5b46122

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 8.0.100-alpha.1.23063.11 to 8.0.100-alpha.1.23070.23
* Microsoft.NET.ILLink.Tasks: from 8.0.100-1.23055.2 to 8.0.100-1.23067.1
* Microsoft.NETCore.App.Ref: from 8.0.0-alpha.1.23058.2 to 8.0.0-alpha.1.23070.1
* Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100: from 8.0.0-alpha.1.22620.1 to 8.0.0-alpha.1.23066.1

~~ Other Changes ~~

* Update `.apkdesc` files for app size changes.

* Use .jar files from the .NET runtime pack (dotnet#7665)

Since [dotnet/runtime#77386][0] has been merged, .NET will require
a certain class from  `libSystem.Security.Cryptography.Native.Android.jar`
that will be located in the runtime pack files.

[0]: dotnet/runtime#77386

* Disambiguate `.jar` files from Mono runtime packs.

We were getting the build error:

    error JAVA0000: Caused by: com.android.tools.r8.internal.f: Type net.dot.android.crypto.DotnetProxyTrustManager is defined multiple times

This `.jar` file is contained in each runtime pack (4 architectures)
gives us 4 `.jar` files!

We can pass in these files to the `<ProcessAssemblies/>` MSBuild task.

We also filter them based on `%(NuGetPackageId)`, so that any random
`.jar` file doesn't get added to `@(AndroidJavaLibrary)`.

I renamed the `IsFrameworkAssembly()` method to
`IsFromAKnownRuntimePack()` to make this more clear in the existing
code.

* Update `proguard_xamarin.cfg` for .NET 8.

Apps using `$(AndroidLinkTool)` of r8, now need to preserve:

    -keep class net.dot.android.crypto.DotnetProxyTrustManager { *; <init>(...); }

Otherwise we run into a crash when this type isn't present, such as:

    01-26 23:59:19.855  8684  8684 F DEBUG   :       #2 pc 00000000000191d6  /data/app/Mono.Android.NET_Tests-cpTzt8Q9KwgS-znzkuAdNQ==/split_config.x86_64.apk!libSystem.Security.Cryptography.Native.Android.so (offset 0xe7000) (JNI_OnLoad+31302) (BuildId: 7d9e4013a9dd99810070587ab42956703fef69f9)

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Šimon Rozsíval <[email protected]>
  • Loading branch information
3 people authored Jan 28, 2023
1 parent b18ad16 commit 35db527
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 67 deletions.
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-alpha.1.23063.11">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-alpha.1.23070.23">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>9962c6a686a31ba1e7c20983a810ba7989c3fc0c</Sha>
<Sha>779a6442daf6b95c5662d2f0c20801de5e179a05</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="8.0.100-1.23055.2" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="8.0.100-1.23067.1" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/dotnet/linker</Uri>
<Sha>4b3f78cbc7284b4198652a695e9fe0267133728e</Sha>
<Sha>c790896f128957acd2999208f44f09ae1e826c8c</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-alpha.1.23058.2" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-alpha.1.23070.1" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>5da4a9e919dcee35f831ab69b6e475baaf798875</Sha>
<Sha>ddb69889684da95dc8d83a51b987774de5e47598</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100" Version="8.0.0-alpha.1.22620.1" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100" Version="8.0.0-alpha.1.23066.1" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>66b984594a008151bdb14dc60589373e3d44be83</Sha>
<Sha>5b46122b31036064483ce2e55b5e2240e5548204</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project>
<!--Package versions-->
<PropertyGroup>
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-alpha.1.23063.11</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>8.0.100-1.23055.2</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-alpha.1.23058.2</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-alpha.1.23070.23</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>8.0.100-1.23067.1</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-alpha.1.23070.1</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
<MicrosoftDotNetBuildTasksFeedPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
<MicrosoftNETWorkloadEmscriptennet7Manifest80100Version>8.0.0-alpha.1.22620.1</MicrosoftNETWorkloadEmscriptennet7Manifest80100Version>
<MicrosoftNETWorkloadEmscriptennet7Manifest80100Version>8.0.0-alpha.1.23066.1</MicrosoftNETWorkloadEmscriptennet7Manifest80100Version>
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptennet7Manifest80100Version)</MicrosoftNETWorkloadEmscriptenPackageVersion>
<MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,17 @@ _ResolveAssemblies MSBuild target.
<ItemGroup>
<_ResolvedAssemblyFiles Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.dll' " />
<_ResolvedSymbolFiles Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.pdb' " />
<_ResolvedJavaLibraries Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.jar' " />
</ItemGroup>
<ProcessAssemblies
RuntimeIdentifiers="@(_RIDs)"
InputAssemblies="@(_ResolvedAssemblyFiles->Distinct())"
InputJavaLibraries="@(_ResolvedJavaLibraries->Distinct())"
ResolvedSymbols="@(_ResolvedSymbolFiles->Distinct())"
AndroidIncludeDebugSymbols="$(AndroidIncludeDebugSymbols)"
PublishTrimmed="$(PublishTrimmed)">
<Output TaskParameter="OutputAssemblies" ItemName="_ProcessedAssemblies" />
<Output TaskParameter="OutputJavaLibraries" ItemName="AndroidJavaLibrary" />
<Output TaskParameter="ResolvedSymbols" ItemName="ResolvedSymbols" />
<Output TaskParameter="ShrunkAssemblies" ItemName="_ProcessedShrunkAssemblies" />
</ProcessAssemblies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
-keep class md52ce486a14f4bcd95899665e9d932190b.** { *; <init>(...); }
-keepclassmembers class md52ce486a14f4bcd95899665e9d932190b.** { *; <init>(...); }

# .NET 8 runtime
-keep class net.dot.android.crypto.DotnetProxyTrustManager { *; <init>(...); }

# Android's template misses fluent setters...
-keepclassmembers class * extends android.view.View {
*** set*(...);
Expand Down
24 changes: 21 additions & 3 deletions src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ public class ProcessAssemblies : AndroidTask

public ITaskItem [] InputAssemblies { get; set; } = Array.Empty<ITaskItem> ();

public ITaskItem [] InputJavaLibraries { get; set; } = Array.Empty<ITaskItem> ();

[Output]
public ITaskItem []? OutputAssemblies { get; set; }

[Output]
public ITaskItem []? OutputJavaLibraries { get; set; }

[Output]
public ITaskItem []? ShrunkAssemblies { get; set; }

Expand Down Expand Up @@ -78,6 +83,19 @@ public override bool RunTask ()
ShrunkAssemblies = shrunkAssemblies.ToArray ();
}

if (InputJavaLibraries != null) {
var javaLibraries = new Dictionary<string, ITaskItem> (StringComparer.OrdinalIgnoreCase);
foreach (var item in InputJavaLibraries) {
if (!IsFromAKnownRuntimePack (item))
continue;
var name = Path.GetFileNameWithoutExtension(item.ItemSpec);
if (!javaLibraries.ContainsKey (name)) {
javaLibraries [name] = item;
}
}
OutputJavaLibraries = javaLibraries.Values.ToArray ();
}

return !Log.HasLoggedErrors;
}

Expand Down Expand Up @@ -112,7 +130,7 @@ void SetMetadataForAssemblies (List<ITaskItem> output, Dictionary<string, ITaskI
SetAssemblyAbiMetadata (assembly, symbol, isDuplicate: false);
symbol?.SetDestinationSubPath ();
assembly.SetDestinationSubPath ();
assembly.SetMetadata ("FrameworkAssembly", IsFrameworkAssembly (assembly).ToString ());
assembly.SetMetadata ("FrameworkAssembly", IsFromAKnownRuntimePack (assembly).ToString ());
assembly.SetMetadata ("HasMonoAndroidReference", MonoAndroidHelper.HasMonoAndroidReference (assembly).ToString ());
output.Add (assembly);
}
Expand All @@ -134,7 +152,7 @@ void DeduplicateAssemblies (List<ITaskItem> output, Dictionary<string, ITaskItem

// Calculate %(FrameworkAssembly) and %(HasMonoAndroidReference) for the first
if (frameworkAssembly == null) {
frameworkAssembly = IsFrameworkAssembly (assembly);
frameworkAssembly = IsFromAKnownRuntimePack (assembly);
}
if (hasMonoAndroidReference == null) {
hasMonoAndroidReference = MonoAndroidHelper.IsMonoAndroidAssembly (assembly) ||
Expand Down Expand Up @@ -170,7 +188,7 @@ void DeduplicateAssemblies (List<ITaskItem> output, Dictionary<string, ITaskItem
}
}

static bool IsFrameworkAssembly (ITaskItem assembly)
static bool IsFromAKnownRuntimePack (ITaskItem assembly)
{
string packageId = assembly.GetMetadata ("NuGetPackageId") ?? "";
return packageId.StartsWith ("Microsoft.NETCore.App.Runtime.", StringComparison.Ordinal) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
"Size": 58913
},
"assemblies/Mono.Android.dll": {
"Size": 87106
"Size": 87163
},
"assemblies/Mono.Android.Runtime.dll": {
"Size": 5860
"Size": 5895
},
"assemblies/rc.bin": {
"Size": 1182
},
"assemblies/System.Console.dll": {
"Size": 6586
"Size": 6438
},
"assemblies/System.Linq.dll": {
"Size": 9252
"Size": 9122
},
"assemblies/System.Private.CoreLib.dll": {
"Size": 517260
"Size": 516811
},
"assemblies/System.Runtime.dll": {
"Size": 2611
"Size": 2620
},
"assemblies/System.Runtime.InteropServices.dll": {
"Size": 2265
"Size": 3753
},
"assemblies/UnnamedProject.dll": {
"Size": 3258
"Size": 3219
},
"classes.dex": {
"Size": 19020
Expand All @@ -47,7 +47,7 @@
"Size": 379320
},
"lib/arm64-v8a/libmonosgen-2.0.so": {
"Size": 3089272
"Size": 3090760
},
"lib/arm64-v8a/libSystem.IO.Compression.Native.so": {
"Size": 723840
Expand All @@ -56,7 +56,7 @@
"Size": 94328
},
"lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": {
"Size": 152960
"Size": 155056
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 16720
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,124 +14,124 @@
"Size": 66786
},
"assemblies/Mono.Android.dll": {
"Size": 444701
"Size": 444703
},
"assemblies/Mono.Android.Runtime.dll": {
"Size": 5860
"Size": 5895
},
"assemblies/mscorlib.dll": {
"Size": 3863
"Size": 3857
},
"assemblies/netstandard.dll": {
"Size": 5572
"Size": 5567
},
"assemblies/rc.bin": {
"Size": 1182
},
"assemblies/System.Collections.Concurrent.dll": {
"Size": 10661
"Size": 10529
},
"assemblies/System.Collections.dll": {
"Size": 15394
"Size": 15258
},
"assemblies/System.Collections.NonGeneric.dll": {
"Size": 7648
"Size": 7487
},
"assemblies/System.ComponentModel.dll": {
"Size": 2151
"Size": 1964
},
"assemblies/System.ComponentModel.Primitives.dll": {
"Size": 2641
"Size": 2579
},
"assemblies/System.ComponentModel.TypeConverter.dll": {
"Size": 6198
"Size": 6069
},
"assemblies/System.Console.dll": {
"Size": 6750
"Size": 6610
},
"assemblies/System.Core.dll": {
"Size": 1988
"Size": 1982
},
"assemblies/System.Diagnostics.TraceSource.dll": {
"Size": 6738
"Size": 6580
},
"assemblies/System.dll": {
"Size": 2344
"Size": 2338
},
"assemblies/System.Drawing.dll": {
"Size": 2029
"Size": 2023
},
"assemblies/System.Drawing.Primitives.dll": {
"Size": 12091
"Size": 11996
},
"assemblies/System.IO.Compression.dll": {
"Size": 16975
"Size": 16847
},
"assemblies/System.IO.IsolatedStorage.dll": {
"Size": 10151
"Size": 9957
},
"assemblies/System.Linq.dll": {
"Size": 19591
"Size": 19441
},
"assemblies/System.Linq.Expressions.dll": {
"Size": 163969
"Size": 164128
},
"assemblies/System.Net.Http.dll": {
"Size": 66013
"Size": 65982
},
"assemblies/System.Net.Primitives.dll": {
"Size": 22534
"Size": 22441
},
"assemblies/System.Net.Requests.dll": {
"Size": 3738
"Size": 3620
},
"assemblies/System.ObjectModel.dll": {
"Size": 8186
"Size": 8144
},
"assemblies/System.Private.CoreLib.dll": {
"Size": 805075
"Size": 808708
},
"assemblies/System.Private.DataContractSerialization.dll": {
"Size": 192436
"Size": 192356
},
"assemblies/System.Private.Uri.dll": {
"Size": 42864
"Size": 42878
},
"assemblies/System.Private.Xml.dll": {
"Size": 215941
"Size": 216193
},
"assemblies/System.Private.Xml.Linq.dll": {
"Size": 16796
"Size": 16662
},
"assemblies/System.Runtime.dll": {
"Size": 2756
"Size": 2763
},
"assemblies/System.Runtime.InteropServices.dll": {
"Size": 2265
"Size": 3753
},
"assemblies/System.Runtime.Serialization.dll": {
"Size": 1950
"Size": 1943
},
"assemblies/System.Runtime.Serialization.Formatters.dll": {
"Size": 2677
"Size": 2509
},
"assemblies/System.Runtime.Serialization.Primitives.dll": {
"Size": 3847
"Size": 3791
},
"assemblies/System.Security.Cryptography.dll": {
"Size": 7900
"Size": 7766
},
"assemblies/System.Text.RegularExpressions.dll": {
"Size": 156731
"Size": 156677
},
"assemblies/System.Xml.dll": {
"Size": 1839
"Size": 1833
},
"assemblies/System.Xml.Linq.dll": {
"Size": 1862
"Size": 1856
},
"assemblies/UnnamedProject.dll": {
"Size": 5335
"Size": 5294
},
"assemblies/Xamarin.AndroidX.Activity.dll": {
"Size": 5870
Expand Down Expand Up @@ -209,7 +209,7 @@
"Size": 379320
},
"lib/arm64-v8a/libmonosgen-2.0.so": {
"Size": 3089272
"Size": 3090760
},
"lib/arm64-v8a/libSystem.IO.Compression.Native.so": {
"Size": 723840
Expand All @@ -218,7 +218,7 @@
"Size": 94328
},
"lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": {
"Size": 152960
"Size": 155056
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 333720
Expand Down Expand Up @@ -1976,5 +1976,5 @@
"Size": 341228
}
},
"PackageSize": 7807748
"PackageSize": 7828228
}

0 comments on commit 35db527

Please sign in to comment.