-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using PublishAot
for Mobile Platforms and Blazor WASM
#25392
Comments
PublishAot
for AndroidPublishAot
for Android and Blazor WASM
@marek-safar @steveisok Thoughts on the above switch for controlling AOT across Android, iOS, wasm, and NativeAOT? |
Within mono (and Blazor), I'm pretty sure @lewing Any thoughts? |
I think there are still distinctions we need to address with build vs publish but I'm also not attached to a particular property name as long as the old one continues to work since it is in net6 for wasm |
Yup, no breaking changes suggested here, just a proposal that it would be nice if we could settle on a uniform name for the future.
|
I like If this is for mobile, then would |
Is it common to publish AOT without bundling in mobile? |
No, it's usually done as a step towards producing a bundle. |
In that case, it sounds like |
Note that even in NativeAOT We plan to add guards into the SDK to prevent combinations which don't make sense. For example setting |
If you use the Project Options screen in a MAUI or .NET 6 Android project: This setting toggles In Android projects If we pick something for AOT "the official name", I would suggest we use it for all platforms. It would be nice if you could We also should continue supporting |
Right, this is a significant difference between the publish model for net* projects and android (and maybe wasm?) projects -- changing the configuration will change optimization levels, but won't do extra artifact deployment steps, like AOT or R2R or creating NuGet packages. The gesture we use for that right now is |
This is why I'd like to see us move away from publish in the property name. It doesn't accurately describe every scenario we support. |
Just an idea, but could it just be |
I'm warming up slightly to that..., although @vitek-karas pointed out offline that "AOT" doesn't really make sense, and really what we mean is "AOTCompile" or "RunAOTCompilation" (although the second one is longer). |
Actually, I remember we talked about this with nullable reference types and we eventually just went with "Nullable", because it was clear to everyone who actually wanted to use it, and I think that's true here as well. |
There are at least two topics at play, from what I can see from this conversation (and my own understanding):
I also like the simplicity of the It would be great if a single property did something useful and expected for each workload and that for most users that was good enough. |
I like the simplicity and flexibility of <AOT>enable</AOT> |
@richlander Do you have any feeling on the consistency of Another option is to add |
One option is to go with |
That seems fine with me. I like keeping the consistency right now with the other |
We have a plan? |
@dotnet/linker-contrib a new issue has been filed in the ILLink area, please triage |
This has been completed, I think. |
reopening this as it was dropped late in net7 but now there are tooling designs that are impacted |
Note that #29785 took the assumption that We will have to rectify this assumption when we start using the |
Oh 💩. That can kind of muddle the waters as we want to be clear that CoreCLRs native AOT does not include a JIT/dynamic support - some people have been asking for that kind of a hybrid. |
PublishAot
for Android and Blazor WASMPublishAot
for Mobile Platforms and Blazor WASM
It's not just DynamicCodeSupport=false. PublishAot also enables single file analyzer, trimming analyzer, AOT analyzer, disables runtimeconfig.json generation, etc. We'll have to update pretty much every use of this property within the SDK repo to not do the thing it's doing if UseMonoRuntime=true. dotnet/runtime#74038 (comment) |
One thing to also consider is how does this unification affect the experimental iOS/tvOS/.../Bionic support with Native AOT we intend to ship in .NET 8 and whether PublishAot should always mean the restrictive form of AOT that drops all dynamicsism for size/startup/memory. We currently have a scale of "AOT" on both Mono side and CoreCLR side (ReadyToRun) that is hard to capture in a bool, but I also don't have a good idea on how complicated we want to make this for users. |
/cc: @rolfbjarne |
I like the simplicity of just AOT: <AOT>true</AOT> I don't particularly like re-using As a sidenote for mobile targets it's cumbersome to use anything restricted to My proposal would be the following:
Note that there's a difference between full aot (no dynamicisms - which MonoAOT can do, and it's the only thing NativeAOT does), and some intermediate thing, with either additional JIT support (I believe Android does this?) or an interpreter (which we do on Apple platforms). |
I prefer
I think it would make sense for one or the other to be true |
Given where we are at in .NET 8, I would suggest the following:
|
Desktop platforms (Mac/Windows/Linux) can also choose between all three runtimes. |
The main thing about
If we want this to work well for targets that do not consider Publish to be part of the cycle, we need to somehow be able to manifest things so that behaviors 1 and 2 still happen. Without those, using AOT is a pretty bad experience because one needs to actually debug things in a configuration that has a slow inner dev cycle (instead of basically using Hot Reload, one needs to wait for the long AOT built times), and has an inferior debugger (no hot reload, etc.). We do not want people to have to debug issues caused by trimming/AOT - they're hard and frustrating to debug. |
Android currently uses the property
AotAssemblies
.PublishAot
seems to do the same thing. Maybe we should accept either for Android, to provide uniformity. Same with Blazor, which usesRunAOTCompilation
.The text was updated successfully, but these errors were encountered: