Skip to content

Commit

Permalink
Remove the emscripten compiler and rely on wasi-sdk
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
  • Loading branch information
jsturtevant committed Jun 6, 2024
1 parent 1960055 commit 038b4cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-wasi-sdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
if: runner.os == 'macOS'
shell: bash
- run: |
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0.m-mingw.tar.gz -L | tar xzvf -
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0.m-mingw64.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-22.0+m" >> $GITHUB_ENV
if: runner.os == 'Windows'
shell: bash
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ jobs:
echo $LOCALAPPDATA'\Microsoft\dotnet' >> $GITHUB_PATH
echo $LOCALAPPDATA'\Microsoft\dotnet\tools' >> $GITHUB_PATH
$LOCALAPPDATA/Microsoft/dotnet/dotnet --info
echo nativeaot-llvm requires emscripten for its version of clang as wasi-sdk 20 does not work see https://github.com/WebAssembly/wasi-sdk/issues/326
curl.exe -OL https://github.com/emscripten-core/emsdk/archive/refs/heads/main.zip
unzip main.zip
cd emsdk-main
./emsdk.bat install 3.1.47
./emsdk.bat activate 3.1.47
if : matrix.os == 'windows-latest'
- run: ci/download-teavm.sh
Expand Down
8 changes: 5 additions & 3 deletions crates/csharp/src/csproj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ impl CSProjectLLVMBuilder {
</ItemGroup>
<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>
"#,
);
Expand All @@ -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>
"
));
Expand Down

0 comments on commit 038b4cd

Please sign in to comment.