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

Bump the wasi-sdk to 22.0 #967

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

jsturtevant
Copy link
Collaborator

This updates to the latest version and also works towards removing EMSDK for the c# generator (dotnet/runtimelab#2592)

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant requested a review from dicej June 6, 2024 18:39
Copy link
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

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

Looks like the Windows CI job is still running as I type this. I'll be interested to see if we need to change anything in the NuGet or csproj config to get the latest build of the NativeAOT-LLVM packages or if that will just happen automatically.

@alexcrichton alexcrichton added this pull request to the merge queue Jun 6, 2024
@yowl
Copy link
Collaborator

yowl commented Jun 6, 2024

just happen automatically.

Should do, we use 9.0.0-* so until .net 9 goes out (when we will go to 10) we should be fine.

@dicej
Copy link
Collaborator

dicej commented Jun 6, 2024

Oops, I just realized: we should use wasi-sdk-22.0.m-mingw64.tar.gz instead of wasi-sdk-22.0.m-mingw.tar.gz, since that will help us avoid WebAssembly/wasi-sdk#326

@jsturtevant
Copy link
Collaborator Author

Oops, I just realized: we should use wasi-sdk-22.0.m-mingw64.tar.gz instead of wasi-sdk-22.0.m-mingw.tar.gz, since that will help us avoid https://github.com/WebAssembly/wasi-sdk/issues/326Oops, I just realized: we should use wasi-sdk-22.0.m-mingw64.tar.gz instead of wasi-sdk-22.0.m-mingw.tar.gz, since that will help us avoid WebAssembly/wasi-sdk#326

I can address that in a followup. I was going to open up a PR to use clang instead of emscripten for

<Target Name=\"CompileCabiRealloc\" BeforeTargets=\"IlcCompile\" DependsOnTargets=\"CheckWasmSdks\"
Inputs=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c\"
Outputs=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.o\"
>
<Exec Command=\"emcc.bat &quot;$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c&quot; -c -o &quot;$(MSBuildProjectDirectory)/{camel}_cabi_realloc.o&quot;\"/>
</Target>

Merged via the queue into bytecodealliance:main with commit 1960055 Jun 6, 2024
12 checks passed
@dicej
Copy link
Collaborator

dicej commented Jun 6, 2024

This is what I did locally for testing, FWIW:

                 <Target Name="CheckWasmSdks">
-                    <Error Text="Emscripten not found, not compiling to WebAssembly. To enable WebAssembly compilation, install Emscripten and ensure the EMSDK environment variable points to the directory containing upstream/emscripten/emcc.bat"
-                        Condition="'$(EMSDK)' == ''" />
+                    <Error Text="Wasi SDK not found, not compiling to WebAssembly. To enable WebAssembly compilation, install Wasi SDK and ensure the WASI_SDK_PATH environment variable points to the directory containing share/wasi-sysroot"
+                           Condition="'$(WASI_SDK_PATH)' == ''" />
+                    <Warning Text="The WASI SDK version is too low. Please use WASI SDK 22 or newer with a 64 bit Clang."
+                             Condition="!Exists('$(WASI_SDK_PATH)/VERSION')" />
                 </Target>
                 "#,
             );
@@ -115,7 +117,7 @@ impl CSProjectLLVMBuilder {
                 Inputs=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c\"
                 Outputs=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.o\"
                 >
-                <Exec Command=\"emcc.bat &quot;$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c&quot; -c -o &quot;$(MSBuildProjectDirectory)/{camel}_cabi_realloc.o&quot;\"/>
+                <Exec Command=\"&quot;$(WASI_SDK_PATH)/bin/clang&quot; --target=wasm32-wasi &quot;$(MSBuildProjectDirectory)/{camel}_cabi_realloc.c&quot; -c -o &quot;$(MSBuildProjectDirectory)/{camel}_cabi_realloc.o&quot;\"/>
               </Target>
             "
             ));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants