Skip to content

Commit

Permalink
Merge pull request #3741 from bytecodealliance/main
Browse files Browse the repository at this point in the history
Merge branch main into dev/checkpoint_and_restore
  • Loading branch information
wenyongh authored Aug 21, 2024
2 parents d51fdcc + 67dce48 commit 9443854
Show file tree
Hide file tree
Showing 97 changed files with 5,807 additions and 1,283 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/install_qemu_xtensa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/sh

set -e

URL=https://github.com/espressif/qemu/releases/download/esp-develop-9.0.0-20240606/qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-x86_64-linux-gnu.tar.xz

DIR=$(mktemp -d)
cd ${DIR}
curl -fLsS "${URL}" | xzcat | tar -x
ln -s ${DIR}/qemu/bin/qemu-system-xtensa /usr/local/bin/qemu-system-xtensa
14 changes: 11 additions & 3 deletions .github/workflows/build_llvm_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ on:
container_image:
required: false
type: string
extra_build_llvm_options:
required: false
type: string
default: ""
cache_key_suffix:
required: false
type: string
default: ""
outputs:
cache_key:
description: "A cached key of LLVM libraries"
Expand Down Expand Up @@ -45,7 +53,7 @@ jobs:

- name: retrieve the last commit ID
id: get_last_commit
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py --llvm-ver)" >> $GITHUB_OUTPUT
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --llvm-ver)" >> $GITHUB_OUTPUT
working-directory: build-scripts

# Bump the prefix number to evict all previous caches and
Expand All @@ -54,7 +62,7 @@ jobs:
# suspect.
- name: form the cache key of libraries
id: create_lib_cache_key
run: echo "key=0-llvm-libraries-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.get_last_commit.outputs.last_commit }}" >> $GITHUB_OUTPUT
run: echo "key=0-llvm-libraries-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.get_last_commit.outputs.last_commit }}${{ inputs.cache_key_suffix }}" >> $GITHUB_OUTPUT

- name: Cache LLVM libraries
id: retrieve_llvm_libs
Expand Down Expand Up @@ -101,5 +109,5 @@ jobs:

- name: Build LLVM libraries
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
run: /usr/bin/env python3 ./build_llvm.py --arch ${{ inputs.arch }}
run: /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --arch ${{ inputs.arch }}
working-directory: build-scripts
6 changes: 3 additions & 3 deletions .github/workflows/build_wamr_vscode_ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x

- name: set vscode extension to correct version
run: |
Expand All @@ -33,7 +33,7 @@ jobs:

- name: generate wamr ide vscode extension
run: |
npm install -g vsce
npm install -g @vscode/vsce
rm -rf node_modules
npm install
vsce package
Expand Down
44 changes: 36 additions & 8 deletions .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ env:
WAMR_COMPILER_TEST_OPTIONS: "-s wamr_compiler -S -b -P"
GC_TEST_OPTIONS: "-s spec -G -b -P"
MEMORY64_TEST_OPTIONS: "-s spec -W -b -P"
MULTI_MEMORY_TEST_OPTIONS: "-s spec -E -b -P"

jobs:
build_llvm_libraries_on_ubuntu_2204:
Expand Down Expand Up @@ -148,6 +149,7 @@ jobs:
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
]
os: [ubuntu-22.04]
platform: [android, linux]
Expand Down Expand Up @@ -206,11 +208,9 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
# Memory64 only on CLASSIC INTERP mode, and only on 64-bit platform
# Memory64 only on CLASSIC INTERP and AOT mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
Expand All @@ -221,6 +221,21 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
# Multi memory only on CLASSIC INTERP mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
# Fast-JIT and Multi-Tier-JIT mode don't support android
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
platform: android
Expand Down Expand Up @@ -593,6 +608,7 @@ jobs:
$WASI_TEST_OPTIONS,
$GC_TEST_OPTIONS,
$MEMORY64_TEST_OPTIONS,
$MULTI_MEMORY_TEST_OPTIONS,
]
wasi_sdk_release:
[
Expand Down Expand Up @@ -640,18 +656,30 @@ jobs:
test_option: $MEMORY64_TEST_OPTIONS
- running_mode: "multi-tier-jit"
test_option: $MEMORY64_TEST_OPTIONS
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
- running_mode: "aot"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "fast-interp"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "fast-jit"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "jit"
test_option: $MULTI_MEMORY_TEST_OPTIONS
- running_mode: "multi-tier-jit"
test_option: $MULTI_MEMORY_TEST_OPTIONS

steps:
- name: checkout
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option == '$GC_TEST_OPTIONS'
with:
ocaml-compiler: 4.13

- name: Set-up Ocamlbuild
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option == '$GC_TEST_OPTIONS'
run: opam install ocamlbuild dune menhir

- name: download and install wasi-sdk
Expand Down Expand Up @@ -717,13 +745,13 @@ jobs:

- name: run tests
timeout-minutes: 30
if: matrix.test_option != '$GC_TEST_OPTIONS' && matrix.test_option != '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option != '$GC_TEST_OPTIONS'
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites

- name: run gc or memory64 tests
- name: run gc tests
timeout-minutes: 20
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
if: matrix.test_option == '$GC_TEST_OPTIONS'
run: |
eval $(opam env)
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
Expand Down
47 changes: 26 additions & 21 deletions .github/workflows/compilation_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,31 @@ jobs:
# arm64
"boards/arm64/qemu/qemu-armv8a/configs/nsh",
]
wamr_config_option: [
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
]

