-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[wasm/wasi] Consolidate build targets #95775
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
Current state of build files: ``` wasm: WasmApp.props, WasmApp.targets, WasmApp.Native.targets wasi: WasiApp.props, WasiApp.targets, WasiApp.Native.targets `` The wasm, and wasi build have lot of shared code but that is not representative in the actual files, since the wasi targets started life as a quick-copy-comment-out-bits of the wasm targets. This commit consolidates these into: ``` common: WasmApp.Common.props, WasmApp.Common.targets wasm : WasmApp.props, WasmApp.targets wasi : WasiApp.props, WasiApp.targets ``` ## `WasmApp.Common.{props,targets}` This has all the common parts of the build for browser-wasm, and wasi, and includes bits from `WasmApp.{props,targets}`, and `WasmApp.Native.{props,targets}`. - The top level target remains the same - `WasmBuildApp`. - There are a few "public" targets that can be hooked into: - `PrepareInputsForWasmBuild` - `WasmGenerateAppBundle` - `PrepareForWasmBuildNative` - `WasmLinkDotNet` - all these public targets have corresponding `*DependsOn` properties which can be used for extending the build note: this commit does not add a public target for AOT, but it might be added in future. ## WasmApp.{props,targets} This is for `browser-wasm` projects. The file might be renamed in future. ## WasiApp.{props,targets} This is for `wasi-wasm` projects. `ILStrip` becomes usable as a feature for `wasi-wasm` because of this consolidation.
Tagging subscribers to 'arch-wasm': @lewing Issue Details[wasm/wasi] Consolidate build targets Current state of build files:
|
dotnet/emsdk#621 is needed for this. |
This is admittedly kinda hard to review, so I'm depending on the tests quite a bit. This does not change core specifics of the build, but moves around things, different public targets, and dependencies. |
TODO before merge:
TODO for follow up PRs:
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
<BundleFiles Include="$(RuntimeConfigFilePath)" TargetDir="publish" /> | ||
|
||
<BundleFiles Include="$(WasmSharedPath)data\aot-tests\*" TargetDir="publish" /> | ||
<!-- FIXME: what would be the correct place to do this? --> |
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.
should we rename wasm
-> browser
(OS) and use wasm
for the (architecture) ?
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.
Yeah, I avoided those renames in this PR. We are following the pattern you suggested in most places now, like tests.{wasm,browser,wasi}.targets
, and recently sendtohelix-{wasm,browser,wasi}.proj
.
For review, for the wasm case I think we have pretty good test coverage to be reasonably confident. There will be likely be some cases missed, or small regressions, which we can be fixed in follow up PRs. |
Would be nice to review/merge this quickly so it doesn't conflict with other PRs, i.e. |
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.
ILStrip test looks good to me.
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.
Looks ready to merge then we will need to keep an eye on the builds
Blazor size regression was fixed by: ``` commit ec31705 Author: Ankit Jain <[email protected]> Date: Wed Dec 6 05:36:59 2023 -0500 [wasm] Fix regressed file sizes for blazor (dotnet#92664) ``` .. but a subsequent PR created close to that undid some of the changes: ``` commit a128c15 Author: Ankit Jain <[email protected]> Date: Mon Dec 11 15:45:58 2023 -0500 [wasm/wasi] Consolidate build targets (dotnet#95775) ``` Essentially, `-g` was being passed to the link, and compile-bc steps. Found in dotnet/perf-autofiling-issues#25891 .
* [wasm/wasi] Fix size regression Blazor size regression was fixed by: ``` commit ec31705 Author: Ankit Jain <[email protected]> Date: Wed Dec 6 05:36:59 2023 -0500 [wasm] Fix regressed file sizes for blazor (#92664) ``` .. but a subsequent PR created close to that undid some of the changes: ``` commit a128c15 Author: Ankit Jain <[email protected]> Date: Mon Dec 11 15:45:58 2023 -0500 [wasm/wasi] Consolidate build targets (#95775) ``` Essentially, `-g` was being passed to the link, and compile-bc steps. Found in dotnet/perf-autofiling-issues#25891 . * [wasm] Add flag missed in the consolidate PR
[wasm/wasi] Consolidate build targets
Current state of build files:
The wasm, and wasi build have lot of shared code but that is not
representative in the actual files, since the wasi targets started life
as a quick-copy-comment-out-bits of the wasm targets.
This commit consolidates these into:
WasmApp.Common.{props,targets}
This has all the common parts of the build for browser-wasm, and wasi,
and includes bits from
WasmApp.{props,targets}
, andWasmApp.Native.{props,targets}
.The top level target remains the same -
WasmBuildApp
.There are a few "public" targets that can be hooked into:
PrepareInputsForWasmBuild
WasmGenerateAppBundle
PrepareForWasmBuildNative
WasmLinkDotNet
all these public targets have corresponding
*DependsOn
propertieswhich can be used for extending the build
note: this commit does not add a public target for AOT, but it might be
added in future.
WasmApp.{props,targets}
This is for
browser-wasm
projects. The file might be renamed infuture.
WasiApp.{props,targets}
This is for
wasi-wasm
projects.ILStrip
becomes usable as a featurefor
wasi-wasm
because of this consolidation.