Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
44 changes: 33 additions & 11 deletions .github/actions/install-wasi-sdk-wabt/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ inputs:
os:
description: "Operating system to install on (ubuntu, macos)"
required: true
# Default 29 because addr2line.py (samples/debug-tools*) requires
# llvm-symbolizer / llvm-addr2line, which only ship in wasi-sdk 29+.
# Callers can pin a different version when they have a specific need.
wasi_sdk_version:
description: "wasi-sdk major version to install (e.g. '25', '29', '33')"
required: false
default: "29"

runs:
using: "composite"
Expand All @@ -29,13 +36,17 @@ runs:
- name: Set up wasi-sdk and wabt on Ubuntu
if: ${{ startsWith(inputs.os, 'ubuntu') }}
shell: bash
env:
SDK_VER: ${{ inputs.wasi_sdk_version }}
run: |
SDK_DIR="wasi-sdk-${SDK_VER}.0-x86_64-linux"
echo "Downloading wasi-sdk for Ubuntu..."
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga \
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${SDK_VER}/${SDK_DIR}.tar.gz"

echo "Extracting wasi-sdk..."
sudo tar -xf wasi-sdk.tar.gz
sudo ln -sf wasi-sdk-25.0-x86_64-linux/ wasi-sdk
sudo ln -sf "${SDK_DIR}/" wasi-sdk

echo "Downloading wabt for Ubuntu..."
sudo wget -O wabt.tar.gz --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/1.0.37/wabt-1.0.37-ubuntu-20.04.tar.gz
Expand All @@ -47,19 +58,23 @@ runs:
/opt/wasi-sdk/bin/clang --version
/opt/wabt/bin/wasm-interp --version

echo "::notice::wasi-sdk-25 and wabt-1.0.37 installed on ubuntu"
echo "::notice::wasi-sdk-${SDK_VER} and wabt-1.0.37 installed on ubuntu"
working-directory: /opt

- name: Set up wasi-sdk and wabt on macOS on Intel
if: ${{ inputs.os == 'macos-15-intel' }}
shell: bash
env:
SDK_VER: ${{ inputs.wasi_sdk_version }}
run: |
SDK_DIR="wasi-sdk-${SDK_VER}.0-x86_64-macos"
echo "Downloading wasi-sdk for macOS on Intel..."
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-macos.tar.gz
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga \
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${SDK_VER}/${SDK_DIR}.tar.gz"

echo "Extracting wasi-sdk..."
sudo tar -xf wasi-sdk.tar.gz
sudo ln -sf wasi-sdk-25.0-x86_64-macos wasi-sdk
sudo ln -sf "${SDK_DIR}" wasi-sdk

echo "Downloading wabt for macOS on Intel..."
sudo wget -O wabt.tar.gz --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/1.0.36/wabt-1.0.36-macos-12.tar.gz
Expand All @@ -71,19 +86,23 @@ runs:
/opt/wasi-sdk/bin/clang --version
/opt/wabt/bin/wasm-interp --version

echo "::notice::wasi-sdk-25 and wabt-1.0.36 installed on ${{ inputs.os }}"
echo "::notice::wasi-sdk-${SDK_VER} and wabt-1.0.36 installed on ${{ inputs.os }}"
working-directory: /opt

- name: Set up wasi-sdk and wabt on macOS on ARM
if: ${{ inputs.os == 'macos-15' }}
shell: bash
env:
SDK_VER: ${{ inputs.wasi_sdk_version }}
run: |
SDK_DIR="wasi-sdk-${SDK_VER}.0-arm64-macos"
echo "Downloading wasi-sdk for macOS on ARM..."
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-arm64-macos.tar.gz
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga \
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${SDK_VER}/${SDK_DIR}.tar.gz"

echo "Extracting wasi-sdk..."
sudo tar -xf wasi-sdk.tar.gz
sudo ln -sf wasi-sdk-25.0-arm64-macos wasi-sdk
sudo ln -sf "${SDK_DIR}" wasi-sdk

echo "Downloading wabt for macOS on ARM..."
sudo wget -O wabt.tar.gz --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/1.0.37/wabt-1.0.37-macos-14.tar.gz
Expand All @@ -95,20 +114,23 @@ runs:
/opt/wasi-sdk/bin/clang --version
/opt/wabt/bin/wasm-interp --version

echo "::notice::wasi-sdk-25 and wabt-1.0.37 installed on ${{ inputs.os }}"
echo "::notice::wasi-sdk-${SDK_VER} and wabt-1.0.37 installed on ${{ inputs.os }}"
working-directory: /opt

- name: Set up wasi-sdk and wabt on Windows
if: ${{ startsWith(inputs.os, 'windows') }}
shell: bash
env:
SDK_VER: ${{ inputs.wasi_sdk_version }}
run: |
choco install -y wget

