[wasm] Modify workload to pick threading runtime packs (#72412)
authorSteve Pfister <steveisok@users.noreply.github.com>
Wed, 27 Jul 2022 16:08:59 +0000 (09:08 -0700)
committerGitHub <noreply@github.com>
Wed, 27 Jul 2022 16:08:59 +0000 (12:08 -0400)
commitd7d0e421d77a7c95894a79262a7528fd825e25b0
treeb8ed2c79e189849e471f8d1015ef12568e7ad5b6
parent97f5a04928a0a0b7e4b5259b1e8913d4b52eeb4a
[wasm] Modify workload to pick threading runtime packs (#72412)

* [wasm] Modify workload to pick threading runtime packs

This change adds the 2 wasm threading runtime packs to the wasm workload. In order for a threading runtime pack to be chosen, WorkloadManifest.targets is also modified to override the runtime pack name when the following props are set:

WasmEnableThreads - full threading support and will load Microsoft.NETCore.App.Runtime.multithread.Mono.browser-wasm

WasmEnablePerfTrace - runtime only threading support and will load Microsoft.NETCore.App.Runtime.perftrace.Mono.browser-wasm

* Add error condition when both WasmEnableThreading and WasmEnablePerfTrace are true

* [wasm] Set default value for MonoWasmBuildVariant, for runtime pack nuget

* [wasm] Wasm.Build.Tests: build runtime pack nugets with different names

- The earlier approach of simply making copies of the existing runtime
pack nuget with different names doesn't work, and `dotnet workload
install` rejects it.

```
  Installing pack Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm version 7.0.0-ci...
  Workload installation failed. Rolling back installed packs...
```

Instead, now we build the missing nugets from the project with different
values for `$(MonoWasmBuildVariant)`.

- this handles local builds, and incremental builds also
- To skip building the missing nugets, for example, when you have all of
them available, then set `WasmSkipMissingRuntimePackBuild=true`.

* fix comment

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
docs/workflow/testing/testing-workloads.md
eng/testing/workloads-testing.targets
src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props
src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/WorkloadManifest.json.in
src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/WorkloadManifest.targets.in