wamr_config_option:
- "CONFIG_INTERPRETERS_WAMR_AOT"
- "CONFIG_INTERPRETERS_WAMR_FAST"
- "CONFIG_INTERPRETERS_WAMR_CLASSIC"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST CONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC CONFIG_INTERPRETERS_WAMR_LIBC_WASI"

steps:
- name: Checkout NuttX
uses: actions/checkout@v4
with:
repository: apache/nuttx
ref: releases/12.4
ref: releases/12.6
path: nuttx

- name: Checkout NuttX Apps
uses: actions/checkout@v4
with:
repository: apache/nuttx-apps
ref: releases/12.4
ref: releases/12.6
path: apps

- name: Checkout WAMR
Expand All @@ -102,16 +101,22 @@ jobs:
repository: ${{ github.repository }}
path: apps/interpreters/wamr/wamr

- name: Enable WAMR for NuttX
- name: Configure WAMR
working-directory: nuttx
run: |
find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\n${{ matrix.wamr_config_option }}'
find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
tools/configure.sh ${{ matrix.nuttx_board_config }}
kconfig-tweak --enable CONFIG_PSEUDOFS_SOFTLINKS
kconfig-tweak --enable CONFIG_INTERPRETERS_WAMR
kconfig-tweak --enable CONFIG_INTERPRETERS_IWASM_TASK
kconfig-tweak --set-val CONFIG_INTERPRETERS_WAMR_PRIORITY 100
kconfig-tweak --set-val CONFIG_INTERPRETERS_WAMR_STACKSIZE 8192
for x in ${{ matrix.wamr_config_option }}; do
kconfig-tweak --enable $x
done
- name: Build
run: |
cd nuttx
tools/configure.sh ${{ matrix.nuttx_board_config }}
make -j$(nproc) EXTRAFLAGS=-Werror
working-directory: nuttx
run: make -j$(nproc) EXTRAFLAGS=-Werror

- name: Checkout Bloaty
uses: actions/checkout@v3
Expand Down
43 changes: 30 additions & 13 deletions .github/workflows/nightly_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
]
os: [ubuntu-20.04]
platform: [android, linux]
Expand Down Expand Up @@ -190,11 +191,9 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
# Memory64 only on CLASSIC INTERP mode, and only on 64-bit platform
# Memory64 only on CLASSIC INTERP and AOT mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
Expand All @@ -205,6 +204,21 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
# Multi memory only on CLASSIC INTERP mode, and only on 64-bit platform
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
platform: android
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
# Fast-JIT and Multi-Tier-JIT mode don't support android
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
platform: android
Expand Down Expand Up @@ -289,6 +303,7 @@ jobs:
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
"-DWAMR_BUILD_MEMORY64=1",
"-DWAMR_BUILD_MULTI_MEMORY=1",
]
exclude:
# incompatible feature and platform
Expand Down Expand Up @@ -322,17 +337,19 @@ jobs:
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
# Memory64 only on CLASSIC INTERP mode
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
steps:
- name: checkout
uses: actions/checkout@v3

- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: apt update && apt install -y make g++-4.8 gcc-4.8 wget git
on_retry_command: sudo rm -r /var/lib/apt/lists/*
run: |
apt update && apt install -y make g++-4.8 gcc-4.8 wget git
- name: checkout
run: |
git clone https://github.com/${{ github.repository }} wamr
- name: Install cmake
run: |
Expand All @@ -345,7 +362,7 @@ jobs:
mkdir build && cd build
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }} -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8
cmake --build . --config Release --parallel 4
working-directory: product-mini/platforms/linux
working-directory: wamr/product-mini/platforms/linux

build_samples_wasm_c_api:
needs:
Expand Down
Loading

0 comments on commit 9443854

Please sign in to comment.