-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[release/6.0-rc1][wasm] Require workloads if using @(NativeFileReference)
#58148
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsIf a project is using Fixes #56678 .
|
7879452
to
4f692c7
Compare
@(NativeFileReference)
@(NativeFileReference)
I have opened this against |
4f692c7
to
6b97708
Compare
@(NativeFileReference)
@(NativeFileReference)
68b0b53
to
127d48f
Compare
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, a custom target is used.
127d48f
to
cdeff4d
Compare
closing this while we discuss an alternative approach. |
When a blazorwasm project has
$(RunAOTCompilation)=true
, then thewasm-tools
workload is marked as required. But this is not done if the project wants to use native libraries, without AOT.This PR makes the workload a requirement when such native libraries are being used (
@(NativeFileReference)
). This will cause the build to fail if the workload is not installed.Fixes #56678 .
Customer Impact
Instead of the native library, silently, not getting linked, and failing at runtime, this fails the build.
Testing
CI. New tests added.
Risk