[wasm] Incremental build improvements (#90194)
- [wasm] Sanity check emcc versions only when using a custom EMSDK_PATH
- [wasm] Emit a message about compiling native assets only when actually doing so
- [wasm] ConvertDllsToWebcil: avoid doing unncessary conversion, and other work
- [wasm] ManagedToNativeGenerator: add support for incremental runs (time goes from 1.6s to <900ms)
This improves build times ~30% for no-op rebuilds.
*With* native reference | Old | New | Difference | %
-- | -- | -- | -- | --
First build | 8.01s | 8.13s | +0.12s |
4th rebuild | 1.91s | 1.35s | -0.56s | 29%
rebuild with only cs change | 2.90s | 2.48s | -0.42s | 14%
*Without* native reference | Old | New | Difference | %
-- | -- | -- | -- | --
First build | 5.34s | 5.29 | -0.05s |
4th rebuild | 1.78s | 1.20s | -0.58s | 32%
rebuild with only cs change | 1.96s | 1.45s | -0.51s | 26%
- These were run for blazor projects
- These were clean builds, with no `dotnet` process running
- And nuget cache cleared of `*webassembly.pack` which is the relevant package here.
- The native reference was a simple `factorial.c` from https://github.com/dotnet/runtime/issues/60245
Fixes https://github.com/dotnet/runtime/issues/60245 .
With feedback from @kg .