Skip to content

Commit 812cb93

Browse files
authored
[WASI] use WASI_SDK22_PATH variable (#104379)
1 parent 61050ae commit 812cb93

File tree

20 files changed

+94
-68
lines changed

20 files changed

+94
-68
lines changed

eng/native/gen-buildsys.cmd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,20 @@ if /i "%__Arch%" == "wasm" (
6060
set __UseEmcmake=1
6161
)
6262
if /i "%__Os%" == "wasi" (
63-
if "%WASI_SDK_PATH%" == "" (
63+
set "__repoRoot=!__repoRoot:\=/!"
64+
if "%WASI_SDK22_PATH%" == "" (
6465
if not exist "%__repoRoot%\src\mono\wasi\wasi-sdk" (
65-
echo Error: Should set WASI_SDK_PATH environment variable pointing to WASI SDK root.
66+
echo Error: Should set WASI_SDK22_PATH environment variable pointing to WASI SDK root.
6667
exit /B 1
6768
)
6869

69-
set "WASI_SDK_PATH=%__repoRoot%\src\mono\wasi\wasi-sdk"
70+
set "WASI_SDK22_PATH=%__repoRoot%\src\mono\wasi\wasi-sdk"
7071
)
7172
:: replace backslash with forward slash and append last slash
72-
set "WASI_SDK_PATH=!WASI_SDK_PATH:\=/!"
73-
if not "!WASI_SDK_PATH:~-1!" == "/" set "WASI_SDK_PATH=!WASI_SDK_PATH!/"
73+
set "WASI_SDK22_PATH=!WASI_SDK22_PATH:\=/!"
74+
if not "!WASI_SDK22_PATH:~-1!" == "/" set "WASI_SDK22_PATH=!WASI_SDK22_PATH!/"
7475
set __CmakeGenerator=Ninja
75-
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK_PATH!/share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK_PATH!/share/wasi-sysroot"
76+
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK22_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK22_PATH!share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK22_PATH!share/wasi-sysroot"
7677
)
7778
) else (
7879
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0"

eng/native/gen-buildsys.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55

66
scriptroot="$( cd -P "$( dirname "$0" )" && pwd )"
7+
reporoot="$(cd "$scriptroot"/../..; pwd -P)"
78

89
if [[ "$#" -lt 4 ]]; then
910
echo "Usage..."
@@ -97,7 +98,7 @@ if [[ "$host_arch" == "wasm" ]]; then
9798
if [[ "$target_os" == "browser" ]]; then
9899
cmake_command="emcmake $cmake_command"
99100
elif [[ "$target_os" == "wasi" ]]; then
100-
true
101+
cmake_extra_defines="$cmake_extra_defines -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm -DWASI_SDK_PREFIX=$WASI_SDK22_PATH -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK22_PATH}share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=${WASI_SDK22_PATH}share/wasi-sysroot"
101102
else
102103
echo "target_os was not specified"
103104
exit 1

eng/testing/tests.wasi.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
>true</InstallWasmtimeForTests>
1414

1515
<!--<InstallWorkloadUsingArtifactsDependsOn>_GetWorkloadsToInstall;$(InstallWorkloadUsingArtifactsDependsOn)</InstallWorkloadUsingArtifactsDependsOn>-->
16-
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
16+
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
17+
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
1718

1819
<_BundleAOTTestWasmAppForHelixDependsOn>$(_BundleAOTTestWasmAppForHelixDependsOn);PrepareForWasiBuildApp;_PrepareForAOTOnHelix</_BundleAOTTestWasmAppForHelixDependsOn>
1920
</PropertyGroup>

src/libraries/sendtohelix-wasi.targets

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
<IncludeHelixCorrelationPayload>false</IncludeHelixCorrelationPayload>
4747
<EnableDefaultBuildHelixWorkItems>false</EnableDefaultBuildHelixWorkItems>
4848

49-
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$(RepoRoot)src\mono\wasi\wasi-sdk\</WASI_SDK_PATH>
49+
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(RepoRoot), 'src', 'mono', 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
50+
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
5051
<WasiBuildTargetsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasi', 'build'))</WasiBuildTargetsDir>
5152
<WasiSdkDirForHelixPayload>$(HelixDependenciesStagingPath)$(WorkItemPrefix)wasi-sdk</WasiSdkDirForHelixPayload>
5253
<WasmtimeDirForHelixPayload>$(HelixDependenciesStagingPath)$(WorkItemPrefix)wasmtime</WasmtimeDirForHelixPayload>
@@ -63,7 +64,7 @@
6364
</PropertyGroup>
6465

6566
<ItemGroup>
66-
<HelixDependenciesToStage Condition="'$(NeedsWasiSdk)' == 'true'" SourcePath="$(WASI_SDK_PATH)" Include="$(WasiSdkDirForHelixPayload)" />
67+
<HelixDependenciesToStage Condition="'$(NeedsWasiSdk)' == 'true'" SourcePath="$(WASI_SDK22_PATH)" Include="$(WasiSdkDirForHelixPayload)" />
6768
<HelixDependenciesToStage Condition="'$(NeedsWasmtime)' == 'true'" SourcePath="$(WasmtimeDir)" Include="$(WasmtimeDirForHelixPayload)" />
6869
</ItemGroup>
6970

@@ -73,7 +74,7 @@
7374
<HelixPreCommand Include="export XHARNESS_LOG_WITH_TIMESTAMPS=true" />
7475
<HelixPreCommand Include="export WASMTIME_BACKTRACE_DETAILS=1" />
7576
<HelixPreCommand Condition="'$(NeedsWasmtime)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/wasmtime:$PATH" />
76-
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/wasi-sdk:$PATH" />
77+
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/build/wasi-sdk/bin:$PATH" />
7778
</ItemGroup>
7879

7980
<ItemGroup Condition="'$(WindowsShell)' == 'true'">
@@ -82,7 +83,7 @@
8283
<HelixPreCommand Include="set XHARNESS_LOG_WITH_TIMESTAMPS=true" />
8384
<HelixPreCommand Include="set WASMTIME_BACKTRACE_DETAILS=1" />
8485
<HelixPreCommand Condition="'$(NeedsWasmtime)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\wasmtime%3B%PATH%" />
85-
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\wasi-sdk%3B%PATH%" />
86+
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\build\wasi-sdk\bin%3B%PATH%" />
8687
</ItemGroup>
8788

8889
<PropertyGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
@@ -92,8 +93,8 @@
9293
</PropertyGroup>
9394

9495
<ItemGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
95-
<HelixPreCommand Condition="'$(WindowsShell)' == 'true'" Include="set &quot;WASI_SDK_PATH=%HELIX_CORRELATION_PAYLOAD%\build\wasi-sdk&quot;" />
96-
<HelixPreCommand Condition="'$(WindowsShell)' != 'true'" Include="export &quot;WASI_SDK_PATH=$HELIX_CORRELATION_PAYLOAD/build/wasi-sdk&quot;" />
96+
<HelixPreCommand Condition="'$(WindowsShell)' == 'true'" Include="set &quot;WASI_SDK22_PATH=%HELIX_CORRELATION_PAYLOAD%\build\wasi-sdk&quot;" />
97+
<HelixPreCommand Condition="'$(WindowsShell)' != 'true'" Include="export &quot;WASI_SDK22_PATH=$HELIX_CORRELATION_PAYLOAD/build/wasi-sdk&quot;" />
9798
</ItemGroup>
9899

99100
<PropertyGroup Condition="'$(NeedsWasiSdk)' == 'true'">

src/libraries/sendtohelixhelp.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
<!--
356356
Helix tasks will attempt to write a .payload file to the payload directory. But if the
357357
directory is not writable, for example when it is a system installed dependency like
358-
`WASI_SDK_PATH=/usr/local/wasi-sdk`
358+
`WASI_SDK22_PATH=/usr/local/wasi-sdk`
359359
.. then we need to stage that before passing the path to helix like under `artifacts/obj/helix-staging`
360360
-->
361361
<Target Name="StageDependenciesForHelix" Condition="@(__HelixDependenciesToStageThatDontExist->Count()) > 0">

src/mono/Directory.Build.props

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@
3232
<EMSDK_PATH Condition="Exists('$(ProvisionEmscriptenDir)') and '$(EMSDK_PATH)' == ''">$(ProvisionEmscriptenDir.Replace('\', '/'))</EMSDK_PATH>
3333
</PropertyGroup>
3434

35-
<!-- Directory to provision and use WASI sdk if WASI_SDK_PATH env variable is not set -->
35+
<!-- Directory to provision and use WASI sdk if WASI_SDK22_PATH env variable is not set -->
3636
<PropertyGroup Condition="'$(TargetsWasi)' == 'true'">
37-
<!-- force download temmporarily https://github.com/dotnet/runtime/issues/101528
38-
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
39-
-->
40-
<WASI_SDK_PATH>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
41-
<WASI_SDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/'))</WASI_SDK_PATH>
42-
<ShouldProvisionWasiSdk Condition="!Exists($(_ProvisionWasiSdkDir))">true</ShouldProvisionWasiSdk>
37+
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
38+
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
39+
<ShouldProvisionWasiSdk Condition="!Exists($(WASI_SDK22_PATH))">true</ShouldProvisionWasiSdk>
4340
</PropertyGroup>
4441

4542
<PropertyGroup>

src/mono/mono.proj

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<Error Condition="('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true') and !$([MSBuild]::IsOSPlatform('OSX'))" Text="Error: $(TargetOS) can only be built on macOS." />
126126
<Error Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(Platform)' != 'arm64' and '$(Platform)' != 'arm'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
127127
<Error Condition="'$(TargetsBrowser)' == 'true' and '$(EMSDK_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The EMSDK_PATH environment variable should be set pointing to the emscripten SDK root dir."/>
128-
<Error Condition="'$(TargetsWasi)' == 'true' and '$(WASI_SDK_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The WASI_SDK_PATH environment variable should be set pointing to the WASI SDK root dir."/>
128+
<Error Condition="'$(TargetsWasi)' == 'true' and '$(WASI_SDK22_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The WASI_SDK22_PATH environment variable should be set pointing to the WASI SDK root dir."/>
129129
<Error Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(ANDROID_NDK_ROOT)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root." />
130130
<Error Condition="'$(HostOS)' == 'windows' and ('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true')" Text="Error: Mono runtime for $(TargetOS) can't be built on Windows." />
131131

@@ -302,7 +302,7 @@ JS_ENGINES = [NODE_JS]
302302
</PropertyGroup>
303303
</Target>
304304

305-
<!-- Sets up WASI SDK if you don't have the WASI_SDK_PATH env variable set -->
305+
<!-- Sets up WASI SDK if you don't have the WASI_SDK22_PATH env variable set -->
306306
<Target Name="ProvisionWasiSdk"
307307
Condition="'$(ShouldProvisionWasiSdk)' == 'true' and '$(SkipMonoCrossJitConfigure)' != 'true'">
308308
<ReadLinesFromFile File="$(MSBuildThisFileDirectory)/wasi/wasi-sdk-version.txt">
@@ -317,20 +317,36 @@ JS_ENGINES = [NODE_JS]
317317
<WasiSdkUrl Condition="'$(HostOS)' == 'windows'" >https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0.m-mingw.tar.gz</WasiSdkUrl>
318318
</PropertyGroup>
319319

320-
<RemoveDir Directories="$(WASI_SDK_PATH)" />
321-
<Exec Command="curl -L -o wasi-sdk-$(WasiSdkVersion).0.tar.gz $(WasiSdkUrl) &amp;&amp; mkdir -p $(WASI_SDK_PATH) &amp;&amp; tar --strip-components=1 -xzf wasi-sdk-$(WasiSdkVersion).0.tar.gz -C $(WASI_SDK_PATH) &amp;&amp; cp $(WasiLocalPath)/wasi-sdk-version.txt $(WASI_SDK_PATH)/wasi-sdk-version.txt"
320+
<RemoveDir Directories="$(WASI_SDK22_PATH)" />
321+
<Exec Command="curl -L -o wasi-sdk-$(WasiSdkVersion).0.tar.gz $(WasiSdkUrl) &amp;&amp; mkdir -p $(WASI_SDK22_PATH) &amp;&amp; tar --strip-components=1 -xzf wasi-sdk-$(WasiSdkVersion).0.tar.gz -C $(WASI_SDK22_PATH) &amp;&amp; cp $(WasiLocalPath)/wasi-sdk-version.txt $(WASI_SDK22_PATH)wasi-sdk-version.txt"
322322
Condition="'$(HostOS)' != 'windows'"
323323
WorkingDirectory="$(ArtifactsObjDir)"
324324
IgnoreStandardErrorWarningFormat="true" />
325325

326-
<Exec Command="powershell -NonInteractive -command &quot;&amp; $(WasiLocalPath)\provision.ps1 -WasiSdkUrl $(WasiSdkUrl) -WasiSdkVersion $(WasiSdkVersion) -WasiSdkPath $(WASI_SDK_PATH) -WasiLocalPath $(WasiLocalPath); Exit $LastExitCode &quot;"
326+
<!--
327+
Temporary WASI-SDK 22 workaround #2: The version of `wasm-component-ld` that
328+
ships with WASI-SDK 22 contains a
329+
[bug](https://github.com/bytecodealliance/wasm-component-ld/issues/22) which
330+
has been fixed in a v0.5.3 of that utility, so we upgrade it here.
331+
-->
332+
<Exec Command="curl -L -o wasm-component-ld-v0.5.4-x86_64-linux.tar.gz https://github.com/bytecodealliance/wasm-component-ld/releases/download/v0.5.4/wasm-component-ld-v0.5.4-x86_64-linux.tar.gz &amp;&amp; mkdir -p $(WASI_SDK22_PATH)wasm-component &amp;&amp; tar --strip-components=1 -xzf wasm-component-ld-v0.5.4-x86_64-linux.tar.gz -C $(WASI_SDK22_PATH)wasm-component &amp;&amp; cp $(WASI_SDK22_PATH)wasm-component/wasm-component-ld $(WASI_SDK22_PATH)bin/wasm-component-ld"
333+
Condition="'$(HostOS)' != 'windows'"
334+
WorkingDirectory="$(ArtifactsObjDir)"
335+
IgnoreStandardErrorWarningFormat="true" />
336+
337+
<Exec Command="powershell -NonInteractive -command &quot;&amp; $(WasiLocalPath)\provision.ps1 -WasiSdkUrl $(WasiSdkUrl) -WasiSdkVersion $(WasiSdkVersion) -WasiSdkPath $(WASI_SDK22_PATH) -WasiLocalPath $(WasiLocalPath); Exit $LastExitCode &quot;"
327338
Condition="'$(HostOS)' == 'windows'"
328339
WorkingDirectory="$(ArtifactsObjDir)"
329340
IgnoreStandardErrorWarningFormat="true" />
341+
342+
<Copy SourceFiles="$(MSBuildThisFileDirectory)/wasi/wasi-sdk/share/wasi-sysroot/include/wasm32-wasi-threads/pthread.h"
343+
DestinationFiles="$(MSBuildThisFileDirectory)/wasi/wasi-sdk/share/wasi-sysroot/include/wasm32-wasip2/pthread.h"
344+
/>
345+
330346
</Target>
331347

332348
<Target Name="ValidateWasiSdk" Condition="'$(SkipMonoCrossJitConfigure)' != 'true'">
333-
<ReadLinesFromFile File="$(WASI_SDK_PATH)/wasi-sdk-version.txt">
349+
<ReadLinesFromFile File="$(WASI_SDK22_PATH)wasi-sdk-version.txt">
334350
<Output TaskParameter="Lines" ItemName="_ActualVersionLines" />
335351
</ReadLinesFromFile>
336352
<ReadLinesFromFile File="$(MSBuildThisFileDirectory)/wasi/wasi-sdk-version.txt">
@@ -340,7 +356,7 @@ JS_ENGINES = [NODE_JS]
340356
<ActualWasiSdkVersion>%(_ActualVersionLines.Identity)</ActualWasiSdkVersion>
341357
<ExpectedWasiSdkVersion>%(_ExpectedVersionLines.Identity)</ExpectedWasiSdkVersion>
342358
</PropertyGroup>
343-
<Error Text="Expected version: %(_ExpectedVersionLines.Identity) and actual version: %(_ActualVersionLines.Identity) of WASI SDK does not match. Please delete $(WASI_SDK_PATH) folder to provision a new version."
359+
<Error Text="Expected version: %(_ExpectedVersionLines.Identity) and actual version: %(_ActualVersionLines.Identity) of WASI SDK does not match. Please delete $(WASI_SDK22_PATH) folder to provision a new version."
344360
Condition="'$(ActualWasiSdkVersion)' != '$(ExpectedWasiSdkVersion)'" />
345361
</Target>
346362

@@ -722,13 +738,14 @@ JS_ENGINES = [NODE_JS]
722738

723739
<PropertyGroup>
724740
<EMSDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(EMSDK_PATH)').Replace('\', '/'))</EMSDK_PATH>
725-
<WASI_SDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/'))</WASI_SDK_PATH>
741+
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
742+
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
726743
<_EmsdkEnvScriptPath>$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env$(ScriptExt)'))</_EmsdkEnvScriptPath>
727744

728745
<_MonoCMakeConfigureCommand>cmake @(_MonoCMakeArgs, ' ') $(MonoCMakeExtraArgs) &quot;$(MonoProjectRoot.TrimEnd('\/'))&quot;</_MonoCMakeConfigureCommand>
729746
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true' and '$(_MonoSkipInitCompiler)' != 'true' and '$(HostOS)' != 'windows'">sh -c 'build_arch=&quot;$(_CompilerTargetArch)&quot; compiler=&quot;$(MonoCCompiler)&quot; . &quot;$(RepositoryEngineeringCommonDir)native/init-compiler.sh&quot; &amp;&amp; @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)'</_MonoCMakeConfigureCommand>
730747
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true' and '$(_MonoSkipInitCompiler)' == 'true' and '$(HostOS)' != 'windows'">$(_MonoCCOption) $(_MonoCXXOption) @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)</_MonoCMakeConfigureCommand>
731-
<_MonoCMakeConfigureCommand Condition="'$(TargetsWasi)' == 'true'">$(_MonoCMakeConfigureCommand) -DWASI_SDK_PREFIX=$(WASI_SDK_PATH) -DCMAKE_SYSROOT=$(WASI_SDK_PATH)share/wasi-sysroot -DCMAKE_TOOLCHAIN_FILE=$(WASI_SDK_PATH)share/cmake/wasi-sdk.cmake -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK_PATH)share/wasi-sysroot"</_MonoCMakeConfigureCommand>
748+
<_MonoCMakeConfigureCommand Condition="'$(TargetsWasi)' == 'true'">$(_MonoCMakeConfigureCommand) -DWASI_SDK_PREFIX=$(WASI_SDK22_PATH) -DCMAKE_SYSROOT=$(WASI_SDK22_PATH)share/wasi-sysroot -DCMAKE_TOOLCHAIN_FILE=$(WASI_SDK22_PATH)share/cmake/wasi-sdk.cmake -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK22_PATH)share/wasi-sysroot"</_MonoCMakeConfigureCommand>
732749

733750
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true' and '$(HostOS)' == 'windows'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; $(_CompilerTargetArch) &amp;&amp; cd /D &quot;$(MonoObjDir)&quot; &amp;&amp; @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)</_MonoCMakeConfigureCommand>
734751
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' == 'true' and '$(HostOS)' != 'windows'">bash -c 'source $(_EmsdkEnvScriptPath) 2>&amp;1 &amp;&amp; emcmake $(_MonoCMakeConfigureCommand)'</_MonoCMakeConfigureCommand>
@@ -924,7 +941,7 @@ JS_ENGINES = [NODE_JS]
924941
<MonoAotCrossOffsetsToolParams Condition="'$(MonoAotOffsetsPrefix)' != ''" Include="--prefix=&quot;$(MonoAotOffsetsPrefix)&quot;" />
925942
<MonoAotCrossOffsetsToolParams Condition="'$(MonoAotCMakeSysroot)' != ''" Include="--sysroot=&quot;$(MonoAotCMakeSysroot)&quot;" />
926943
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsBrowser)' == 'true'" Include="--emscripten-sdk=&quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emscripten').TrimEnd('\/'))&quot;" />
927-
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsWasi)' == 'true'" Include="--sysroot=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot'))&quot; --wasi-sdk=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)').TrimEnd('\/'))&quot;" />
944+
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsWasi)' == 'true'" Include="--sysroot=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK22_PATH)', 'share/wasi-sysroot'))&quot; --wasi-sdk=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK22_PATH)').TrimEnd('\/'))&quot;" />
928945
</ItemGroup>
929946

930947
<!--

0 commit comments

Comments
 (0)