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] Use source built emsdk packages for the runtime build #100266

Merged
merged 47 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
bf309cf
Use the emsdk transport packages to build wasm instead of a cloned emsdk
steveisok Mar 19, 2024
411fcb5
Pull in node transport package as opposed to the one packaged in emsd…
steveisok Mar 20, 2024
1964d80
Make paths friendly for windows
steveisok Mar 20, 2024
b8e1d17
Work in windows transport packages, copy python to its own directory,…
steveisok Mar 21, 2024
35d78ba
Bump to latest version of node that contains icu
steveisok Mar 25, 2024
86b0487
Add windows deps and add DOTNET_EMSCRIPTEN_NODE_PATH because windows …
steveisok Mar 25, 2024
bad7dd2
Bump emscripten packages to the latest
steveisok Mar 26, 2024
e2de97e
Fix typos in Version.Details.xml
akoeplinger Mar 26, 2024
70cc1ef
Switch out to the plain mariner container to ensure no EMSDK already …
steveisok Mar 26, 2024
b73b48c
Revert back to the browser-wasm docker image and bump to the latest
steveisok Mar 26, 2024
ebcbd2c
Container type-o
steveisok Mar 27, 2024
107934a
Fix condition where the node path isn't set properly
steveisok Mar 28, 2024
cd1b7e6
Provision even when building offsets
steveisok Mar 28, 2024
d912622
Fix goofy paths
steveisok Mar 29, 2024
7b5f544
Update new template to use the latest browser-wasm container
steveisok Apr 2, 2024
58a4164
Don't put python.exe on the path for windows, but the folder instead
steveisok Apr 2, 2024
d4e980e
So that was a bad idea. May have to have emsdk_env.cmd have two entries
steveisok Apr 3, 2024
f3aad8a
Fix offsets generation for browser
radekdoulik Apr 12, 2024
47b2f73
Fix emsdk's python path
radekdoulik Apr 15, 2024
d19b395
Fix EMSDK_PATH on non-windows platforms
radekdoulik Apr 15, 2024
eb19ade
Do not add link flags to compile flags
radekdoulik Apr 15, 2024
16043ad
Set the emsdk paths relative to the script location
radekdoulik Apr 17, 2024
64453f5
Escape few characters and fix the added script
radekdoulik Apr 17, 2024
ba83f8e
Fix .emscripten script
radekdoulik Apr 18, 2024
d26a6ec
Use EM_CONFIG intead of __file__
radekdoulik Apr 18, 2024
f456ba5
Fix emsdk_env.cmd script
radekdoulik Apr 18, 2024
4ce27ec
Revert "Do not add link flags to compile flags"
radekdoulik Apr 23, 2024
ba2e34f
Merge remote-tracking branch 'remotes/origin/main' into test-build-wasm
radekdoulik Apr 23, 2024
e1a7372
Revert changes in package-lock.json
radekdoulik Apr 23, 2024
3c17d1f
Feedback + cleaning
radekdoulik Apr 23, 2024
b417733
Merge branch 'main' into test-build-wasm
radekdoulik Apr 23, 2024
a62a857
More cleaning
radekdoulik Apr 25, 2024
667eaf5
Try not to use the replace in the EMSDK_PATH
radekdoulik Apr 25, 2024
6d3514a
Merge branch 'main' into test-build-wasm
radekdoulik Apr 25, 2024
278fbd7
Better property names
radekdoulik Apr 29, 2024
b25fbd6
Use package and emsdk version properties
radekdoulik Apr 29, 2024
0fc71cf
Use the updated properties
radekdoulik Apr 29, 2024
8a71663
Fix emsdk version
radekdoulik Apr 29, 2024
afe1b08
Merge branch 'main' into test-build-wasm
radekdoulik Apr 30, 2024
1d4b923
Merge branch 'main' into test-build-wasm
radekdoulik Apr 30, 2024
b46a6a9
Merge branch 'main' into test-build-wasm
lewing Apr 30, 2024
e976299
Merge branch 'main' into test-build-wasm
radekdoulik May 1, 2024
48b0006
Use a single version of emsdk and take node version from flow
lewing May 7, 2024
6513926
Merge branch 'main' into test-build-wasm
lewing May 7, 2024
8672523
Merge branch 'main' into test-build-wasm
lewing May 8, 2024
7c1b7c3
Update eng/Version.Details.xml
radekdoulik May 9, 2024
543fe48
Merge branch 'main' into test-build-wasm
radekdoulik May 9, 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
80 changes: 80 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,85 @@
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>dc43d363d284c26cb1b463683d6ebb2c88ab0b58</Sha>
</Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.osx-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.osx-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.win-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.linux-x64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.linux-arm64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-arm64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.osx-x64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.osx-arm64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.win-x64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.win-arm64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.linux-x64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.linux-arm64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.osx-x64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.osx-arm64" Version="9.0.0-preview.4.24175.6">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2106e0604f52119b7d49577476ece7d51a23a40d</Sha>
</Dependency>
radekdoulik marked this conversation as resolved.
Show resolved Hide resolved
</ToolsetDependencies>
</Dependencies>
21 changes: 21 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,26 @@
<!-- installer version, for testing workloads -->
<MicrosoftDotnetSdkInternalVersion>9.0.100-preview.4.24175.5</MicrosoftDotnetSdkInternalVersion>
<SdkVersionForWorkloadTesting>$(MicrosoftDotnetSdkInternalVersion)</SdkVersionForWorkloadTesting>
<MicrosoftNETRuntimeEmscripten3134Nodeosxarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Nodeosxarm64Version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use a common variable for all of these duplicates? It would make it stand out more visually when one of them has to be a different version for some reason

