Uh oh!
There was an error while loading. Please reload this page.
[wasm] Require workloads if using @(NativeFileReference) - #58152
Conversation
ghost
commented
Aug 26, 2021
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. |
radical
commented
Aug 26, 2021
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
0a3303aComparec825102 to
6e38e0cCompareghost
commented
Aug 26, 2021
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.
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
0f5cc66Comparelewing
commented
Aug 27, 2021
/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 .