You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: dotnet/maui#4355
Context: https://github.com/jonathanpeppers/android-profiled-aot
Context: #6171
Context: 3e699d6
I found that when I went to update the .NET MAUI AOT profile in
dotnet/maui#4355, the profiler crashed with:
01-27 11:10:16.119 28922 28922 W monodroid: Creating public update directory: `/data/user/0/com.androidaot.MauiApp1/files/.__override__`
...
01-27 11:10:16.119 28922 28922 W monodroid: Initializing profiler with options: aot:port=9999output=/data/user/0/com.androidaot.MauiApp1/files/.__override__/profile.aotprofile
01-27 11:10:16.119 28922 28922 W monodroid: Looking for profiler init symbol 'mono_profiler_init_aot'? 0x7325b6355c
01-27 11:10:16.119 28922 28922 E mono-prof: Could not create AOT profiler output file 'output.aotprofile': Read-only file system
But the directory was writeable?
adb shell run-as com.androidaot.MauiApp1 touch files/.__override__/foo
# no error
After some digging, it turned out that *appending* `,` to the
[`_SetAotProfilingPropsOnDevice` target's `<Exec/>`][0] fixed it:
"$(AdbToolPath)adb" $(AdbTarget) shell setprop debug.mono.profile aot:port=$(AndroidAotProfilerPort),
What happened was we "lost" a `,` somewhere in
#6171, likely in:
* f73a323
To fix this:
1. Prepend a `,`
2. I found a way to actually enable tests for Profiled AOT in .NET 6
by downloading binaries from my Github repo.
In enabling the `ProfiledAOT` category for .NET 6, I found that this
setting wasn't working:
<AndroidExtraAotOptions>--verbose</AndroidExtraAotOptions>
I updated `%(_MonoAOTAssemblies.ProcessArguments)` to solve this.
[0]: https://github.com/xamarin/xamarin-android/blob/b7a368a27667c69117f64be81050403f2d5c8560/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Application.targets#L45
StringAssertEx.ContainsRegex(@$"Using profile data file.*{filename}\.aotprofile",b.LastBuildOutput,"Should use default AOT profile",RegexOptions.IgnoreCase);
Assert.IsTrue(b.Build(proj),"Build should have succeeded.");
63
-
StringAssertEx.ContainsRegex(@"\[aot-compiler stdout\] Using profile data file.*build.Xamarin.Android.startup\.aotprofile",b.LastBuildOutput,"Should use default AOT profile",RegexOptions.IgnoreCase);
Assert.IsTrue(b.Build(proj),"Build should have succeeded.");
86
-
StringAssertEx.ContainsRegex(@"\[aot-compiler stdout\] Using profile data file.*custom\.aotprofile",b.LastBuildOutput,"Should use custom AOT profile",RegexOptions.IgnoreCase);
Assert.IsTrue(b.Build(proj),"Build should have succeeded.");
101
-
StringAssertEx.DoesNotContainRegex(@"\[aot-compiler stdout\] Using profile data file.*build.Xamarin.Android.startup.*\.aotprofile",b.LastBuildOutput,"Should not use default AOT profile",RegexOptions.IgnoreCase);
102
-
}
102
+
usingvarb=CreateApkBuilder();
103
+
Assert.IsTrue(b.Build(proj),"Build should have succeeded.");
StringAssertEx.DoesNotContainRegex(@$"Using profile data file.*{filename}\.aotprofile",b.LastBuildOutput,"Should not use default AOT profile",RegexOptions.IgnoreCase);
0 commit comments