<MicrosoftNETRuntimeEmscripten3134Sdkosxarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Sdkosxarm64Version>
<MicrosoftNETRuntimeEmscripten3134Sdkosxx64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Sdkosxx64Version>
<MicrosoftNETRuntimeEmscripten3134Sdkwinx64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Sdkwinx64Version>
<MicrosoftNETRuntimeEmscripten3134Sdkwinarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Sdkwinarm64Version>
<MicrosoftNETRuntimeEmscripten3134Sdklinuxx64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Sdklinuxx64Version>
<MicrosoftNETRuntimeEmscripten3134Sdklinuxarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Sdklinuxarm64Version>
<MicrosoftNETRuntimeEmscripten3134Cachelinuxx64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Cachelinuxx64Version>
<MicrosoftNETRuntimeEmscripten3134Cachelinuxarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Cachelinuxarm64Version>
<MicrosoftNETRuntimeEmscripten3134Cacheosxx64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Cacheosxx64Version>
<MicrosoftNETRuntimeEmscripten3134Cacheosxarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Cacheosxarm64Version>
<MicrosoftNETRuntimeEmscripten3134Cachewinx64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Cachewinx64Version>
<MicrosoftNETRuntimeEmscripten3134Cachewinarm64Version>9.0.0-preview.4.24175.6</MicrosoftNETRuntimeEmscripten3134Cachewinarm64Version>
<runtimelinuxarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimelinuxarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimelinuxmuslarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimelinuxmuslarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimelinuxx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimelinuxx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimelinuxmuslx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimelinuxmuslx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimeosxarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimeosxarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimeosxx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimeosxx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimewinarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimewinarm64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
<runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>9.0.0-alpha.1.24175.1</runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportVersion>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if /i "%__Arch%" == "wasm" (
set "EMSDK_PATH=!EMSDK_PATH:\=/!"
if not "!EMSDK_PATH:~-1!" == "/" set "EMSDK_PATH=!EMSDK_PATH!/"

set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_TOOLCHAIN_FILE=!EMSDK_PATH!/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_TOOLCHAIN_FILE=!EMSDK_PATH!/emscripten/cmake/Modules/Platform/Emscripten.cmake"
set __UseEmcmake=1
)
if /i "%__Os%" == "wasi" (
Expand Down Expand Up @@ -107,7 +107,7 @@ if not "%__ConfigureOnly%" == "1" (
)

if /i "%__UseEmcmake%" == "1" (
call "!EMSDK_PATH!/emsdk_env.bat" > nul 2>&1 && emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
call "!EMSDK_PATH!/emsdk_env.cmd" > nul 2>&1 && emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
) else (
"%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
)
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/templates/pipeline-with-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ extends:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8

browser_wasm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-webassembly-20230913040940-1edc1c6
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-webassembly
Copy link
Member

Choose a reason for hiding this comment

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

is there anything else left in the -webassembly image that we need or can we switch to the plain mariner image?

Copy link
Member

Choose a reason for hiding this comment

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

Wasmtime and WASI SDK (which we ignore at the moment)?

Copy link
Member

Choose a reason for hiding this comment

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

isn't that for the wasi leg? I think this only deals with browser

Copy link
Member

Choose a reason for hiding this comment

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

I have opened #102069 to try that. I am not sure whether we still run some tests with v8.

env:
ROOTFS_DIR: /crossrootfs/x64

Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ build-app-host:
$(DOTNET) build $(TOP)/src/mono/wasm/host $(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)

patch-deterministic:
cd emsdk/upstream/emscripten/ && patch -p1 < ../../../runtime/deterministic.diff
cd emsdk/emscripten/ && patch -p1 < ../../../runtime/deterministic.diff
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment explaining why this is here, while you're touching it. The diff isn't self-explanatory

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, the gist is that if you clone emsdk and install, it'll pull a bunch of things and put them in the 'upstream' directory. Our source built packages don't have this directory structure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I mean that deterministic.diff isn't self-explanatory

Copy link
Member

Choose a reason for hiding this comment

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

it predates this PR. it was added by #75532, not sure what was the context there. @lewing do you remember?

Copy link
Member

Choose a reason for hiding this comment

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

This was something Zoltan used to make the each run deterministic so that he could do direct comparisons, it is only for development/testing

6 changes: 3 additions & 3 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<_EmccDefaultsRspPath>$(NativeBinDir)src\emcc-default.rsp</_EmccDefaultsRspPath>
<_EmccCompileRspPath>$(NativeBinDir)src\emcc-compile.rsp</_EmccCompileRspPath>
<_EmccLinkRspPath>$(NativeBinDir)src\emcc-link.rsp</_EmccLinkRspPath>
<EmSdkLLVMAr>$(EMSDK_PATH)\upstream\bin\llvm-ar</EmSdkLLVMAr>
<EmSdkLLVMAr>$(EMSDK_PATH)\bin\llvm-ar</EmSdkLLVMAr>
<EmSdkLLVMAr Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(EmSdkLLVMAr).exe</EmSdkLLVMAr>
</PropertyGroup>

Expand Down Expand Up @@ -394,12 +394,12 @@
<CMakeBuildRuntimeConfigureCmd Condition="'$(WasmEnableJsInteropByValue)' == 'true'">$(CMakeBuildRuntimeConfigureCmd) -DENABLE_JS_INTEROP_BY_VALUE=1</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) $(CMakeConfigurationEmsdkPath)</CMakeBuildRuntimeConfigureCmd>

<CMakeBuildRuntimeConfigureCmd Condition="'$(OS)' == 'Windows_NT'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; &amp;&amp; call &quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))&quot; &amp;&amp; $(CMakeBuildRuntimeConfigureCmd)</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd Condition="'$(OS)' == 'Windows_NT'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; &amp;&amp; call &quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.cmd'))&quot; &amp;&amp; $(CMakeBuildRuntimeConfigureCmd)</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd Condition="'$(OS)' != 'Windows_NT'">bash -c 'source $(EMSDK_PATH)/emsdk_env.sh 2>&amp;1 &amp;&amp; $(CMakeBuildRuntimeConfigureCmd)'</CMakeBuildRuntimeConfigureCmd>

<CMakeOptions Condition="'$(MonoVerboseBuild)' != ''">-v</CMakeOptions>
<CMakeBuildRuntimeCmd>cmake --build . --config $(Configuration) $(CmakeOptions)</CMakeBuildRuntimeCmd>
<CMakeBuildRuntimeCmd Condition="'$(OS)' == 'Windows_NT'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; &amp;&amp; call &quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))&quot; &amp;&amp; $(CMakeBuildRuntimeCmd)</CMakeBuildRuntimeCmd>
<CMakeBuildRuntimeCmd Condition="'$(OS)' == 'Windows_NT'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; &amp;&amp; call &quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.cmd'))&quot; &amp;&amp; $(CMakeBuildRuntimeCmd)</CMakeBuildRuntimeCmd>
<CMakeBuildRuntimeCmd Condition="'$(OS)' != 'Windows_NT'">bash -c 'source $(EMSDK_PATH)/emsdk_env.sh 2>&amp;1 &amp;&amp; $(CMakeBuildRuntimeCmd)'</CMakeBuildRuntimeCmd>
</PropertyGroup>
<ItemGroup>
Expand Down
14 changes: 5 additions & 9 deletions src/mono/browser/build/EmSdkRepo.Defaults.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@

