Skip to content

Commit 5164aca

Browse files
authored
Merge pull request #3737 from bytecodealliance/main
Merge branch main into dev/shared_heap
2 parents 57f2661 + 67dce48 commit 5164aca

97 files changed

Lines changed: 5807 additions & 1283 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /bin/sh
2+
3+
set -e
4+
5+
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
6+
7+
DIR=$(mktemp -d)
8+
cd ${DIR}
9+
curl -fLsS "${URL}" | xzcat | tar -x
10+
ln -s ${DIR}/qemu/bin/qemu-system-xtensa /usr/local/bin/qemu-system-xtensa

.github/workflows/build_llvm_libraries.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ on:
1414
container_image:
1515
required: false
1616
type: string
17+
extra_build_llvm_options:
18+
required: false
19+
type: string
20+
default: ""
21+
cache_key_suffix:
22+
required: false
23+
type: string
24+
default: ""
1725
outputs:
1826
cache_key:
1927
description: "A cached key of LLVM libraries"
@@ -45,7 +53,7 @@ jobs:
4553

4654
- name: retrieve the last commit ID
4755
id: get_last_commit
48-
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py --llvm-ver)" >> $GITHUB_OUTPUT
56+
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
4957
working-directory: build-scripts
5058

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

5967
- name: Cache LLVM libraries
6068
id: retrieve_llvm_libs
@@ -101,5 +109,5 @@ jobs:
101109

102110
- name: Build LLVM libraries
103111
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
104-
run: /usr/bin/env python3 ./build_llvm.py --arch ${{ inputs.arch }}
112+
run: /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --arch ${{ inputs.arch }}
105113
working-directory: build-scripts

.github/workflows/build_wamr_vscode_ext.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23-
- name: Use Node.js 16.x
23+
- name: Use Node.js 18.x
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 16.x
26+
node-version: 18.x
2727

2828
- name: set vscode extension to correct version
2929
run: |
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: generate wamr ide vscode extension
3535
run: |
36-
npm install -g vsce
36+
npm install -g @vscode/vsce
3737
rm -rf node_modules
3838
npm install
3939
vsce package

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ env:
6868
WAMR_COMPILER_TEST_OPTIONS: "-s wamr_compiler -S -b -P"
6969
GC_TEST_OPTIONS: "-s spec -G -b -P"
7070
MEMORY64_TEST_OPTIONS: "-s spec -W -b -P"
71+
MULTI_MEMORY_TEST_OPTIONS: "-s spec -E -b -P"
7172

7273
jobs:
7374
build_llvm_libraries_on_ubuntu_2204:
@@ -148,6 +149,7 @@ jobs:
148149
"-DWAMR_BUILD_TAIL_CALL=1",
149150
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
150151
"-DWAMR_BUILD_MEMORY64=1",
152+
"-DWAMR_BUILD_MULTI_MEMORY=1",
151153
]
152154
os: [ubuntu-22.04]
153155
platform: [android, linux]
@@ -206,11 +208,9 @@ jobs:
206208
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
207209
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
208210
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
209-
# Memory64 only on CLASSIC INTERP mode, and only on 64-bit platform
211+
# Memory64 only on CLASSIC INTERP and AOT mode, and only on 64-bit platform
210212
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
211213
platform: android
212-
- make_options_run_mode: $AOT_BUILD_OPTIONS
213-
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
214214
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
215215
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
216216
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
@@ -221,6 +221,21 @@ jobs:
221221
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
222222
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
223223
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
224+
# Multi memory only on CLASSIC INTERP mode, and only on 64-bit platform
225+
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
226+
platform: android
227+
- make_options_run_mode: $AOT_BUILD_OPTIONS
228+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
229+
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
230+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
231+
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
232+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
233+
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
234+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
235+
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
236+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
237+
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
238+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
224239
# Fast-JIT and Multi-Tier-JIT mode don't support android
225240
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
226241
platform: android
@@ -593,6 +608,7 @@ jobs:
593608
$WASI_TEST_OPTIONS,
594609
$GC_TEST_OPTIONS,
595610
$MEMORY64_TEST_OPTIONS,
611+
$MULTI_MEMORY_TEST_OPTIONS,
596612
]
597613
wasi_sdk_release:
598614
[
@@ -640,18 +656,30 @@ jobs:
640656
test_option: $MEMORY64_TEST_OPTIONS
641657
- running_mode: "multi-tier-jit"
642658
test_option: $MEMORY64_TEST_OPTIONS
659+
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
660+
- running_mode: "aot"
661+
test_option: $MULTI_MEMORY_TEST_OPTIONS
662+
- running_mode: "fast-interp"
663+
test_option: $MULTI_MEMORY_TEST_OPTIONS
664+
- running_mode: "fast-jit"
665+
test_option: $MULTI_MEMORY_TEST_OPTIONS
666+
- running_mode: "jit"
667+
test_option: $MULTI_MEMORY_TEST_OPTIONS
668+
- running_mode: "multi-tier-jit"
669+
test_option: $MULTI_MEMORY_TEST_OPTIONS
670+
643671
steps:
644672
- name: checkout
645673
uses: actions/checkout@v4
646674

647675
- name: Set-up OCaml
648676
uses: ocaml/setup-ocaml@v3
649-
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
677+
if: matrix.test_option == '$GC_TEST_OPTIONS'
650678
with:
651679
ocaml-compiler: 4.13
652680

653681
- name: Set-up Ocamlbuild
654-
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
682+
if: matrix.test_option == '$GC_TEST_OPTIONS'
655683
run: opam install ocamlbuild dune menhir
656684

657685
- name: download and install wasi-sdk
@@ -717,13 +745,13 @@ jobs:
717745

718746
- name: run tests
719747
timeout-minutes: 30
720-
if: matrix.test_option != '$GC_TEST_OPTIONS' && matrix.test_option != '$MEMORY64_TEST_OPTIONS'
748+
if: matrix.test_option != '$GC_TEST_OPTIONS'
721749
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
722750
working-directory: ./tests/wamr-test-suites
723751

724-
- name: run gc or memory64 tests
752+
- name: run gc tests
725753
timeout-minutes: 20
726-
if: matrix.test_option == '$GC_TEST_OPTIONS' || matrix.test_option == '$MEMORY64_TEST_OPTIONS'
754+
if: matrix.test_option == '$GC_TEST_OPTIONS'
727755
run: |
728756
eval $(opam env)
729757
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}

.github/workflows/compilation_on_nuttx.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,31 @@ jobs:
6868
# arm64
6969
"boards/arm64/qemu/qemu-armv8a/configs/nsh",
7070
]
71-
wamr_config_option: [
72-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
73-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
74-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
75-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
76-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
77-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
78-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
79-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\n",
80-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
81-
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
82-
]
71+
72+
wamr_config_option:
73+
- "CONFIG_INTERPRETERS_WAMR_AOT"
74+
- "CONFIG_INTERPRETERS_WAMR_FAST"
75+
- "CONFIG_INTERPRETERS_WAMR_CLASSIC"
76+
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST"
77+
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
78+
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_FAST CONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN"
79+
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC"
80+
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
81+
- "CONFIG_INTERPRETERS_WAMR_AOT CONFIG_INTERPRETERS_WAMR_CLASSIC CONFIG_INTERPRETERS_WAMR_LIBC_WASI"
8382

8483
steps:
8584
- name: Checkout NuttX
8685
uses: actions/checkout@v4
8786
with:
8887
repository: apache/nuttx
89-
ref: releases/12.4
88+
ref: releases/12.6
9089
path: nuttx
9190

9291
- name: Checkout NuttX Apps
9392
uses: actions/checkout@v4
9493
with:
9594
repository: apache/nuttx-apps
96-
ref: releases/12.4
95+
ref: releases/12.6
9796
path: apps
9897

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

105-
- name: Enable WAMR for NuttX
104+
- name: Configure WAMR
105+
working-directory: nuttx
106106
run: |
107-
find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\n${{ matrix.wamr_config_option }}'
108-
find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
107+
tools/configure.sh ${{ matrix.nuttx_board_config }}
108+
kconfig-tweak --enable CONFIG_PSEUDOFS_SOFTLINKS
109+
kconfig-tweak --enable CONFIG_INTERPRETERS_WAMR
110+
kconfig-tweak --enable CONFIG_INTERPRETERS_IWASM_TASK
111+
kconfig-tweak --set-val CONFIG_INTERPRETERS_WAMR_PRIORITY 100
112+
kconfig-tweak --set-val CONFIG_INTERPRETERS_WAMR_STACKSIZE 8192
113+
for x in ${{ matrix.wamr_config_option }}; do
114+
kconfig-tweak --enable $x
115+
done
109116
110117
- name: Build
111-
run: |
112-
cd nuttx
113-
tools/configure.sh ${{ matrix.nuttx_board_config }}
114-
make -j$(nproc) EXTRAFLAGS=-Werror
118+
working-directory: nuttx
119+
run: make -j$(nproc) EXTRAFLAGS=-Werror
115120

116121
- name: Checkout Bloaty
117122
uses: actions/checkout@v3

.github/workflows/nightly_run.yml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ jobs:
132132
"-DWAMR_BUILD_TAIL_CALL=1",
133133
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
134134
"-DWAMR_BUILD_MEMORY64=1",
135+
"-DWAMR_BUILD_MULTI_MEMORY=1",
135136
]
136137
os: [ubuntu-20.04]
137138
platform: [android, linux]
@@ -190,11 +191,9 @@ jobs:
190191
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
191192
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
192193
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
193-
# Memory64 only on CLASSIC INTERP mode, and only on 64-bit platform
194+
# Memory64 only on CLASSIC INTERP and AOT mode, and only on 64-bit platform
194195
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
195196
platform: android
196-
- make_options_run_mode: $AOT_BUILD_OPTIONS
197-
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
198197
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
199198
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
200199
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
@@ -205,6 +204,21 @@ jobs:
205204
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
206205
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
207206
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
207+
# Multi memory only on CLASSIC INTERP mode, and only on 64-bit platform
208+
- make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
209+
platform: android
210+
- make_options_run_mode: $AOT_BUILD_OPTIONS
211+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
212+
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
213+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
214+
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
215+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
216+
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
217+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
218+
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
219+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
220+
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
221+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
208222
# Fast-JIT and Multi-Tier-JIT mode don't support android
209223
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
210224
platform: android
@@ -289,6 +303,7 @@ jobs:
289303
"-DWAMR_BUILD_TAIL_CALL=1",
290304
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
291305
"-DWAMR_BUILD_MEMORY64=1",
306+
"-DWAMR_BUILD_MULTI_MEMORY=1",
292307
]
293308
exclude:
294309
# incompatible feature and platform
@@ -322,17 +337,19 @@ jobs:
322337
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
323338
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
324339
make_options_feature: "-DWAMR_BUILD_MEMORY64=1"
340+
# Memory64 only on CLASSIC INTERP mode
341+
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
342+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
343+
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
344+
make_options_feature: "-DWAMR_BUILD_MULTI_MEMORY=1"
325345
steps:
326-
- name: checkout
327-
uses: actions/checkout@v3
328-
329346
- name: Install dependencies
330-
uses: nick-fields/retry@v2
331-
with:
332-
timeout_minutes: 10
333-
max_attempts: 3
334-
command: apt update && apt install -y make g++-4.8 gcc-4.8 wget git
335-
on_retry_command: sudo rm -r /var/lib/apt/lists/*
347+
run: |
348+
apt update && apt install -y make g++-4.8 gcc-4.8 wget git
349+
350+
- name: checkout
351+
run: |
352+
git clone https://github.com/${{ github.repository }} wamr
336353
337354
- name: Install cmake
338355
run: |
@@ -345,7 +362,7 @@ jobs:
345362
mkdir build && cd build
346363
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }} -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8
347364
cmake --build . --config Release --parallel 4
348-
working-directory: product-mini/platforms/linux
365+
working-directory: wamr/product-mini/platforms/linux
349366

350367
build_samples_wasm_c_api:
351368
needs:

0 commit comments

Comments
 (0)