mkdir -p /opt/wasi-sdk
mkdir -p /opt/wabt

echo "Downloading wasi-sdk for Windows..."
wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-windows.tar.gz
wget -O wasi-sdk.tar.gz --progress=dot:giga \
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${SDK_VER}/wasi-sdk-${SDK_VER}.0-x86_64-windows.tar.gz"

echo "Extracting wasi-sdk..."
tar --strip-components=1 -xf wasi-sdk.tar.gz -C /opt/wasi-sdk
Expand All @@ -122,4 +144,4 @@ runs:
/opt/wasi-sdk/bin/clang --version
/opt/wabt/bin/wasm-interp --version

echo "::notice::wasi-sdk-25 and wabt-1.0.37 installed on Windows"
echo "::notice::wasi-sdk-${SDK_VER} and wabt-1.0.37 installed on Windows"
64 changes: 37 additions & 27 deletions .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ jobs:
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

# since jobs.id can't contain the dot character
# it is hard to use `format` to assemble the cache key
- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -271,13 +271,13 @@ jobs:
extra_options: "-DWAMR_BUILD_SIMD=0"
steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

# only download llvm cache when needed
- name: Get LLVM libraries
id: retrieve_llvm_libs
if: endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS')
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -322,13 +322,13 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3
with:
submodules: recursive

- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -381,11 +381,11 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -446,12 +446,12 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: Get LLVM libraries
id: retrieve_llvm_libs
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -503,11 +503,11 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -602,9 +602,29 @@ jobs:
mkdir build && cd build
cmake ..
cmake --build . --config Debug --parallel 4
./iwasm wasm-apps/trap.wasm | grep "#" > call_stack.txt
./iwasm wasm-apps/trap.aot | grep "#" > call_stack_aot.txt
bash -x ../symbolicate.sh
cd ..
./verify.sh

- name: Install binaryen (for debug-tools-optimized)
run: |
sudo mkdir -p /opt/binaryen
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_117/binaryen-version_117-x86_64-linux.tar.gz \
| sudo tar xz -C /opt/binaryen --strip-components=1
/opt/binaryen/bin/wasm-opt --version

- name: Build Sample [debug-tools-optimized]
run: |
cd samples/debug-tools-optimized
for INTERP_FLAG in "" "-DUSE_FAST_INTERP=ON"; do
rm -rf build && mkdir build && cd build
cmake .. $INTERP_FLAG
make -j$(nproc)
cd ..
./verify.sh oob wasm
./verify.sh oob aot
./verify.sh stackoverflow wasm
./verify.sh stackoverflow aot
done

- name: Build Sample [native-stack-overflow]
run: |
Expand Down Expand Up @@ -677,7 +697,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
Expand Down Expand Up @@ -707,21 +727,11 @@ jobs:
&& matrix.running_mode != 'fast-jit' && matrix.running_mode != 'jit' && matrix.running_mode != 'multi-tier-jit')
run: echo "TEST_ON_X86_32=true" >> $GITHUB_ENV

- name: Free up disk space
if: env.USE_LLVM == 'true'
run: |
# Restoring the prebuilt LLVM libraries cache overflows the runner's
# small default free space and fails with "no space left on device".
# Drop preinstalled toolchains this job never uses (~20 GB freed).
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/share/boost
df -h /

#only download llvm libraries in jit and aot mode
- name: Get LLVM libraries
if: env.USE_LLVM == 'true'
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/compilation_on_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ jobs:
llvm_cache_key: ${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}
steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -191,13 +191,13 @@ jobs:
extra_options: "-DWAMR_BUILD_SIMD=0"
steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

# only download llvm cache when needed
- name: Get LLVM libraries
id: retrieve_llvm_libs
if: endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS')
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -253,12 +253,12 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: Get LLVM libraries
id: retrieve_llvm_libs
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
llvm_cache_key: ${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}
steps:
- name: checkout
uses: actions/checkout@v7.0.0
uses: actions/checkout@v6.0.3

- name: install-wasi-sdk-wabt
uses: ./.github/actions/install-wasi-sdk-wabt
Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:

- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v6
uses: actions/cache@v5
with:
path: |
./core/deps/llvm/build/bin
Expand Down Expand Up @@ -413,9 +413,8 @@ jobs:
mkdir build && cd build
cmake ..
cmake --build . --config Debug --parallel 4
./iwasm wasm-apps/trap.wasm | grep "#" > call_stack.txt
./iwasm wasm-apps/trap.aot | grep "#" > call_stack_aot.txt
bash -x ../symbolicate.sh
cd ..
./verify.sh

- name: Build Sample [native-stack-overflow]
run: |
Expand Down
Loading
Loading