Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Feb 19, 2021

  • Allow skipping AOT, per assembly with %(_InternalForceInterpret) metadata

  • build: Rename @(WasmAssembliesToBundle) -> @(WasmAssembly)

  • new $(WasmNativeDebugSymbols) to control symbols for dotnet.wasm (useful only for AOT case), which defaults to true

  • Path handling fixes for AOT builds on windows

  • add create-packs.proj for setting up packs from a local build, for quick local testing

- 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
</ItemGroup>
<ItemGroup>
<_AotInputAssemblies Include="@(_WasmAssemblies->Distinct())">
<_AotInputAssemblies Include="@(_WasmAssembliesInternal->Distinct())" Condition="'%(_WasmAssembliesInternal.InterpOnly)' != 'true'">
Copy link
Contributor

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'">

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we have now:

https://github.com/xamarin/xamarin-android/blob/accc846e35ccc2b21e2a472d51ab58ed0682643a/src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs#L20-L27

It kind of maps to the native side:

/**
* 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;

Copy link
Member

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.

Copy link
Member Author

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)?

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@radical radical added the arch-wasm WebAssembly architecture label Feb 24, 2021
@ghost
Copy link

ghost commented Feb 24, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Allow skipping AOT, per assembly with %(InterpreterOnly) metadata
  • build: Rename @(WasmAssembliesToBundle) -> @(WasmAssembly)
  • add create-packs.proj for setting up packs from a local build, for quick local testing
Author: radical
Assignees: -
Labels:

arch-wasm, area-Build-mono

Milestone: -

@radical radical requested a review from pranavkm February 24, 2021 17:07
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.
@radical radical requested a review from steveisok February 25, 2021 18:54
@radical
Copy link
Member Author

radical commented Feb 25, 2021

Unrelated test failures in Libraries Test Run release {coreclr,mono} Linux x64 Debug

@radical
Copy link
Member Author

radical commented Feb 25, 2021

Test failures being tracked in #48751

Copy link
Member

@lewing lewing left a 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.

@lewing
Copy link
Member

lewing commented Feb 26, 2021

But I'm ok to approve to unblock things if @pranavkm is waiting on this?

@radical
Copy link
Member Author

radical commented Mar 15, 2021

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.

@radical radical closed this Mar 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 14, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Build-mono

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants