Skip to content

Commit

Permalink
[wasm] Bump emscripten to 2.0.23 (#53603)
Browse files Browse the repository at this point in the history
Bumps emscripten to 2.0.23

The Browser AOT tests now use `-Wl,-lto-O0` option to reduce memory usage of `wasm-ld` tool, which was in some cases going over avaiable 8GB on helix machines.

* Revert "Add ActiveIssue to the MemoryMappedFiles tests"

This reverts commit ec1ae53.

* Revert "Add ActiveIssue attr to the FileSystem tests"

This reverts commit 356b3ff.

* Bump emscripten version to 2.0.23

* Use newer docker images with 2.0.23

* Update docs

* Use 2.0.23 emscripten nuget packages

* Revert "Revert "Add ActiveIssue attr to the FileSystem tests""

This reverts commit eb2f954.

The fix is not present in 2.0.23

* Revert "Revert "Add ActiveIssue to the MemoryMappedFiles tests""

This reverts commit 8be39f5.

The fix is not present in 2.0.23

* Increase timeout for AOT tests

* Add description of emscripten bump to README

* Try to get information about resources

* Get all limits

* Escape & chars

* Reduce platform matrix

* Lets try one more build with doubled timeout

* Revert "Lets try one more build with doubled timeout"

This reverts commit 67dd775.

* Try -Wl,-O0 on CI

To be sure it behaves the same as in local build

* Use -Wl,-lto-O0 do lower link time optimization

It looks like it reduces the memory load a lot

* Set EmccLinkOptimizationFlag for AOT tests

And reset the default value

* Escape commas

* Revert "Reduce platform matrix"

This reverts commit fec0e55.

* Remove resource info retrieval

* Bump emsdk versions

Co-authored-by: Larry Ewing <lewing@microsoft.com>
  • Loading branch information
radekdoulik and lewing authored Jun 24, 2021
1 parent 458bb9e commit 055a38a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If you haven't already done so, please read [this document](../../README.md#Buil
The **correct version** of Emscripten SDK (emsdk) needs to be installed.
* Run `make -C src/mono/wasm provision-wasm` to install emsdk into `src/mono/wasm/emsdk`.
* Alternatively follow the [installation guide](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install).
Do not install `latest` but rather specific version e.g. `./emsdk install 2.0.21`. See [emscripten-version.txt](..\..\..\..\src\mono\wasm\emscripten-version.txt)
Do not install `latest` but rather specific version e.g. `./emsdk install 2.0.23`. See [emscripten-version.txt](..\..\..\..\src\mono\wasm\emscripten-version.txt)

Once installed the `EMSDK_PATH` environment variable needs to be set:

Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>4e5bea15eb5a9c8cf9142195b1c9c78437a5b27f</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.2.0.21.Node.win-x64" Version="6.0.0-preview.6.21275.1">
<Dependency Name="Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64" Version="6.0.0-preview.7.21323.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>defa37b05c734e025292c5747664e970cd2ac444</Sha>
<Sha>617928847d1e11458527b8bbafb5577982291847</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="1.0.1-alpha.0.21311.1">
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.21308.1</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.21308.1</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
<!-- emscripten / Node -->
<MicrosoftNETRuntimeEmscripten2021Nodewinx64Version>6.0.0-preview.6.21275.1</MicrosoftNETRuntimeEmscripten2021Nodewinx64Version>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETRuntimeEmscripten2021Nodewinx64Version)</MicrosoftNETRuntimeEmscriptenVersion>
<MicrosoftNETRuntimeEmscripten2023Nodewinx64Version>6.0.0-preview.7.21323.1</MicrosoftNETRuntimeEmscripten2023Nodewinx64Version>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETRuntimeEmscripten2023Nodewinx64Version)</MicrosoftNETRuntimeEmscriptenVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
targetRid: browser-wasm
platform: Browser_wasm
container:
image: ubuntu-18.04-webassembly-20210519131124-ba00c14
image: ubuntu-18.04-webassembly-20210531091624-f5c7a43
registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ jobs:

# WebAssembly windows
- ${{ if eq(parameters.platform, 'Browser_wasm_win') }}:
- (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20210519130955-ba00c14
- (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20210531091615-f5c7a43

${{ insert }}: ${{ parameters.jobParameters }}
2 changes: 1 addition & 1 deletion eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<!-- running aot-helix tests locally, so we can test with the same project file as CI -->
<_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)</_AOTBuildCommand>

<_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation)</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation) /p:EmccLinkOptimizationFlag='-Oz -Wl%252C-O0 -Wl%252C-lto-O0'</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) &amp;&amp; cd wasm_build/AppBundle</_AOTBuildCommand>

<RunScriptCommand Condition="'$(RunScriptCommand)' == ''">$(_AOTBuildCommand)</RunScriptCommand>
Expand Down
1 change: 1 addition & 0 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == '' and ('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm')">00:45:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' != '' and '$(_workItemTimeout)' == '' and ('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm')">01:00:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == 'BuildWasmApps' and '$(_workItemTimeout)' == ''">01:00:00</_workItemTimeout>
<_workItemTimeout Condition="'$(TargetOS)' == 'Browser' and '$(NeedsToBuildWasmAppsOnHelix)' == 'true'">01:00:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == '' and '$(Outerloop)' == 'true'">00:20:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == ''">00:15:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' != '' and '$(_workItemTimeout)' == ''">00:30:00</_workItemTimeout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,29 +270,29 @@
"kind": "Sdk",
"version": "${EmscriptenVersion}",
"alias-to": {
"win-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Node.win-x64",
"linux-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Node.linux-x64",
"osx-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Node.osx-x64",
"osx-arm64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Node.osx-x64"
"win-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64",
"linux-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Node.linux-x64",
"osx-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Node.osx-x64",
"osx-arm64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Node.osx-x64"
}
},
"Microsoft.NET.Runtime.Emscripten.Python" : {
"kind": "Sdk",
"version": "${EmscriptenVersion}",
"alias-to": {
"win-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Python.win-x64",
"osx-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Python.osx-x64",
"osx-arm64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Python.osx-x64"
"win-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Python.win-x64",
"osx-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Python.osx-x64",
"osx-arm64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Python.osx-x64"
}
},
"Microsoft.NET.Runtime.Emscripten.Sdk" : {
"kind": "Sdk",
"version": "${EmscriptenVersion}",
"alias-to": {
"win-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Sdk.win-x64",
"linux-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Sdk.linux-x64",
"osx-x64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Sdk.osx-x64",
"osx-arm64": "Microsoft.NET.Runtime.Emscripten.2.0.21.Sdk.osx-x64"
"win-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.win-x64",
"linux-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.linux-x64",
"osx-x64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.osx-x64",
"osx-arm64": "Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.osx-x64"
}
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/mono/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Note: `EMSDK_PATH` is set by default in `src/mono/wasm/Makefile`, so building ta
you are directly using the `dotnet build`, or `build.sh`.

* Alternatively you can install **correct version** yourself from the [Emscripten SDK guide](https://emscripten.org/docs/getting_started/downloads.html).
Do not install `latest` but rather specific version e.g. `./emsdk install 2.0.21`. See [emscripten-version.txt](./emscripten-version.txt)
Do not install `latest` but rather specific version e.g. `./emsdk install 2.0.23`. See [emscripten-version.txt](./emscripten-version.txt)

Make sure to set `EMSDK_PATH` variable, whenever building, or running tests for wasm.

Expand Down Expand Up @@ -154,3 +154,14 @@ The samples in `src/mono/sample/wasm` can be build and run like this:
`dotnet build /t:RunSample browser/Wasm.Browser.Sample.csproj`

To build and run the samples with AOT, add `/p:RunAOTCompilation=true` to the above command lines.

### Upgrading Emscripten

Bumping Emscripten version involves these steps:

* update https://github.com/dotnet/runtime/blob/main/src/mono/wasm/emscripten-version.txt
* bump emscripten versions in docker images in https://github.com/dotnet/dotnet-buildtools-prereqs-docker
* bump emscripten in https://github.com/dotnet/emsdk
* update version number in docs
* update `Microsoft.NET.Runtime.Emscripten.<emscripten version>.Node.win-x64` package name, version and sha hash in https://github.com/dotnet/runtime/blob/main/eng/Version.Details.xml and in https://github.com/dotnet/runtime/blob/main/eng/Versions.props. the sha is the commit hash in https://github.com/dotnet/emsdk and the package version can be found at https://dev.azure.com/dnceng/public/_packaging?_a=feed&feed=dotnet6
* update packages in the workload manifest https://github.com/dotnet/runtime/blob/main/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/WorkloadManifest.json.in
2 changes: 1 addition & 1 deletion src/mono/wasm/emscripten-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.21
2.0.23

0 comments on commit 055a38a

Please sign in to comment.