-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm] Allow assemblies to be skipped for AOTMode=AotInterp #48500
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
Conversation
- The reason for this change is that generating the app bundle is optional now. Eg. in case of blazor, which handles the layout itself. - In that case, the assemblies will be used for other things during `WasmBuildApp` target (eg. AOT). - Change the name to reflect that
src/mono/wasm/build/WasmApp.targets
Outdated
| </ItemGroup> | ||
| <ItemGroup> | ||
| <_AotInputAssemblies Include="@(_WasmAssemblies->Distinct())"> | ||
| <_AotInputAssemblies Include="@(_WasmAssembliesInternal->Distinct())" Condition="'%(_WasmAssembliesInternal.InterpOnly)' != 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InterpOnly
- Could we use a non-abbreviated name
InterprettedOnly? Users might need to configure it. - Might also want to consider something like
AOTMode=Intepretted.
This would look like:
_AotInputAssemblies
Include="@(_WasmAssembliesInternal->Distinct())"
Condition="'%(_WasmAssembliesInternal.AOTMode)' != 'Interpretted'">There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also want to consider something like AOTMode=Intepretted.
Does it make sense to have the possible values for AOTMode to be as what Android, and iOS have? @lewing @marek-safar @jonathanpeppers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we have now:
It kind of maps to the native side:
runtime/src/mono/mono/mini/jit.h
Lines 46 to 72 in 1d9e50c
| /** | |
| * Allows control over our AOT (Ahead-of-time) compilation mode. | |
| */ | |
| typedef enum { | |
| /* Disables AOT mode */ | |
| MONO_AOT_MODE_NONE, | |
| /* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */ | |
| MONO_AOT_MODE_NORMAL, | |
| /* Enables hybrid AOT mode, JIT can still be used for wrappers */ | |
| MONO_AOT_MODE_HYBRID, | |
| /* Enables full AOT mode, JIT is disabled and not allowed, | |
| * equivalent to mono_jit_set_aot_only (true) */ | |
| MONO_AOT_MODE_FULL, | |
| /* Same as full, but use only llvm compiled code */ | |
| MONO_AOT_MODE_LLVMONLY, | |
| /* Uses Interpreter, JIT is disabled and not allowed, | |
| * equivalent to "--full-aot --interpreter" */ | |
| MONO_AOT_MODE_INTERP, | |
| /* Same as INTERP, but use only llvm compiled code */ | |
| MONO_AOT_MODE_INTERP_LLVMONLY, | |
| /* Use only llvm compiled code, fall back to the interpeter */ | |
| MONO_AOT_MODE_LLVMONLY_INTERP, | |
| /* Same as --interp */ | |
| MONO_AOT_MODE_INTERP_ONLY, | |
| /* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */ | |
| MONO_AOT_MODE_LAST = 1000, | |
| } MonoAotMode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think our integer values matter at build time for what is passed at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And those c# enum names are the strings used with $(AOTMode) (or equivalent property name)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our property is $(AndroidAotMode) right now, but we can use a new one in .NET 6 to match other platforms. I'm fine with $(AOTMode) if that is what we pick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not being clear. What values do you use for $(AndroidAotMode)? Are they $(AndroidAotMode)=normal, $(AndroidAotMode)=hybrid etc, to match the C# enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like they all map exactly to this C# enum, except for Intepreter:
This was added earlier to support blazor workload which only uses AOT. But that has since been fixed to correctly use `WasmBuildApp`+`@(WasmNativeAsset)`, so this can be removed.
|
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
Co-authored-by: Pranav K <prkrishn@hotmail.com>
.. and enable it by default.
….wasm with symbols .. defaults to True.
1. tests in `src/tests` failed with: `Bug: The wasm build started with 2 assemblies, but completed with 11.` .. this was because they build with `$(WasmResolveAssembliesBeforeBuild)=true` and that adds to the original list of assemblie. So, skip checking in that case. 2. AOT functional tests failed with: `Bug: The wasm build started with 356 assemblies, but completed with 178. ` .. this was because the original list had dupes! So, ensure to count only distinct items.
|
Unrelated test failures in |
|
Test failures being tracked in #48751 |
lewing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. I'd like to come to some broader consensus on naming, especially Aot vs AOT and the (Aot|AOT)Mode bits.
|
But I'm ok to approve to unblock things if @pranavkm is waiting on this? |
This uses `mono-cil-strip` from a mono installation. And in it's current form it can cause issues, so disabling it for now.
|
The parts of this that didn't do naming changes have been merged as part of #49446 . I will open a new PR, when we have a consensus on the naming. |
Allow skipping AOT, per assembly with
%(_InternalForceInterpret)metadatabuild: Rename
@(WasmAssembliesToBundle)->@(WasmAssembly)new
$(WasmNativeDebugSymbols)to control symbols for dotnet.wasm (useful only for AOT case), which defaults to truePath handling fixes for AOT builds on windows
add
create-packs.projfor setting up packs from a local build, for quick local testing