<PropertyGroup>
<EmscriptenSdkToolsPath>$([MSBuild]::EnsureTrailingSlash($(EMSDK_PATH)))</EmscriptenSdkToolsPath>
<EmscriptenUpstreamBinPath>$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'upstream', 'bin'))</EmscriptenUpstreamBinPath>
<EmscriptenUpstreamEmscriptenPath>$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'upstream', 'emscripten'))</EmscriptenUpstreamEmscriptenPath>

<_NodeToolsBasePath>$(EmscriptenSdkToolsPath)node</_NodeToolsBasePath>
<EmscriptenUpstreamBinPath>$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'bin'))</EmscriptenUpstreamBinPath>
<EmscriptenUpstreamEmscriptenPath>$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'emscripten'))</EmscriptenUpstreamEmscriptenPath>

<!-- gets the path like emsdk/python/3.7.4-2_64bit -->
<_NodeToolsVersionedPath Condition="Exists($(_NodeToolsBasePath))">$([System.IO.Directory]::GetDirectories($(_NodeToolsBasePath)))</_NodeToolsVersionedPath>
<EmscriptenNodeToolsPath Condition="'$(_NodeToolsVersionedPath)' != ''">$(_NodeToolsVersionedPath)</EmscriptenNodeToolsPath>
<EmscriptenNodeToolsPath Condition="'$(EmscriptenNodeToolsPath)' != ''">$([MSBuild]::NormalizeDirectory($(EmscriptenNodeToolsPath)))</EmscriptenNodeToolsPath>
<EmscriptenNodeToolsPath Condition="'$(EmscriptenNodeToolsPath)' == ''">$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'node', 'bin'))</EmscriptenNodeToolsPath>

<_UsingEMSDK_PATH>true</_UsingEMSDK_PATH>
</PropertyGroup>
Expand All @@ -31,9 +27,9 @@
<ItemGroup>
<EmscriptenPrependPATH Include="$(EmscriptenSdkToolsPath)" />
<EmscriptenPrependPATH Include="$(EmscriptenUpstreamBinPath)" />
<EmscriptenPrependPATH Include="$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'upstream', 'emscripten'))" />
<EmscriptenPrependPATH Include="$([MSBuild]::NormalizeDirectory($(EmscriptenSdkToolsPath), 'emscripten'))" />

<EmscriptenPrependPATH Include="$(EmscriptenNodeToolsPath)bin" />
<EmscriptenPrependPATH Include="$(EmscriptenNodeToolsPath)" />
</ItemGroup>

<ItemGroup Condition="'$(EmscriptenPythonToolsPath)' != ''">
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set(ignoreMeEmsdkPath "${EMSDK_PATH}")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET dotnet.native
POST_BUILD COMMAND ${EMSDK_PATH}/upstream/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 ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt")
endif()

Expand Down
Loading
Loading