Skip to content

Commit

Permalink
[NativeAOT-LLVM] add support for building WASI and browser debug & re…
Browse files Browse the repository at this point in the history
…lease on Linux (#2605)

* Add Linux WASI and browser jobs

 hard code container in matrix

update platform name

* remove container from runtimelab.yml

* reinstate and rename script extension as emcc does not use `.sh` on linux

* update platform name

* linux install of wasmtime

* Set NATIVEAOT_CI_WASM_BUILD_EMSDK_PATH

Remove wasi http implementation as it fails with

  Caused by:
      0: component imports instance `wasi:http/types@0.2.1`, but a matching implementation was not found in the linker
      1: instance export `fields` has the wrong type
      2: resource implementation is missing

* remove NATIVEAOT_CI_WASM_BUILD_EMSDK_PATH, use EMSDK

* log EMSDK and use Write-Output

* Add CI parameter

* use InstallDir/emsdk

* Update eng/testing/FindWasmHostExecutable.sh

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>

* Remove libtinfo dependency

* Change container, dropp ROOTFS env

* take upstream #106569

* Update src/tests/build.sh - thanks

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>

---------

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
  • Loading branch information
yowl and SingleAccretion authored Aug 23, 2024
1 parent 87eee57 commit c213405
Show file tree
Hide file tree
Showing 28 changed files with 278 additions and 58 deletions.
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@ if is_cygwin_or_mingw; then
scriptroot=$(cygpath -d "$scriptroot")
powershell -c "$scriptroot\\build.cmd" $@
else
if [[ "$*" == *"wasm"* && "$*" == *"-ci"* ]]; then
# This is a bit of a workaround for the fact that the pipelines do not have a great
# way of preserving the environment between scripts. Set by install-emscripten.ps1.
if [[ -n $EMSDK ]]; then
source $EMSDK/emsdk_env.sh
fi
fi
"$scriptroot/eng/build.sh" $@
fi
2 changes: 1 addition & 1 deletion eng/native/tryrun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if(DARWIN)
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!")
endif()
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86|x64)$" OR FREEBSD OR ILLUMOS OR TIZEN OR HAIKU)
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86|x64|wasm)$" OR FREEBSD OR ILLUMOS OR TIZEN OR HAIKU)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0)
set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 0)
set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0)
Expand Down
19 changes: 11 additions & 8 deletions eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,25 @@ jobs:
# Install Wasm dependencies: emscripten, LLVM, NodeJS
- ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.archType, 'wasm')) }}:
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-emscripten.ps1 $(Build.SourcesDirectory)/wasm-tools
displayName: Install/activate emscripten
- script: call $(Build.SourcesDirectory)/eng/pipelines/runtimelab/set-cmake-path.cmd
displayName: Set CMake path
# Install Powershell on OSes that don't come with it by default
- ${{ if ne(parameters.hostedOs, 'windows') }}:
- script: $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-pwsh.sh $(Build.SourcesDirectory)/wasm-tools
displayName: Install Powershell 7
- script: $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-python.sh $(Build.SourcesDirectory)/wasm-tools
displayName: set PYTHON3
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-emscripten.ps1 $(Build.SourcesDirectory)/wasm-tools -CI
displayName: Install/activate emscripten
- ${{ if eq(parameters.hostedOs, 'windows') }}:
- script: call $(Build.SourcesDirectory)/eng/pipelines/runtimelab/set-cmake-path.cmd
displayName: Set CMake path
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-llvm.ps1 -CloneDir $(Build.SourcesDirectory)/wasm-tools -Configs ${{ parameters.buildConfig }} -CI
displayName: Install/build LLVM
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-nodejs.ps1 $(Build.SourcesDirectory)\wasm-tools
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-nodejs.ps1 $(Build.SourcesDirectory)/wasm-tools
displayName: Install NodeJS

- ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.platform, 'wasi_wasm_win')) }}:
# Install Wasi Wasm dependencies: wasi-sdk, wasmer
- script: call $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-wasi-sdk.cmd $(Build.SourcesDirectory)\wasm-tools
- ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), or(eq(parameters.platform, 'wasi_wasm_win'), eq(parameters.platform, 'wasi_wasm_linux_x64_naot_llvm'))) }}:
# Install Wasi Wasm dependencies: wasi-sdk, wasmtime
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-wasi-sdk.ps1 -CI -InstallDir $(Build.SourcesDirectory)/wasm-tools
displayName: Install wasi-sdk
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-wasmtime.ps1 -CI -InstallDir $(Build.SourcesDirectory)/wasm-tools
displayName: Install wasmtime
Expand Down
42 changes: 42 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,48 @@ jobs:
buildConfig: ${{ parameters.buildConfig }}
${{ insert }}: ${{ parameters.jobParameters }}

# Browser WebAssembly Linux X64 for NAOT-LLVM

- ${{ if containsValue(parameters.platforms, 'Browser_wasm_linux_x64_naot_llvm') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: browser
archType: wasm
targetRid: browser-wasm
platform: Browser_wasm_linux_x64_naot_llvm
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_x64_sanitizer
jobParameters:
hostedOs: linux
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ insert }}: ${{ parameters.jobParameters }}

# WASI WebAssembly Linux X64 for NAOT-LLVM

- ${{ if containsValue(parameters.platforms, 'wasi_wasm_linux_x64_naot_llvm') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: wasi
archType: wasm
targetRid: wasi-wasm
platform: wasi_wasm_linux_x64_naot_llvm
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_x64_sanitizer
jobParameters:
hostedOs: linux
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ insert }}: ${{ parameters.jobParameters }}

# Browser WebAssembly

- ${{ if containsValue(parameters.platforms, 'browser_wasm') }}:
Expand Down
6 changes: 6 additions & 0 deletions eng/pipelines/runtimelab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ extends:
- windows_x64
- Browser_wasm_win
- wasi_wasm_win
# Use a different name to differentiate from upstream as we need the -sanitizer image to get build tools that are not present in the stock wasi-wasm image.
- Browser_wasm_linux_x64_naot_llvm
- wasi_wasm_linux_x64_naot_llvm
jobParameters:
timeoutInMinutes: 300
buildArgs: -s clr.aot+libs+nativeaot.packages -c debug -rc $(_BuildConfig)
Expand Down Expand Up @@ -104,6 +107,9 @@ extends:
- windows_x64
- Browser_wasm_win
- wasi_wasm_win
# Use a different name to differentiate from upstream as we need the -sanitizer image to get build tools that are not present in the stock wasi-wasm image.
- wasi_wasm_linux_x64_naot_llvm
- Browser_wasm_linux_x64_naot_llvm
jobParameters:
timeoutInMinutes: 300
buildArgs: -s clr.aot+libs+nativeaot.packages -c $(_BuildConfig) /p:ArchiveTests=true
Expand Down
11 changes: 9 additions & 2 deletions eng/pipelines/runtimelab/install-emscripten.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
param(
$InstallDir
$InstallDir,
[switch]$CI
)

$ErrorActionPreference="Stop"
Expand All @@ -17,4 +18,10 @@ git checkout ca7b40ae222a2d8763b6ac845388744b0e57cfb7
./emsdk install 3.1.56
./emsdk activate 3.1.56

Write-Host "##vso[task.setvariable variable=EMSDK]$env:EMSDK"

if ($CI)
{
Write-Host "Setting EMSDK to '$InstallDir/emsdk'"
Write-Output "##vso[task.setvariable variable=EMSDK]$InstallDir/emsdk"
}

26 changes: 25 additions & 1 deletion eng/pipelines/runtimelab/install-llvm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ else
git clone https://github.com/llvm/llvm-project --branch $LlvmProjectTag $DepthOption
}


# Set the compiler for CI on non-Windows
if (!$IsWindows) {
$RepoDir = Split-path $PSScriptRoot | Split-Path | Split-Path

bash -c "build_arch=amd64 compiler=clang source $RepoDir/eng/common/native/init-compiler.sh && set | grep -e CC -e CXX -e LDFLAGS" |
ForEach-Object {
if ($CI)
{
# Split the "<name>=<value>" line into the variable's name and value.
$name, $value = $_ -split '=', 2
# Define it as a process-level environment variable in PowerShell.
Set-Content ENV:$name $value
}
}
}

# There is no [C/c]hecked LLVM config, so change to Debug
foreach ($Config in $Configs | % { if ($_ -eq "Checked") { "Debug" } else { $_ } } | Select-Object -Unique)
{
Expand All @@ -71,7 +88,7 @@ foreach ($Config in $Configs | % { if ($_ -eq "Checked") { "Debug" } else { $_ }
$CmakeGenerator = "Unix Makefiles"
}

$CmakeConfigureCommandLine = "-G", "$CmakeGenerator", "-DLLVM_INCLUDE_BENCHMARKS=OFF"
$CmakeConfigureCommandLine = "-G", "$CmakeGenerator", "-DLLVM_INCLUDE_BENCHMARKS=OFF", "-DLLVM_ENABLE_TERMINFO=0"
$CmakeConfigureCommandLine += "-S", $SourceDirName, "-B", $BuildDirPath
if ($Config -eq "Release")
{
Expand All @@ -90,6 +107,11 @@ foreach ($Config in $Configs | % { if ($_ -eq "Checked") { "Debug" } else { $_ }
}
}
$CmakeConfigureCommandLine += "-DCMAKE_BUILD_TYPE=$LlvmConfig"

if (!$IsWindows)
{
$CmakeConfigureCommandLine += "-DCMAKE_SYSROOT=/crossrootfs/x64", "-DCMAKE_INSTALL_PREFIX=/usr/local/llvm-cross"
}

Write-Host "Invoking CMake configure: 'cmake $CmakeConfigureCommandLine'"
cmake @CmakeConfigureCommandLine
Expand Down Expand Up @@ -118,6 +140,8 @@ foreach ($Config in $Configs | % { if ($_ -eq "Checked") { "Debug" } else { $_ }
if ($CI)
{
Write-Output "##vso[task.setvariable variable=$LlvmCmakeConfigEnvVarName]$LlvmCmakeConfigPath"
# We need LLVM_DIR for Linux
Write-Output "##vso[task.setvariable variable=LLVM_DIR]$LlvmCmakeConfigPath"
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/runtimelab/install-pwsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ tar zxf powershell.tar.gz -C powershell7
# Set execute permissions
chmod +x powershell7/pwsh

echo setting PATH
echo ##vso[task.setvariable variable=PATH]$PATH:$1/powershell7
echo setting PATH $PATH:$1/powershell7
echo '##vso[task.setvariable variable=PATH]'$PATH:$1/powershell7
3 changes: 3 additions & 0 deletions eng/pipelines/runtimelab/install-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

echo '##vso[task.setvariable variable=EMSDK_PYTHON]'/usr/bin/python3
25 changes: 22 additions & 3 deletions eng/pipelines/runtimelab/install-wasi-sdk.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
$WasiSdkVersion = 24
param(
$InstallDir,
[switch]$CI
)

$WasiSdkVersion = 24
Set-Location -Path $InstallDir
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"

Expand All @@ -11,13 +16,27 @@ if ($WasiSdkVersion -lt [int]$UpstreamWasiSdkVersion)
exit
}

$WasiSdkHost = "x86_64-windows"
if ($IsWindows)
{
$WasiSdkHost = "x86_64-windows"
}
else
{
$WasiSdkHost = "x86_64-linux"
}
$WasiSdkDirName = "wasi-sdk-$WasiSdkVersion.0-$WasiSdkHost"
$WasiSdkGzFile = "$WasiSdkDirName.tar.gz"
Invoke-WebRequest -Uri "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WasiSdkVersion/$WasiSdkGzFile" -OutFile $WasiSdkGzFile

Invoke-WebRequest -Uri https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WasiSdkVersion/$WasiSdkGzFile -OutFile $WasiSdkGzFile

tar -xzf $WasiSdkGzFile
mv $WasiSdkDirName wasi-sdk

# The upstream build expects this sentinel to exist, otherwise it tries to use a provisioned SDK.
$WasiSdkVersion > wasi-sdk/"VERSION$("$WasiSdkVersion".ToUpper())"

if ($CI)
{
Write-Host "Setting WASI_SDK_PATH to '$InstallDir/wasi-sdk'"
Write-Output "##vso[task.setvariable variable=WASI_SDK_PATH]$InstallDir/wasi-sdk"
}
34 changes: 30 additions & 4 deletions eng/pipelines/runtimelab/install-wasmtime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,37 @@ $ProgressPreference = "SilentlyContinue"
Set-Location $InstallDir

$WasmtimeVersion = "v21.0.1"
$WasmtimeFolderName = "wasmtime-$WasmtimeVersion-x86_64-windows"
Invoke-WebRequest -Uri https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.1/$WasmtimeFolderName.zip -OutFile wasmtime.zip
Expand-Archive -LiteralPath wasmtime.zip -DestinationPath .

if (!(Test-Path variable:global:IsWindows))
{
$IsWindows = [Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT
}

if ($IsWIndows)
{
$WasmtimeBaseName = "wasmtime-$WasmtimeVersion-x86_64-windows"
$WasmtimeArchive = "$WasmtimeBaseName.zip"
}
else
{
$WasmtimeBaseName = "wasmtime-$WasmtimeVersion-x86_64-linux"
$WasmtimeArchive = "$WasmtimeBaseName.tar.xz"
}

Invoke-WebRequest -Uri https://github.com/bytecodealliance/wasmtime/releases/download/$WasmtimeVersion/$WasmtimeArchive -OutFile $WasmtimeArchive
if ($IsWIndows)
{
Expand-Archive -LiteralPath $WasmtimeArchive -DestinationPath .
}
else
{
New-Item -ItemType Directory -Force -Path $WasmtimeBaseName
tar -xf $WasmtimeArchive -C $WasmtimeBaseName
}

if ($CI)
{
Write-Output "##vso[task.prependpath]$pwd/$WasmtimeFolderName"
Write-Host "Setting WASMTIME_EXECUTABLE to '$pwd/$WasmtimeBaseName/$WasmtimeBaseName/wasmtime'"
Write-Output "##vso[task.setvariable variable=WASMTIME_EXECUTABLE]$pwd/$WasmtimeBaseName/$WasmtimeBaseName/wasmtime"
Write-Output "##vso[task.prependpath]$pwd/$WasmtimeBaseName"
}
17 changes: 12 additions & 5 deletions eng/pipelines/runtimelab/runtimelab-post-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
# Now we need to build the cross-targeting compilers, RyuJit and ILC. Likewise with packages.

- ${{ if eq(parameters.archType, 'wasm') }}:
- script: $(Build.SourcesDirectory)/build$(scriptExt) clr.wasmjit+clr.aot -c $(buildConfigUpper) $(_officialBuildParameter) -ci
- script: $(Build.SourcesDirectory)/build$(scriptExt) clr.wasmjit+clr.aot -c $(buildConfigUpper) $(_officialBuildParameter) -ci -cross
displayName: Build the ILC and RyuJit cross-compilers

- ${{ if and(eq(parameters.isOfficialBuild, true), eq(parameters.platform, 'browser_wasm_win')) }}:
Expand All @@ -34,9 +34,17 @@ steps:
displayName: Build WebAssembly tests
- ${{ elseif eq(parameters.platform, 'wasi_wasm_win') }}:
- script: |
call $(Build.SourcesDirectory)\wasm-tools\emsdk\emsdk_env
$(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) ${{ parameters.archType }} wasi tree nativeaot /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }}
displayName: Build WebAssembly tests
- ${{ elseif eq(parameters.platform, 'Browser_wasm_linux_x64_naot_llvm') }}:
- script: |
source $(Build.SourcesDirectory)/wasm-tools/emsdk/emsdk_env.sh
$(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) -browser tree nativeaot /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }}
displayName: Build WebAssembly tests
- ${{ elseif eq(parameters.platform, 'wasi_wasm_linux_x64_naot_llvm') }}:
- script: |
$(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) -wasi tree nativeaot /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }}
displayName: Build WebAssembly tests
- ${{ elseif eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.testFilter }} /p:NativeAotMultimodule=true /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }}
Expand All @@ -52,15 +60,14 @@ steps:
$(Build.SourcesDirectory)/src/tests/run$(scriptExt) runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.osGroup }}
displayName: Run WebAssembly tests in single file mode
- ${{ elseif eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) runnativeaottests $(buildConfigUpper) ${{ parameters.archType }}
- script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.osGroup }}
displayName: Run tests in single file mode
- ${{ else }}:
- script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }}
- script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.osGroup }}
displayName: Run tests in single file mode

- ${{ if eq(parameters.archType, 'wasm') }}:
- script: |
call $(Build.SourcesDirectory)\wasm-tools\emsdk\emsdk_env
$(Build.SourcesDirectory)/build$(scriptExt) libs.tests -test -a ${{ parameters.archType }} -os ${{ parameters.osGroup }} -lc ${{ parameters.librariesConfiguration }} -rc $(buildConfigUpper) /p:TestNativeAot=true /p:RunSmokeTestsOnly=true
displayName: Build and run WebAssembly libraries tests
Expand Down
27 changes: 27 additions & 0 deletions eng/testing/FindWasmHostExecutable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

exename=$(basename "$1" .wasm)
exename=$(basename "$exename" .dll)
exename=$(basename "$exename" .js)
dirname=$(dirname "$1")

node="node --stack_trace_limit=100"
WASM_HOST_ARGS_SEPERATOR=""

if [ -e "${dirname}/${exename}.js" ]; then
WASM_HOST_EXECUTABLE=$node
WASM_BINARY_TO_EXECUTE="${dirname}/${exename}.js"
elif [ -e "${dirname}/main.js" ]; then
WASM_HOST_EXECUTABLE=$node
WASM_BINARY_TO_EXECUTE="${dirname}/main.js"
elif [ -e "${dirname}/${exename}.mjs" ]; then
WASM_HOST_EXECUTABLE=$node
WASM_BINARY_TO_EXECUTE="${dirname}/${exename}.mjs"
elif [ -e "${dirname}/main.mjs" ]; then
WASM_HOST_EXECUTABLE=$node
WASM_BINARY_TO_EXECUTE="${dirname}/main.mjs"
elif [ -e "${dirname}/${exename}.wasm" ]; then
WASM_HOST_EXECUTABLE=$WASMTIME_EXECUTABLE
WASM_HOST_ARGS_SEPERATOR="--"
WASM_BINARY_TO_EXECUTE="${dirname}/${exename}.wasm"
fi
14 changes: 14 additions & 0 deletions eng/testing/FindWasmHostExecutableAndRun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

source $SCRIPT_DIR/FindWasmHostExecutable.sh "$1"

if [ -n "${WASM_HOST_EXECUTABLE}" ]; then
shift
echo $WASM_HOST_EXECUTABLE "$WASM_BINARY_TO_EXECUTE" $WASM_HOST_ARGS_SEPERATOR "$@"
$WASM_HOST_EXECUTABLE "$WASM_BINARY_TO_EXECUTE" $WASM_HOST_ARGS_SEPERATOR "$@"
else
echo WASM_HOST_EXECUTABLE not set.
exit 1
fi
Loading

0 comments on commit c213405

Please sign in to comment.