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

[WASI] update SDK 22 and wasmtime 19.0.2 #101392

Merged
merged 9 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@
<TestExclusionListTasksAssemblyPath>$([MSBuild]::NormalizePath('$(TestExclusionListTasksDir)', 'TestExclusionListTasks.dll'))</TestExclusionListTasksAssemblyPath>
<CoreCLRToolPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfiguration)'))</CoreCLRToolPath>
<ILAsmToolPath Condition="'$(DotNetBuildSourceOnly)' == 'true' or '$(BuildArchitecture)' == 's390x' or '$(BuildArchitecture)' == 'ppc64le'">$(CoreCLRToolPath)</ILAsmToolPath>
<!-- force download for testing the PR
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
<WasmtimeDir Condition="'$(WasmtimeDir)' == '' and '$(WASMTIME_PATH)' != '' and Exists($(WASMTIME_PATH))">$(WASMTIME_PATH)</WasmtimeDir>
-->
<WasmtimeDir Condition="'$(WasmtimeDir)' == ''">$([MSBuild]::NormalizeDirectory($(ArtifactsObjDir), 'wasmtime'))</WasmtimeDir>
<InstallWasmtimeForTests Condition="'$(InstallWasmtimeForTests)' == '' and !Exists($(WasmtimeDir))">true</InstallWasmtimeForTests>
<WasmCommonTargetsPath>$([MSBuild]::NormalizeDirectory($(WasmProjectRoot), 'build'))</WasmCommonTargetsPath>
Expand Down
2 changes: 1 addition & 1 deletion eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if /i "%__Arch%" == "wasm" (
if /i "%__Os%" == "wasi" (
if "%WASI_SDK_PATH%" == "" (
if not exist "%__repoRoot%\src\mono\wasi\wasi-sdk" (
echo Error: Should set WASI_SDK_PATH environment variable pointing to emsdk root.
echo Error: Should set WASI_SDK_PATH environment variable pointing to WASI SDK root.
exit /B 1
)

Expand Down
2 changes: 1 addition & 1 deletion eng/testing/tests.wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessTestsTimeout)' != ''" >$(_XHarnessArgs) &quot;--timeout=$(WasmXHarnessTestsTimeout)&quot;</_XHarnessArgs>
<_XHarnessArgs >$(_XHarnessArgs) --engine-arg=--max-wasm-stack=134217728</_XHarnessArgs>
<_XHarnessArgs >$(_XHarnessArgs) --engine-arg=-W --engine-arg=max-wasm-stack=134217728</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessArgsCli)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgsCli)</_XHarnessArgs>

<_InvariantGlobalization Condition="'$(InvariantGlobalization)' == 'true'">--env=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true</_InvariantGlobalization>
Expand Down
8 changes: 5 additions & 3 deletions src/mono/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@

<!-- Directory to provision and use WASI sdk if WASI_SDK_PATH env variable is not set -->
<PropertyGroup Condition="'$(TargetsWasi)' == 'true'">
<_ProvisionWasiSdkDir>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</_ProvisionWasiSdkDir>
<ShouldProvisionWasiSdk Condition="'$(WASI_SDK_PATH)' == '' and !Exists($(_ProvisionWasiSdkDir))">true</ShouldProvisionWasiSdk>
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$(_ProvisionWasiSdkDir)</WASI_SDK_PATH>
<!-- force download for testing the PR
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
-->
<WASI_SDK_PATH>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
<WASI_SDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/'))</WASI_SDK_PATH>
<ShouldProvisionWasiSdk Condition="!Exists($(_ProvisionWasiSdkDir))">true</ShouldProvisionWasiSdk>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@
<MonoAotCrossOffsetsToolParams Condition="'$(MonoAotOffsetsPrefix)' != ''" Include="--prefix=&quot;$(MonoAotOffsetsPrefix)&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(MonoAotCMakeSysroot)' != ''" Include="--sysroot=&quot;$(MonoAotCMakeSysroot)&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsBrowser)' == 'true'" Include="--emscripten-sdk=&quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'upstream', 'emscripten').TrimEnd('\/'))&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsWasi)' == 'true'" Include="--wasi-sdk=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)').TrimEnd('\/'))&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsWasi)' == 'true'" Include="--sysroot=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot').TrimEnd('\/'))&quot; --wasi-sdk=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)').TrimEnd('\/'))&quot;" />
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<!--
Expand Down
4 changes: 3 additions & 1 deletion src/mono/mono/tools/offsets-tool/offsets-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ def require_emscipten_path (args):

if "wasm" in args.abi:
if args.wasi_path != None:
self.sys_includes = [args.wasi_path + "/share/wasi-sysroot/include", args.wasi_path + "/lib/clang/17/include", args.mono_path + "/wasi/mono-include"]
require_sysroot (args)
self.sys_includes = [args.wasi_path + "/share/wasi-sysroot/include", args.wasi_path + "/lib/clang/18/include", args.mono_path + "/wasi/mono-include"]
self.target = Target ("TARGET_WASI", None, ["TARGET_WASM"] + WASI_DEFINES)
self.target_args += ["-target", args.abi]
self.target_args += ["--sysroot", args.sysroot]
else:
require_emscipten_path (args)
clang_path = os.path.dirname(args.libclang)
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasi/wasi-sdk-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21
22
2 changes: 1 addition & 1 deletion src/mono/wasi/wasi.proj
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@
<CMakeBuildRuntimeConfigureCmd>cmake $(MSBuildThisFileDirectory)runtime</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd Condition="'$(OS)' == 'Windows_NT'">cmake -G Ninja $(MSBuildThisFileDirectory)runtime</CMakeBuildRuntimeConfigureCmd>

<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/cmake/wasi-sdk.cmake').TrimEnd('\/'))&quot;</CMakeBuildRuntimeConfigureCmd>
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) -DWASI_SDK_PREFIX=$(WASI_SDK_PATH)</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) -DCMAKE_SYSROOT=$(WASI_SDK_PATH)share/wasi-sysroot</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK_PATH)share/wasi-sysroot"</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) -DCMAKE_TOOLCHAIN_FILE=$(WASI_SDK_PATH)share/cmake/wasi-sdk.cmake</CMakeBuildRuntimeConfigureCmd>

<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_WASICC_FLAGS=&quot;$(CMakeConfigurationWasiFlags)&quot;</CMakeBuildRuntimeConfigureCmd>
<CMakeBuildRuntimeConfigureCmd>$(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_LINK_FLAGS=&quot;$(CMakeConfigurationLinkFlags)&quot;</CMakeBuildRuntimeConfigureCmd>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasi/wasmtime-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
19.0.2
4 changes: 4 additions & 0 deletions src/native/libs/Common/pal_error_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ inline static int32_t ConvertErrorPlatformToPal(int32_t platformErrno)
case EWOULDBLOCK:
return Error_EWOULDBLOCK;
#endif
default:
break; // fall through to error
}

return Error_ENONSTANDARD;
Expand Down Expand Up @@ -528,6 +530,8 @@ inline static int32_t ConvertErrorPalToPlatform(int32_t error)

case Error_ENONSTANDARD:
break; // fall through to assert
default:
break; // fall through to assert
}

// We should not use this function to round-trip platform -> pal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static char* NormalizeNumericPattern(const UChar* srcPattern, int isNegative)
case UCHAR_CLOSEPAREN:
minusAdded = true;
break;
default:
break;
}
}

Expand Down Expand Up @@ -145,6 +147,9 @@ static char* NormalizeNumericPattern(const UChar* srcPattern, int isNegative)
case UCHAR_PERCENT:
destPattern[index++] = '%';
break;

default:
break;
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/native/libs/System.Native/pal_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
#elif HAVE_SYS_STATVFS_H && !HAVE_NON_LEGACY_STATFS // SunOS
#include <sys/types.h>
#include <sys/statvfs.h>
#if HAVE_STATFS_VFS
#include <sys/vfs.h>
#endif
#endif

#ifdef _AIX
#include <alloca.h>
Expand Down Expand Up @@ -1050,6 +1052,8 @@ int32_t SystemNative_MAdvise(void* address, uint64_t length, int32_t advice)
errno = ENOTSUP;
return -1;
#endif
default:
break; // fall through to error
}

assert_msg(false, "Unknown MemoryAdvice", (int)advice);
Expand Down Expand Up @@ -1087,6 +1091,8 @@ int64_t SystemNative_SysConf(int32_t name)
return sysconf(_SC_CLK_TCK);
case PAL_SC_PAGESIZE:
return sysconf(_SC_PAGESIZE);
default:
break; // fall through to error
}

assert_msg(false, "Unknown SysConf name", (int)name);
Expand Down
Loading