-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm] Require workloads if using @(NativeFileReference)
#58152
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
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
|
This is the same as #58148, but that is separate to ensure that the changes can get tested against rc1 (which is using 6.0* versions vs 7.0 in main). |
851c885 to
0a3303a
Compare
c825102 to
6e38e0c
Compare
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsCurrently, if the But if the project is using native references, but not AOT, then the Implementation:
Fixes #56678 .
|
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.
We need to make sure we are requiring the correct pack, we don't need to insert our own error. Inserting an error here will break the logic in the VS/SDK that would guide the user to install the correct workload.
Currently, if the `wasm-tools` workload is not installed, and a project
uses AOT, then the build fails with an error saying that the workload
is needed.
But if the project is using native references, but not AOT, then the
build does not fail. Instead, the `@(NativeFileReference)` just gets
ignored. Even though the wasm workload is needed to relink dotnet.wasm
with the native libraries.
Implementation:
- `$(RunAOTCompilation)` is a property, so it can be checked, and
wasm workload imports can be enabled.
- But `@(NativeFileReference)` is an item, and that gets evaluated in
the second phase, so we can't use that to affect the imports.
- Instead, we emit a warning from a target run before Build, if the
project has any native references, but the workload isn't enabled.
- Users can explicitly enable the workload by setting
`$(WasmBuildNative)==true`.
6e38e0c to
0f5cc66
Compare
|
/backport to release/6.0 |
|
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1175586954 |
Currently, if the
wasm-toolsworkload is not installed, and a projectuses AOT, then the build fails with an error saying that the workload
is needed.
But if the project is using native references, but not AOT, then the
build does not fail. Instead, the
@(NativeFileReference)just getsignored. Even though the wasm workload is needed to relink dotnet.wasm
with the native libraries.
Implementation:
$(RunAOTCompilation)is a property, so it can be checked, andwasm workload imports can be enabled.
But
@(NativeFileReference)is an item, and that gets evaluated inthe second phase, so we can't use that to affect the imports.
project has any native references, but the workload isn't enabled.
Users can explicitly enable the workload by setting
$(WasmBuildNative)==true.Fixes #56678 .