-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] Don't use workload for tfm < net6.0 #56606
Conversation
src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/WorkloadManifest.targets.in
Outdated
Show resolved
Hide resolved
src/tests/BuildWasmApps/testassets/Blazor_net50/wwwroot/css/open-iconic/FONT-LICENSE
Outdated
Show resolved
Hide resolved
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 think we probably want an error/warning that explains this?
I've made it an error when the project requires a workload, but we have to disable it due to tfm<net6.0 . And emitting the error before |
public static async Task Main(string[] args) | ||
{ | ||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
builder.RootComponents.Add<App>("#app"); |
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.
nit: there are still a bunch of .css, .razor, weather.json, favicon.ico etc assets that don't seem relevant if we're not running the app so we could get rid of them too as having this Main()
here should be enough to test the workload behavior right?
It looks good to me otherwise :)
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.
Removing the razor files, it ends up with pretty much an empty Main. I think, it would be preferable to have the razor files around at least, so they can get processed by the build. I'll remove the other files that are needed for running.
I think this needs some fixes right now, so marked it no-merge. |
I had to make bigger changes to test the case of testing with latest sdk, and no workload installed. And that exposed other issues, so there are new changes here now. And I'll re-request for review, once I have it working on helix too. |
/azp run runtime,runtime-staging |
Azure Pipelines successfully started running 2 pipeline(s). |
Currently, Wasm.Build.Tests are run in two modes: 1. sdk(`$(SdkVersionForWorkloadTesting)`)+workload installed 2. sdk(from global.json)+EMSDK+LocalBuild targets this commit changes (2) to: 2. sdk(`$(SdkVersionForWorkloadTesting)`), no workload installed, + EMSDK+LocalBuild targets This makes it closer to what a user would actually use. Also, for the workload tests, this removes `$(WasmNativeWorkload)` always being set to `true`. The workload should be setting that, and not the tests.
790c3f0
to
6fa0efe
Compare
Remaining test failure is waiting on #56606 . |
Blocked on #56974 to get the emsdk update. |
Installer test failure is #57243 , unrelated to this PR. |
This could use some testing with VS, runtime/library tests, and blazorwasm projects. |
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.
Looking good, I'll do some manual testing then approve.
If the project requires the workload (eg. for AOT), but the project targets <net6.0, then error out before
Publish
.To support this, the Wasm.Build.Tests not support testing with sdk, with no workload installed.
Currently, Wasm.Build.Tests are run in two modes:
$(SdkVersionForWorkloadTesting)
)+workload installedthis commit changes (2) to:
$(SdkVersionForWorkloadTesting)
), no workload installed, +EMSDK+LocalBuild targets
This makes it closer to what a user would actually use.
Also, for the workload tests, this removes
$(WasmNativeWorkload)
always being set to
true
. The workload should be setting that, and notthe tests.
Fixes #54308