Repository navigation
Description
Description
Working towards reproducible Release builds of a .NET 10 MAUI Android app (OWASP MASWE-0075), I build one commit twice from a clean obj and compare every intermediate. With the Mono AOT compiler given the deterministic option (AndroidAotAdditionalArguments=deterministic), the 16-byte random AOTID is gone (before that option every one of the 210 images differed by exactly those 16 bytes), but a few libaot-*.dll.so images still differ from run to run by a small number of bytes, with byte-identical inputs.
aot-compiler.c (dotnet/runtime main, read 2026-10-14) uses aot_opts.deterministic in two places only: to skip generate_aotid and to skip the AOTID print. Nothing else in the compiler is covered by it.
What is identical across the two builds: the trimmed input assemblies for 103 of the 105 images (obj/.../android-arm64/linked/*.dll, cmp byte for byte; the two that differ are user assemblies whose differences are derived hashes only, and their images are not the ones listed below). nthreads is not passed, so compile_methods runs single-threaded; no dedup options; LLVM off; profiled AOT on.
Reproduction Steps
dotnet new maui -n Reprotargeting net10.0-android.dotnet publish -f net10.0-android -c Release -p:AndroidAotAdditionalArguments=deterministic -p:ContinuousIntegrationBuild=true.- Keep
obj/Release/net10.0-android/android-arm64/linked/*.dllandobj/Release/net10.0-android/android-arm64/aot/*.dll.soaside; deletebinandobj; publish again. - Compare: the
linkedassemblies are byte-identical; someaot/*.dll.soare not (cmp -l).
Expected behavior
Identical input assemblies and identical options give identical AOT images.
Actual behavior
Measured on two clean builds of one commit (one pair; a second pair of the same commit gave a different set and counts):
- android-arm64:
System.Private.CoreLib.dll.so95 bytes differ (116 and 96 in two other pairs),Microsoft.Maui.Controls.dll.so2,Microsoft.Maui.Graphics.dll.so8 - android-x64:
System.Private.CoreLib.dll.so157,Microsoft.Maui.Controls.dll.so451,Microsoft.Maui.Graphics.dll.so589,Microsoft.Maui.dll.so231,Microsoft.Maui.Essentials.dll.so19
File sizes are identical; the differing bytes are scattered clusters of 2 to 12 bytes (CoreLib arm64: 16 clusters). They are content rather than padding: at one offset right after a ret (c0 03 5f d6), one build holds 12 00 00 00 48 01 00 00 05 00 00 00 and the other 00 00 00 14 a0 17 40 f9 00 00 00 94. The set of images that differ and the counts change from one pair of builds to the next.
Regression?
Unknown; not tested on earlier releases.
Known Workarounds
None found. deterministic removes the AOTID only.
Configuration
- .NET SDK 10.0.303, workload set 10.0.302.1, Microsoft.Android.Sdk.Windows 36.1.69
- Mono runtime pack
Microsoft.NETCore.App.Runtime.Mono.android-arm6410.0.10; cross compilersMicrosoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm64and...android-x6410.0.10 - Host: Windows 11 x64; targets android-arm64 and android-x64
RunAOTCompilationtrue,AndroidEnableProfiledAottrue,EnableLLVMunset,TrimModepartial (AndroidLinkModeSdkOnly),AndroidAotModeNormal- Trimmer:
--deterministic(its default);ContinuousIntegrationBuildtrue
Other information
Is there an option I have missed that makes the remaining output stable (for example an ordering for extra or generic methods, or GOT slots)? I can run any diagnostic on request. A related report on the generated resource designer assembly's time stamp is on dotnet/android.
Activity
jrramosdominguez commentedon Oct 14, 2026
The related dotnet/android report on the generated resource designer assembly's time stamp is dotnet/android#13140.