-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm] WasmApp.targets: Separate
obj
, and bin
parts of the build …
…process (#47253) We want to use a separate directory for intermediate build outputs, that aren't needed in the app bundle, and reduce unclear internal dependencies during a build. # TL;DR ## Changes: 1. `$(WasmBuildDir)` removed 2. Reasonable defaults set for most properties 3. To generate a wasm app for a project, the minimum you need to set: a. `$(WasmMainJS)`, b. and `@(WasmAssembliesToBundle)` # Details: Though it is a bit tricky, because the current targets assume: - that they are being run after `Publish` - that the publish directory has: - some required files copied over from the runtime pack (eg. `libmono*`), - and includes the assemblies - that the targets emit all the intermediate output files like `driver.o`, or the bitcode files, into the same directory - And there are assumptions about where to pick which files from (eg. whether to take `dotnet.wasm` from the runtime pack, or from the publish dir), based on unclear rules. ## What does this PR change? - All the assets meant to be from the runtime pack (like `libmono*`, `icudt.dat`) are always taken only from the runtime pack - and this logic is moved out of the tasks, to the targets - `$(WasmBuildDir)` is removed completely. Instead, we use an intermediate path based on `$(IntermediateOutputPath)` - and emit all the intermediate bits there, like the bitcode files - Add reasonable defaults for various properties, like `$(WasmAppDir)` Effectively: 1. To generate a wasm app for a project, the minimum you need to set: a. `$(WasmMainJS)`, b. and `@(WasmAssembliesToBundle)` 2. The targets don't depend on publish dir at all (in a future PR, we could remove triggering based on `Publish` target also) * [wasm] WasmAppBuilder - move the list of native assets, and logic out .. to the targets. - New property: `NativeAssets`, populated by `@(WasmNativeAsset)` - Remove property `MicrosoftNetCoreAppRuntimePackRidDir` - Also, add the `icudt.dat` file from the targets * [wasm] Simplify handling of dotnet.{js,wasm} WasmAppBuilder has (non-obvious) logic to: 1. if AOT'ing, then use the *generated* dotnet.{js,wasm}; 2. else use the one from the runtime pack This depends on Publish having copied those files from the runtime pack to the publish directory, and then comparing paths in the builder to decide which one to use. Instead, make this the intention obvious, and clear. ---- Commits: * [wasm] Always get the native libs from the runtime pack (eg.libmono*) We were getting these from the publish directory, instead we can get them directly from the runtime pack. This includes icudt.dt, and dotnet.timezones.blat . * [wasm] MonoAOTCompiler: add `OutputDir` property .. where we can emit the generated native files. Since these files are meant only for generating the final `dotnet.wasm`, we don't want them to put them in the bin directory. * [wasm] Use existing list of assemblies - @(_WasmAssemblies) .. instead of trying to find them in the build dir. This build directory will become a directory for intermediate build output in upcoming commits. * [wasm] Replace $(WasmMainAssemblyPath) with $(WasmMainAssemblyFileName) - Instead of having a special $(WasmMainAssemblyPath), and then adding it to the wasm assemblies ourselves - let the user project add all the relevant assemblies to `@(WasmAssembliesToBundle)`, which is usually as simple as `$(OutDir)\*.dll`. - This helps to simplify lot of things. - And we just need the main assembly filename for generating the run-v8.sh script. * [wasm] Rename WasmBuildDir -> _WasmIntermediateOutputPath Based on the changes in previous commits, we can now remove `$(WasmBuildDir)`, and replace that with an internal `$(_WasmIntermediateOutputPath)`. This path will have all the build artifacts generated that aren't required in the app bundle. Earlier, we were using the publish directory for that, which resulted in it being littered with unncessary files, and files getting copied to the app bundle from unclear sources, and for non-obvious reasons. * [wasm] add default value for $(WasmAppDir) * [wasm] WasmApp.targets - misc cleanup * [wasm] WasmAppBuilder: validate Assemblies property * [wasm] WasmTestRunner - rename TestAssembly->TestAssemblyFileName, to correctly reflect the value * [wasm] Fix make clean, for samples * [wasm] WasmApp.targets: Add new $(MonoAotCrossCompilerPath) * [wasm] update comments/docs * Address review feedback from @mdh1418
- Loading branch information
Showing
15 changed files
with
122 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.