Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Context: dotnet/runtime#71787 Context: https://dev.azure.com/dnceng/public/_artifacts/feed/7.0.100-preview.7.22377.5-nonshipping/NuGet/dotnet-pgo/overview/7.0.0-preview.7.22375.6 1. Record a `.nettrace` file: adb reverse tcp:9000 tcp:9001 adb shell setprop debug.mono.profile '127.0.0.1:9000,suspend' dotnet-dsrouter client-server -tcps 127.0.0.1:9001 -ipcc /tmp/maui-app --verbose debug dotnet-trace collect --diagnostic-port /tmp/maui-app --providers Microsoft-Windows-DotNETRuntime:0x1F000080018:5 --output android.nettrace 2. Install `dotnet-pgo`: dotnet tool install -g dotnet-pgo --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/7.0.100-preview.7.22377.5-nonshipping/nuget/v3/index.json --version 7.0.0-preview.7.22375.6 3. Convert to `.mibc`: dotnet-pgo create-mibc --trace android.nettrace --output android.mibc --reference "C:\src\xamarin-android\bin\Release\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.android-arm64\7.0.0-rc.1.22367.4\runtimes\android-arm64\native\System.Private.CoreLib.dll" --reference "C:\src\xamarin-android\bin\Release\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.android-arm64\7.0.0-rc.1.22367.4\runtimes\android-arm64\lib\net7.0\*.dll" To test this, I made a `dotnet new android` app and added: <PropertyGroup> <AndroidUseDefaultAotProfile>false</AndroidUseDefaultAotProfile> </PropertyGroup> <ItemGroup> <AndroidMibcProfile Include="android.mibc" /> </ItemGroup> ~~ Known Issues ~~ If you name the project `doo`, for example, instead of `android`, you run into: C:\src\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.0-ci.dotnet-pgo.119\targets\Microsoft.Android.Sdk.Aot.targets(93,5): Precompiling failed for C:\src\doo\obj\Release\net7.0-android\android-arm64\linked\System.Linq.dll. Mono Ahead of Time compiler - compiling assembly C:\src\doo\obj\Release\net7.0-android\android-arm64\linked\System.Linq.dll AOTID 7AC4BDE2-68D0-3D51-483B-A1059F9CC51D * Assertion at D:\a\_work\1\s\src\mono\mono\mini\aot-compiler.c:13309, condition `is_ok (error)' not met, function:add_mibc_group_method_methods, Could not load file or assembly 'android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. [C:\src\doo\doo.csproj] The main assembly is `doo.dll`, and the app has no `android.dll`. If you name the app `android`, you hit errors for methods in the profile that are not in the app: C:\src\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.0-ci.dotnet-pgo.119\targets\Microsoft.Android.Sdk.Aot.targets(93,5): erro r : * Assertion at D:\a\_work\1\s\src\mono\mono\mini\aot-compiler.c:13309, condition `is_ok (error)' not met, function:add_mibc_group_method_methods, Could not resolve type with token 010000ad from typeref (expected class 'CommonMethods' in assembly 'android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nul l') assembly:android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:CommonMethods member:(null) [C:\src\doo\android.csproj]
- Loading branch information