From 60ca737eba7e6e3c62ae0951d66368e5df5f74e6 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 22 Apr 2024 19:45:08 +0200 Subject: [PATCH 1/8] WASI_SDK_VERSION=22 WASMTIME_VERSION=19.0.2 --- eng/native/gen-buildsys.cmd | 2 +- src/mono/mono.proj | 2 +- src/mono/mono/tools/offsets-tool/offsets-tool.py | 4 +++- src/mono/wasi/wasi-sdk-version.txt | 2 +- src/mono/wasi/wasi.proj | 1 - src/mono/wasi/wasmtime-version.txt | 2 +- src/native/libs/Common/pal_error_common.h | 4 ++++ .../libs/System.Globalization.Native/pal_localeNumberData.c | 5 +++++ src/native/libs/System.Native/pal_io.c | 6 ++++++ 9 files changed, 22 insertions(+), 6 deletions(-) diff --git a/eng/native/gen-buildsys.cmd b/eng/native/gen-buildsys.cmd index f67f17b8d4794..79db6bffae062 100644 --- a/eng/native/gen-buildsys.cmd +++ b/eng/native/gen-buildsys.cmd @@ -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 ) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 8b57badb1a2e3..8a7205d8b8998 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -797,7 +797,7 @@ - + $([MSBuild]::NormalizeDirectory($(ArtifactsObjDir), 'wasmtime')) true $([MSBuild]::NormalizeDirectory($(WasmProjectRoot), 'build')) diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props index 12d6fdb34cfc5..0adbed4ac5908 100644 --- a/src/mono/Directory.Build.props +++ b/src/mono/Directory.Build.props @@ -34,10 +34,14 @@ + + $([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk')) + true diff --git a/src/mono/wasi/wasi.proj b/src/mono/wasi/wasi.proj index e5ab627de4626..311ad405db86c 100644 --- a/src/mono/wasi/wasi.proj +++ b/src/mono/wasi/wasi.proj @@ -202,6 +202,7 @@ cmake $(MSBuildThisFileDirectory)runtime cmake -G Ninja $(MSBuildThisFileDirectory)runtime + $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_TOOLCHAIN_FILE="$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot/cmake/wasi-sdk.cmake').TrimEnd('\/'))" $(CMakeBuildRuntimeConfigureCmd) -DWASI_SDK_PREFIX=$(WASI_SDK_PATH) $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_SYSROOT=$(WASI_SDK_PATH)share/wasi-sysroot $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK_PATH)share/wasi-sysroot" From 1f4591627b232ab3424a4b971d000c5c87421613 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Wed, 24 Apr 2024 16:58:24 +0200 Subject: [PATCH 4/8] more --- src/mono/Directory.Build.props | 8 +++----- src/mono/wasi/wasi.proj | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props index 0adbed4ac5908..c78557c40ef9c 100644 --- a/src/mono/Directory.Build.props +++ b/src/mono/Directory.Build.props @@ -35,13 +35,11 @@ $([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk')) - true + $([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/')) + true diff --git a/src/mono/wasi/wasi.proj b/src/mono/wasi/wasi.proj index 311ad405db86c..f38a33a400895 100644 --- a/src/mono/wasi/wasi.proj +++ b/src/mono/wasi/wasi.proj @@ -202,7 +202,7 @@ cmake $(MSBuildThisFileDirectory)runtime cmake -G Ninja $(MSBuildThisFileDirectory)runtime - $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_TOOLCHAIN_FILE="$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot/cmake/wasi-sdk.cmake').TrimEnd('\/'))" + $(CMakeBuildRuntimeConfigureCmd) --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE="$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot/cmake/wasi-sdk.cmake').TrimEnd('\/'))" $(CMakeBuildRuntimeConfigureCmd) -DWASI_SDK_PREFIX=$(WASI_SDK_PATH) $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_SYSROOT=$(WASI_SDK_PATH)share/wasi-sysroot $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK_PATH)share/wasi-sysroot" From 6dbdc8b8546b4efb41b68a514411092b20848c9d Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Wed, 24 Apr 2024 17:56:50 +0200 Subject: [PATCH 5/8] fix --- src/mono/wasi/wasi.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasi/wasi.proj b/src/mono/wasi/wasi.proj index f38a33a400895..14d4735fb3b08 100644 --- a/src/mono/wasi/wasi.proj +++ b/src/mono/wasi/wasi.proj @@ -202,7 +202,7 @@ cmake $(MSBuildThisFileDirectory)runtime cmake -G Ninja $(MSBuildThisFileDirectory)runtime - $(CMakeBuildRuntimeConfigureCmd) --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE="$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot/cmake/wasi-sdk.cmake').TrimEnd('\/'))" + $(CMakeBuildRuntimeConfigureCmd) --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE="$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/cmake/wasi-sdk.cmake').TrimEnd('\/'))" $(CMakeBuildRuntimeConfigureCmd) -DWASI_SDK_PREFIX=$(WASI_SDK_PATH) $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_SYSROOT=$(WASI_SDK_PATH)share/wasi-sysroot $(CMakeBuildRuntimeConfigureCmd) -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK_PATH)share/wasi-sysroot" From 193c553074ea3428a0fc8636ab09469578e79ca5 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Thu, 25 Apr 2024 09:33:02 +0200 Subject: [PATCH 6/8] feedback --- Directory.Build.props | 2 +- src/mono/Directory.Build.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 6f2dcdfb2557c..4728a73a7871d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -180,7 +180,7 @@ $([MSBuild]::NormalizePath('$(TestExclusionListTasksDir)', 'TestExclusionListTasks.dll')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfiguration)')) $(CoreCLRToolPath) - $([MSBuild]::NormalizeDirectory($(ArtifactsObjDir), 'wasmtime')) diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props index c78557c40ef9c..d97bf84a1da66 100644 --- a/src/mono/Directory.Build.props +++ b/src/mono/Directory.Build.props @@ -34,7 +34,7 @@ - $([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk')) From 0a8f3d1ce061172800f19a6fc4ce6741ef988bc1 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Thu, 25 Apr 2024 12:02:55 +0200 Subject: [PATCH 7/8] feedback --- src/mono/mono.proj | 2 +- src/mono/wasi/wasi.proj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 5f97018096d06..df6216b62f065 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -797,7 +797,7 @@ - +