Skip to content
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] emscripten bump 3.1.56 #100334

Merged
merged 59 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e52f7df
[wasm] Bump emscripten to 3.1.56
radekdoulik Mar 26, 2024
a91ec44
Replace Module.asm with Module.wasmExports
radekdoulik Mar 27, 2024
d23f6fa
Updates for .native.worker.js -> mjs rename
radekdoulik Apr 5, 2024
9848b92
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Apr 5, 2024
50dfb72
Update deps
radekdoulik May 30, 2024
aca6c58
Add general testing feed
radekdoulik May 30, 2024
f229a30
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik May 30, 2024
f917ea6
Update mode deps
radekdoulik May 30, 2024
a7c4e55
Update path
radekdoulik May 30, 2024
0b030c1
Use current python packages for now, we don't have newer ones
radekdoulik May 30, 2024
6a0057f
Keep using llvm 16 for runtime and aot compiler
radekdoulik Jun 3, 2024
6cde92a
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 3, 2024
1721779
Add -Wno-pre-c11-compat only for browser
radekdoulik Jun 3, 2024
fe1e5c6
Temporarily disable version checks to get further
radekdoulik Jun 3, 2024
3f8834f
Temporarily disable version checks to get further #2
radekdoulik Jun 4, 2024
123767a
Disable -Wunused-command-line-argument
radekdoulik Jun 4, 2024
e3b1316
Update emsdk deps
radekdoulik Jun 4, 2024
7d6edc3
Update icu dependency
radekdoulik Jun 4, 2024
15bd585
Revert "Temporarily disable version checks to get further #2"
radekdoulik Jun 4, 2024
92b4559
Revert "Temporarily disable version checks to get further"
radekdoulik Jun 4, 2024
d7b1d52
Fix emsdk check
radekdoulik Jun 4, 2024
3593c41
Workaround wasm-opt crash
radekdoulik Jun 4, 2024
4530edf
Workaround wasm-opt crash
radekdoulik Jun 5, 2024
200cf3b
Workaround wasm-opt crash
radekdoulik Jun 5, 2024
6e86cc3
Fix WBT test
radekdoulik Jun 11, 2024
02fb272
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 11, 2024
c313fa5
Feedback
radekdoulik Jun 11, 2024
253ebf9
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
lewing Jun 12, 2024
0d7708b
Update ICU dependency
radekdoulik Jun 14, 2024
8a12f44
Update emscripten deps
radekdoulik Jun 14, 2024
fc6ad97
Revert "Workaround wasm-opt crash"
radekdoulik Jun 14, 2024
683bd51
Revert "Workaround wasm-opt crash"
radekdoulik Jun 14, 2024
b15fd5c
Revert "Workaround wasm-opt crash"
radekdoulik Jun 14, 2024
9ae3c2f
Increase tests timeout
radekdoulik Jun 16, 2024
60a4799
Show test progress
radekdoulik Jun 16, 2024
4dadd6d
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 16, 2024
3bd6bfb
Increase MT library tests timeout
radekdoulik Jun 17, 2024
16866a1
Disable WBT tests with SkiaSharp
radekdoulik Jun 17, 2024
d53aaa3
Increase helix tests timeout on browser
radekdoulik Jun 18, 2024
6765913
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 18, 2024
4c69c36
Increase WBT timeout
radekdoulik Jun 19, 2024
c268a87
Increase initial heap sizes
radekdoulik Jun 19, 2024
d1d8619
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 20, 2024
abe9b00
Fix mono_wasm_load_runtime cwrap signature
radekdoulik Jun 20, 2024
63087a5
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 21, 2024
d5a0bc4
Enable XunitShowProgress for threading tasks tests
radekdoulik Jun 26, 2024
5d9a6d2
Try to reduce number of parallel AOT compilations
radekdoulik Jun 26, 2024
8505fd5
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jul 1, 2024
3fe1e1f
Use new docker image for helix/windows tests
radekdoulik Jul 2, 2024
b2655bf
Revert "Try to reduce number of parallel AOT compilations"
radekdoulik Jul 3, 2024
ba1ad20
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
pavelsavara Jul 4, 2024
009e371
Reduce the timeouts
radekdoulik Jul 7, 2024
9e0d5ce
Reduce intitial heap size
radekdoulik Jul 7, 2024
061f2b5
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
pavelsavara Jul 9, 2024
8ed7bf9
use active issues for MT
pavelsavara Jul 9, 2024
d665bfa
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jul 10, 2024
fdbb1f2
Remove testing channel from nuget config, update deps
radekdoulik Jul 13, 2024
ddc4698
Update emsdk and icu dependencies
radekdoulik Jul 15, 2024
e6426d2
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="9.0.0-preview.7.24358.1">
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="9.0.0-preview.7.24365.2">
<Uri>https://github.com/dotnet/icu</Uri>
<Sha>42787a07ecba682549f520293bb5a6941bdccb50</Sha>
<Sha>c8db7547bc0a021ffd262b3449f5b0343894b32b</Sha>
</Dependency>
<Dependency Name="System.Net.MsQuic.Transport" Version="9.0.0-alpha.1.24167.3">
<Uri>https://github.com/dotnet/msquic</Uri>
Expand Down Expand Up @@ -68,14 +68,14 @@
<Sha>7e4af02521473d89d6144b3da58fef253e498974</Sha>
<SourceBuild RepoName="cecil" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.0-preview.7.24352.2">
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.0-preview.7.24365.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>d3583522209829d1ed0440662ba136c7b7700b16</Sha>
<Sha>99ea0c06b84d3084d090da537080dd35d2a193cf</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.emsdk" Version="9.0.0-preview.7.24352.2">
<Dependency Name="Microsoft.SourceBuild.Intermediate.emsdk" Version="9.0.0-preview.7.24365.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>d3583522209829d1ed0440662ba136c7b7700b16</Sha>
<Sha>99ea0c06b84d3084d090da537080dd35d2a193cf</Sha>
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<!-- ILCompiler -->
<MicrosoftDotNetILCompilerVersion>9.0.0-preview.7.24357.2</MicrosoftDotNetILCompilerVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-preview.7.24358.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-preview.7.24365.2</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicSchannelVersion>2.3.5</MicrosoftNativeQuicMsQuicSchannelVersion>
<SystemNetMsQuicTransportVersion>9.0.0-alpha.1.24167.3</SystemNetMsQuicTransportVersion>
Expand All @@ -239,7 +239,7 @@
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-9_0_100_Transport
-->
<MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-preview.7.24352.2</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
<MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-preview.7.24365.1</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETRuntimeEmscriptenVersion>
<MicrosoftNETRuntimeEmscripten3134Pythonwinx64Version>9.0.0-preview.7.24352.2</MicrosoftNETRuntimeEmscripten3134Pythonwinx64Version>
<!-- workloads -->
Expand All @@ -262,6 +262,6 @@
<runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>9.0.0-alpha.1.24175.1</runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>
<EmsdkPackageVersion>$(MicrosoftNETRuntimeEmscriptenVersion)</EmsdkPackageVersion>
<NodePackageVersion>$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)</NodePackageVersion>
<EmsdkVersion>3.1.34</EmsdkVersion>
<EmsdkVersion>3.1.56</EmsdkVersion>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@
$(LibrariesNativeArtifactsPath)segmentation-rules.json;"
IsNative="true" />
<!-- for threaded wasm -->
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser' and Exists('$(LibrariesNativeArtifactsPath)dotnet.native.worker.js')"
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser' and Exists('$(LibrariesNativeArtifactsPath)dotnet.native.worker.mjs')"
Include="
$(LibrariesNativeArtifactsPath)dotnet.native.worker.js"
$(LibrariesNativeArtifactsPath)dotnet.native.worker.mjs"
IsNative="true" />
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser'"
Include="
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 @@ -177,6 +177,6 @@ jobs:

