-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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] Fix up conditions to trigger relink, and require wasm-tools
workload
#89754
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue Detailsnull
|
- `WasmNativeStrip=false` - this will trigger a relink. Runtime pack is built with `WasmNativeStrip=true`. - Also, honor `WasmEnableSIMD=false`, and `WasmEnableExceptionHandling=false` for publish to trigger a relink.
…voids unnecessary relinking for the no-aot case
.. and don't set `WasmNativeStrip=false` by default, as it triggers relinking now.
…ativeStrip - `WasmNativeDebugSymbols` will cause symbols to be included (essentially `-g`) - `WasmNativeStrip` will cause these to be stripped with `wasm-opt --strip-dwarf ...`
33212f1
to
4a5d3d3
Compare
wasm-tools
workload
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
<_WasmNativeWorkloadNeeded Condition="'$(RunAOTCompilation)' == 'true' or '$(WasmEnableSIMD)' == 'true' or '$(WasmEnableLegacyJsInterop)' == 'false' or '$(WasmBuildNative)' == 'true' or | ||
'$(WasmGenerateAppBundle)' == 'true' or '$(_UsingBlazorOrWasmSdk)' != 'true'" >true</_WasmNativeWorkloadNeeded> | ||
<!-- Keep in sync with WasmApp.Native.targets --> | ||
<_WasmNativeWorkloadNeeded Condition=" |
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.
Does this get evaluated late enough that defaults have already been applied for all these properties? If not, shouldn't most of these be of the form != 'false'
instead of == 'true'
?
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.
Good question! Setting _WasmNativeWorkloadNeeded
will cause the build to fail if the user does not have the wasm-tools
workload installed.
-
The workload is needed for doing any native build, which is when:
- If the various settings don't match, what the bits in the runtime pack were built with (for example
WasmEnableLegacyJsInterop=false
) - Using native references, or AOT
- Explicitly asked for, by setting
WasmBuildNative=true
- If the various settings don't match, what the bits in the runtime pack were built with (for example
-
But without the workload the targets for these native builds are not available at all, so essentially, the user will be expecting a native build but nothing would happen.
-
To prompt the user to install the the workload we set
_WasmNativeWorkloadNeeded=true
here, and essentially try to determine whether a native build might be needed. -
We don't want it to get triggered by default
-
So, most of these properties are for settings different from the runtime pack build.
But, having said that, I'm now curious about WasmEnableSIMD
, and WasmEnableExceptionHandling
, which are true
for the runtime pack, and thus AFAIU, the conditions should be inverted. I will check this more, and get back to you.
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.
And to answer the original question, we want to explicitly checking for a value that is not the default. And that's why this list needs to be in sync with what we have WasmApp.Native.targets, what
wasm.proj` uses for building the runtime pack bits.
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.
So, the WasmEnableSIMD
, and WasmEnableExceptionHandling
were incorrect. Apparently, we hadn't changed them since they were made the default.
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<WasmBuildNative Condition="'$(WasmBuildNative)' == '' and |
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.
This is really clever 👍
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.
The parts I understand all look good
This was not changed after `WasmEnableSIMD=true` became the default for the runtime pack. And update the tests to match. Effectively: - `WasmEnableSIMD=true` will not trigger requiring a workload - `WasmEnableSIMD=false` *will* trigger requiring a workload Thanks to @kg for the prompt to check all this.
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
The failure is unrelated, and known. |
The following commit caused workload to be required for a blazor app when `InvariantGlobalization==true`, but this is not required. ``` commit 26ae097 Author: Ankit Jain <radical@gmail.com> Date: Thu Aug 10 23:39:10 2023 -0400 [wasm] Fix up conditions to trigger relink, and require `wasm-tools` workload (dotnet#89754) ``` And this broke some sdk tests.
The following commit caused workload to be required for a blazor app when `InvariantGlobalization==true`, but this is not required. ``` commit 26ae097 Author: Ankit Jain <radical@gmail.com> Date: Thu Aug 10 23:39:10 2023 -0400 [wasm] Fix up conditions to trigger relink, and require `wasm-tools` workload (#89754) ``` And this broke some sdk tests.
Trigger relinking (
WasmBuildNative=true
) if:WasmNativeStrip=false
WasmEnableSIMD=false
WasmEnableExceptionHandling=false
Also, trigger "workload required" when:
WasmNativeStrip=false
WasmEnableExceptionHandling=true
InvariantGlobalization=true
InvariantTimeZone=true
Rationalize
WasmNativeDebugSymbols
, andWasmNativeStrip
WasmNativeDebugSymbols
will cause symbols to be included(essentially
-g
)WasmNativeStrip
will cause these to be stripped withwasm-opt --strip-dwarf ...
Fixes #85778 .