# Browser WebAssembly windows
- ${{ if in(parameters.platform, 'browser_wasm_win', 'wasi_wasm_win') }}:
- (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly
- (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly-20240702174122-7aba2af

${{ insert }}: ${{ parameters.jobParameters }}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
<PlatformManifestFileEntry Include="dotnet.runtime.js.map" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.globalization.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.worker.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.worker.mjs" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.js.symbols" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.d.ts" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.wasm" IsNative="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'browser'">
<XunitShowProgress>true</XunitShowProgress>
<WasmXHarnessMaxParallelThreads>1</WasmXHarnessMaxParallelThreads>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'browser'">
<_WasmPThreadPoolUnusedSize>10</_WasmPThreadPoolUnusedSize>
<XunitShowProgress>true</XunitShowProgress>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filled #104418 I hope we can pinpoint more specific root cause with your XunitShowProgress here

</PropertyGroup>
<ItemGroup>
<Compile Include="Helpers.cs" />
Expand Down
1 change: 1 addition & 0 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'$(Scenario)' == 'gcstress0xc_jitminopts_heapverify1'">06:00:00</_workItemTimeout>
<_workItemTimeout Condition="'$(_workItemTimeout)' == '' and '$(TargetsAppleMobile)' == 'true'">01:15:00</_workItemTimeout>
<_workItemTimeout Condition="'$(_workItemTimeout)' == '' and '$(TargetOS)' == 'android'">00:30:00</_workItemTimeout>
<_workItemTimeout Condition="'$(_workItemTimeout)' == '' and '$(TargetOS)' == 'browser'">00:30:00</_workItemTimeout>
<_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)' == '' and '$(_workItemTimeout)' == '' and ('$(TestScope)' == 'outerloop' or '$(TestScope)' == 'all')">00:20:00</_workItemTimeout>
Expand Down
11 changes: 7 additions & 4 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@
</ItemGroup>
<!-- for the jiterpreter -->
<ItemGroup>
<EmccExportedRuntimeMethod Include="wasmExports" />

<EmccExportedFunction Include="_fmod" />
<EmccExportedFunction Include="_atan2" />
<EmccExportedFunction Include="_fma" />
Expand Down Expand Up @@ -277,6 +279,7 @@
<EmccStackSize>5MB</EmccStackSize>
</PropertyGroup>
<ItemGroup>
<_EmccLinkFlags Include="-Wno-unused-command-line-argument" />
<_EmccLinkFlags Include="-s INITIAL_MEMORY=$(EmccInitialHeapSize)" />
<_EmccLinkFlags Include="-s STACK_SIZE=$(EmccStackSize)" />
<_EmccCommonFlags Condition="'$(WasmEnableThreads)' == 'true'" Include="-s USE_PTHREADS=1" />
Expand All @@ -294,7 +297,7 @@
<_EmccLinkFlags Include="--source-map-base http://example.com" />
<_EmccLinkFlags Include="-s WASM_BIGINT=1" />
<_EmccLinkFlags Include="-s EXPORT_NAME=&quot;'createDotnetRuntime'&quot;" />
<_EmccLinkFlags Include="-s MODULARIZE=1"/>
<_EmccLinkFlags Include="-s MODULARIZE=1" />

<_EmccLinkFlags Include="-s ENVIRONMENT=&quot;web,webview,worker,node,shell&quot;" />
<!-- remove -Wno-limited-postlink-optimizations once below issue is fixed
Expand Down Expand Up @@ -380,7 +383,7 @@
<PInvokeTableFile>$(ArtifactsObjDir)wasm/pinvoke-table.h</PInvokeTableFile>
<InterpToNativeTableFile>$(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h</InterpToNativeTableFile>

<CMakeConfigurationEmccFlags Condition="'$(Configuration)' == 'Debug'">-g -Os -s -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1</CMakeConfigurationEmccFlags>
<CMakeConfigurationEmccFlags Condition="'$(Configuration)' == 'Debug'">-g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1</CMakeConfigurationEmccFlags>
<CMakeConfigurationEmccFlags Condition="'$(Configuration)' == 'Release'">-Oz -DENABLE_BROWSER_PROFILER=1</CMakeConfigurationEmccFlags>

<CMakeConfigurationLinkFlags Condition="'$(Configuration)' == 'Debug'" >$(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 </CMakeConfigurationLinkFlags>
Expand Down Expand Up @@ -498,9 +501,9 @@
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
SkipUnchangedFiles="true" />

<Copy SourceFiles="$(NativeBinDir)dotnet.native.worker.js"
<Copy SourceFiles="$(NativeBinDir)dotnet.native.worker.mjs"
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
Condition="Exists('$(NativeBinDir)dotnet.native.worker.js')"
Condition="Exists('$(NativeBinDir)dotnet.native.worker.mjs')"
SkipUnchangedFiles="true" />

<Copy SourceFiles="$(NativeBinDir)dotnet.native.js.symbols"
Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/build/BrowserWasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<PropertyGroup>
<_HasDotnetWasm Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.wasm'">true</_HasDotnetWasm>
<_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.js'">true</_HasDotnetJsWorker>
<_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.mjs'">true</_HasDotnetJsWorker>
<_HasDotnetJsSymbols Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.js.symbols'">true</_HasDotnetJsSymbols>
<_HasDotnetNativeJs Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.js'">true</_HasDotnetNativeJs>
<_HasDotnetGlobalizationJs Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.globalization.js'">true</_HasDotnetGlobalizationJs>
Expand All @@ -85,7 +85,7 @@
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.runtime.js" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.wasm" Condition="'$(_HasDotnetWasm)' != 'true'" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.js" Condition="'$(_HasDotnetNativeJs)' != 'true'" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.js" Condition="'$(_HasDotnetJsWorker)' != 'true' and Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.js')" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.mjs" Condition="'$(_HasDotnetJsWorker)' != 'true' and Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.mjs')" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.globalization.js"
Condition="'$(HybridGlobalization)' == 'true' and
'$(_HasDotnetGlobalizationJs)' != 'true' and
Expand Down Expand Up @@ -550,7 +550,7 @@
<ItemGroup>
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.wasm" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.js" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.worker.js" Condition="Exists('$(_WasmIntermediateOutputPath)dotnet.native.worker.js')" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.worker.mjs" Condition="Exists('$(_WasmIntermediateOutputPath)dotnet.native.worker.mjs')" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.globalization.js" Condition="'$(HybridGlobalization)' == 'true' and Exists('$(_WasmIntermediateOutputPath)dotnet.globalization.js')" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.js.symbols" Condition="'$(WasmEmitSymbolMap)' == 'true' and Exists('$(_WasmIntermediateOutputPath)dotnet.native.js.symbols')" />
<_WasmAssembliesInternal Remove="$(_WasmDedupAssembly)"/>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/emscripten-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.34
3.1.56
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set(ignoreMeEmsdkPath "${EMSDK_PATH}")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET dotnet.native
POST_BUILD COMMAND ${EMSDK_PATH}/bin/wasm-opt --enable-exception-handling ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
POST_BUILD COMMAND ${EMSDK_PATH}/bin/wasm-opt --enable-exception-handling --enable-simd --enable-bulk-memory ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe on different PR, but could we split dwarf into separate file instead of stripping it ?

COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt")
endif()

Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/runtime/cwraps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ function cwrap (name: string, returnType: string | null, argTypes: string[] | un
// Only attempt to do fast calls if all the args and the return type are either number or void
(fastCwrapTypes.indexOf(returnType) >= 0) &&
(!argTypes || argTypes.every(atype => fastCwrapTypes.indexOf(atype) >= 0)) &&
// Module["asm"] may not be defined yet if we are early enough in the startup process
// Module["wasmExports"] may not be defined yet if we are early enough in the startup process
// in that case, we need to rely on emscripten's lazy wrappers
Module["asm"]
? <Function>((<any>Module["asm"])[name])
Module["wasmExports"]
? <Function>((<any>Module["wasmExports"])[name])
: undefined;

// If the argument count for the wasm function doesn't match the signature, fall back to cwrap
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/es6/dotnet.es6.pre.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if (_nativeModuleLoaded) throw new Error("Native module already loaded");
_nativeModuleLoaded = true;
createDotnetRuntime = Module = createDotnetRuntime(Module);
createDotnetRuntime = Module = moduleArg(Module);
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/jiterpreter-jit-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function mono_interp_invoke_wasm_jit_call_trampoline (
thunk(ret_sp, sp, ftndesc, thrown);
} catch (exc: any) {
receiveWorkerHeapViews();
const exceptionTag = (<any>Module)["asm"]["__cpp_exception"];
const exceptionTag = (<any>Module)["wasmExports"]["__cpp_exception"];
const haveTag = exceptionTag instanceof (<any>WebAssembly).Tag;
if (
!haveTag || (
Expand Down
4 changes: 2 additions & 2 deletions src/mono/browser/runtime/jiterpreter-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class WasmBuilder {
}

getExceptionTag (): any {
const exceptionTag = (<any>Module)["asm"]["__cpp_exception"];
const exceptionTag = (<any>Module)["wasmExports"]["__cpp_exception"];
if (typeof (exceptionTag) !== "undefined")
mono_assert(exceptionTag instanceof (<any>WebAssembly).Tag, () => `expected __cpp_exception export from dotnet.wasm to be WebAssembly.Tag but was ${exceptionTag}`);
return exceptionTag;
Expand Down Expand Up @@ -1832,7 +1832,7 @@ export function getMemberOffset (member: JiterpMember) {
}

export function getRawCwrap (name: string): Function {
const result = (<any>Module)["asm"][name];
const result = (<any>Module)["wasmExports"][name];
if (typeof (result) !== "function")
throw new Error(`raw cwrap ${name} not found`);
return result;
Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/runtime/loader/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ export function preloadWorkers () {
const workerNumber = loaderHelpers.workerNextNumber++;
const worker: Partial<PThreadWorker> = new Worker(jsModuleWorker.resolvedUrl!, {
name: "dotnet-worker-" + workerNumber.toString().padStart(3, "0"),
type: "module",
});
worker.info = {
workerNumber,
Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/runtime/pthreads/ui-thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ function allocateUnusedWorker (): PThreadWorker {
const workerNumber = loaderHelpers.workerNextNumber++;
const worker = new Worker(uri, {
name: "dotnet-worker-" + workerNumber.toString().padStart(3, "0"),
type: "module",
}) as PThreadWorker;
getUnusedWorkerPool().push(worker);
worker.loaded = false;
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/types/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export declare interface EmscriptenModuleInternal {
FS: any;
wasmModule: WebAssembly.Instance | null;
ready: Promise<unknown>;
asm: any;
wasmExports: any;
getWasmTableEntry(index: number): any;
removeRunDependency(id: string): void;
addRunDependency(id: string): void;
Expand Down
1 change: 1 addition & 0 deletions src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public MiscTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildC
[InlineData("Debug", false)]
[InlineData("Release", true)]
[InlineData("Release", false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103566")]
public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRelink)
{
string id = $"blz_deploy_on_build_{config}_{nativeRelink}_{GetRandomId()}";
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ internal BuildPaths GetBuildPaths(BuildArgs buildArgs, bool forPublish = true)
protected static string GetSkiaSharpReferenceItems()
=> @"<PackageReference Include=""SkiaSharp"" Version=""2.88.6"" />
<PackageReference Include=""SkiaSharp.NativeAssets.WebAssembly"" Version=""2.88.6"" />
<NativeFileReference Include=""$(SkiaSharpStaticLibraryPath)\3.1.34\st\*.a"" />";
<NativeFileReference Include=""$(SkiaSharpStaticLibraryPath)\3.1.56\st\*.a"" />";

protected static string s_mainReturns42 = @"
public class TestClass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ runtimeType is RuntimeVariant.SingleThreaded
public string GetRuntimeNativeDir(string tfm = BuildTestBase.DefaultTargetFramework, RuntimeVariant runtimeType = RuntimeVariant.SingleThreaded)
=> Path.Combine(GetRuntimePackDir(tfm, runtimeType), "runtimes", DefaultRuntimeIdentifier, "native");
public bool IsMultiThreadingRuntimePackAvailableFor(string tfm)
=> IsWorkload && File.Exists(Path.Combine(GetRuntimeNativeDir(tfm, RuntimeVariant.MultiThreaded), "dotnet.native.worker.js"));
=> IsWorkload && File.Exists(Path.Combine(GetRuntimeNativeDir(tfm, RuntimeVariant.MultiThreaded), "dotnet.native.worker.mjs"));

public static string WasmOverridePacksTargetsPath = Path.Combine(TestDataPath, "WasmOverridePacks.targets");

Expand Down
1 change: 1 addition & 0 deletions src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void ProjectWithNativeReference(BuildArgs buildArgs, RunHost host, string
[Theory]
[BuildAndRun(aot: false)]
[BuildAndRun(aot: true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103566")]
public void ProjectUsingSkiaSharp(BuildArgs buildArgs, RunHost host, string id)
{
string projectName = $"AppUsingSkiaSharp";
Expand Down
Loading
Loading