Skip to content

Commit 0e17ab2

Browse files
authored
Merge pull request #1392 from bytecodealliance/main
Merge main into dev/socket
2 parents 45136bc + 1fc01fa commit 0e17ab2

File tree

209 files changed

+26191
-1214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+26191
-1214
lines changed

.devcontainer/Dockerfile

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp/.devcontainer/base.Dockerfile
5+
# [Choice] Debian / Ubuntu version (use Debian 11/9, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
6+
ARG VARIANT=ubuntu-20.04
7+
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}
8+
9+
ARG DEBIAN_FRONTEND=noninteractive
10+
ENV TZ=Asian/Shanghai
11+
12+
RUN apt update \
13+
&& apt install -y apt-transport-https apt-utils build-essential \
14+
ca-certificates curl g++-multilib git gnupg \
15+
libgcc-9-dev lib32gcc-9-dev lsb-release \
16+
ninja-build ocaml ocamlbuild python2.7 \
17+
software-properties-common tree tzdata \
18+
unzip valgrind vim wget zip
19+
20+
#
21+
# CMAKE (https://apt.kitware.com/)
22+
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null \
23+
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
24+
&& apt update \
25+
&& rm /usr/share/keyrings/kitware-archive-keyring.gpg \
26+
&& apt install -y kitware-archive-keyring \
27+
&& apt install -y cmake
28+
29+
#
30+
# install emsdk
31+
RUN cd /opt \
32+
&& git clone https://github.com/emscripten-core/emsdk.git
33+
RUN cd /opt/emsdk \
34+
&& git pull \
35+
&& ./emsdk install 2.0.26 \
36+
&& ./emsdk activate 2.0.26 \
37+
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
38+
39+
#
40+
# install wasi-sdk
41+
ARG WASI_SDK_VER=16
42+
RUN wget -c https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER}/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -P /opt
43+
RUN tar xf /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -C /opt \
44+
&& ln -fs /opt/wasi-sdk-${WASI_SDK_VER}.0 /opt/wasi-sdk
45+
RUN rm /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz
46+
47+
#
48+
#install wabt
49+
ARG WABT_VER=1.0.29
50+
RUN wget -c https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt
51+
RUN tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
52+
&& ln -fs /opt/wabt-${WABT_VER} /opt/wabt
53+
RUN rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz
54+
55+
#
56+
# install bazelisk
57+
ARG BAZELISK_VER=1.12.0
58+
RUN mkdir /opt/bazelisk
59+
RUN wget -c https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk
60+
RUN chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
61+
&& ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel
62+
63+
#
64+
# install clang+llvm
65+
RUN cd /etc/apt/apt.conf.d \
66+
&& touch 99verfiy-peer.conf \
67+
&& echo "Acquire { https::Verify-Peer false }" > 99verfiy-peer.conf
68+
RUN cd /tmp \
69+
&& wget https://apt.llvm.org/llvm.sh \
70+
&& chmod a+x ./llvm.sh
71+
RUN /tmp/llvm.sh 12 all
72+
RUN ln -sf /usr/bin/clang-format-12 /usr/bin/clang-format
73+
74+
#
75+
# [Optional]
76+
77+
#
78+
# Install pip
79+
RUN apt update && apt install -y --reinstall python3-venv python3-pip
80+
RUN python3 -m pip install --upgrade pip
81+
82+
#
83+
# Install required python packages
84+
RUN pip3 install --user black nose pycparser pylint
85+
86+
# set path
87+
ENV PATH "/opt/bazelisk:/opt/clang-llvm/bin:${PATH}"
88+
RUN echo "export PATH=/opt/bazelisk:/opt/clang-llvm/bin:${PATH}" >> /root/.bashrc
89+
90+
#
91+
# PS
92+
RUN echo "PS1='\n[ \u@wamr-dev-docker \W ]\n$ '" >> /root/.bashrc
93+
94+
# Clean up
95+
RUN apt-get autoremove -y \
96+
&& apt-get clean -y \
97+
&& rm -rf /var/lib/apt/lists/* \
98+
&& rm -rf /tmp/*

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
5+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
6+
{
7+
"name": "WAMR-Dev",
8+
"build": {
9+
"dockerfile": "Dockerfile",
10+
// Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
11+
// Use Debian 11, Debian 9, Ubuntu 18.04 or Ubuntu 21.04 on local arm64/Apple Silicon
12+
"args": {
13+
"VARIANT": "ubuntu-20.04"
14+
}
15+
},
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {},
27+
// Add the IDs of extensions you want installed when the container is created.
28+
"extensions": [
29+
"dtsvet.vscode-wasm",
30+
"esbenp.prettier-vscode",
31+
"ms-python.python",
32+
"ms-python.vscode-pylance",
33+
"ms-vscode.cmake-tools",
34+
"ms-vscode.cpptools",
35+
"twxs.cmake"
36+
]
37+
}
38+
},
39+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
40+
// "forwardPorts": [],
41+
// Use 'postCreateCommand' to run commands after the container is created.
42+
"postCreateCommand": "curl https://sh.rustup.rs -sSf | bash -s -- -y",
43+
// Comment out this line to run as root instead.
44+
"remoteUser": "vscode"
45+
}

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
name: compilation on android, ubuntu-18.04, ubuntu-20.04
4+
name: compilation on android, ubuntu-20.04, ubuntu-22.04
55

66
on:
77
# will be triggered on PR events
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ${{ matrix.os }}
5353
strategy:
5454
matrix:
55-
os: [ubuntu-18.04, ubuntu-20.04]
55+
os: [ubuntu-20.04, ubuntu-22.04]
5656
steps:
5757
- name: Cancel Workflow Action
5858
uses: styfle/[email protected]
@@ -67,24 +67,24 @@ jobs:
6767
runs-on: ${{ matrix.os }}
6868
strategy:
6969
matrix:
70-
os: [ubuntu-18.04, ubuntu-20.04]
70+
os: [ubuntu-20.04, ubuntu-22.04]
7171
outputs:
72-
traffic_light_on_ubuntu_1804: ${{ steps.do_check_on_ubuntu_1804.outputs.light }}
7372
traffic_light_on_ubuntu_2004: ${{ steps.do_check_on_ubuntu_2004.outputs.light }}
73+
traffic_light_on_ubuntu_2204: ${{ steps.do_check_on_ubuntu_2204.outputs.light }}
7474
steps:
75-
- name: do_check_on_ubuntu_1804
76-
id: do_check_on_ubuntu_1804
77-
if: ${{ matrix.os == 'ubuntu-18.04' }}
75+
- name: do_check_on_ubuntu_2004
76+
id: do_check_on_ubuntu_2004
77+
if: ${{ matrix.os == 'ubuntu-20.04' }}
7878
run: |
7979
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
8080
echo "::set-output name=light::green"
8181
else
8282
echo "::set-output name=light::red"
8383
fi
8484
85-
- name: do_check_on_ubuntu_2004
86-
id: do_check_on_ubuntu_2004
87-
if: ${{ matrix.os == 'ubuntu-20.04' }}
85+
- name: do_check_on_ubuntu_2204
86+
id: do_check_on_ubuntu_2204
87+
if: ${{ matrix.os == 'ubuntu-22.04' }}
8888
run: |
8989
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
9090
echo "::set-output name=light::green"
@@ -97,12 +97,12 @@ jobs:
9797
runs-on: ${{ matrix.os }}
9898
strategy:
9999
matrix:
100-
os: [ubuntu-18.04, ubuntu-20.04]
100+
os: [ubuntu-20.04, ubuntu-22.04]
101101
include:
102-
- os: ubuntu-18.04
103-
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
104102
- os: ubuntu-20.04
105103
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
104+
- os: ubuntu-22.04
105+
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
106106
steps:
107107
- name: light status
108108
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
@@ -135,12 +135,12 @@ jobs:
135135
runs-on: ${{ matrix.os }}
136136
strategy:
137137
matrix:
138-
os: [ubuntu-18.04, ubuntu-20.04]
138+
os: [ubuntu-20.04, ubuntu-22.04]
139139
include:
140-
- os: ubuntu-18.04
141-
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
142140
- os: ubuntu-20.04
143141
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
142+
- os: ubuntu-22.04
143+
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
144144
steps:
145145
- name: light status
146146
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
@@ -204,7 +204,7 @@ jobs:
204204
"-DWAMR_BUILD_TAIL_CALL=1",
205205
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
206206
]
207-
os: [ubuntu-18.04, ubuntu-20.04]
207+
os: [ubuntu-20.04, ubuntu-22.04]
208208
platform: [android, linux]
209209
exclude:
210210
# uncompatiable feature and platform
@@ -248,10 +248,10 @@ jobs:
248248
- make_options_run_mode: $MC_JIT_BUILD_OPTIONS
249249
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
250250
include:
251-
- os: ubuntu-18.04
252-
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
253251
- os: ubuntu-20.04
254252
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
253+
- os: ubuntu-22.04
254+
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
255255
steps:
256256
- name: light status
257257
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
@@ -299,16 +299,16 @@ jobs:
299299
$MC_JIT_BUILD_OPTIONS,
300300
$AOT_BUILD_OPTIONS,
301301
]
302-
os: [ubuntu-18.04, ubuntu-20.04]
302+
os: [ubuntu-20.04, ubuntu-22.04]
303303
include:
304-
- os: ubuntu-18.04
305-
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
306-
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
307-
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
308304
- os: ubuntu-20.04
309305
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
310306
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
311307
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
308+
- os: ubuntu-22.04
309+
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
310+
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
311+
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
312312
steps:
313313
- name: light status
314314
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
@@ -374,14 +374,14 @@ jobs:
374374
strategy:
375375
matrix:
376376
include:
377-
- os: ubuntu-18.04
378-
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
379-
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
380-
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
381377
- os: ubuntu-20.04
382378
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
383379
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
384380
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
381+
- os: ubuntu-22.04
382+
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
383+
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
384+
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
385385
steps:
386386
- name: light status
387387
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
@@ -454,7 +454,7 @@ jobs:
454454
runs-on: ubuntu-20.04
455455
strategy:
456456
matrix:
457-
test_option: [$DEFAULT_TEST_OPTIONS, $SIMD_TEST_OPTIONS]
457+
test_option: [$DEFAULT_TEST_OPTIONS]
458458
steps:
459459
- name: checkout
460460
uses: actions/checkout@v3
@@ -488,7 +488,13 @@ jobs:
488488
runs-on: ubuntu-20.04
489489
strategy:
490490
matrix:
491-
test_option: [$MULTI_MODULES_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
491+
running_mode: ["classic-interp", "fast-interp", "jit", "aot"]
492+
test_option:
493+
[
494+
$MULTI_MODULES_TEST_OPTIONS,
495+
$SIMD_TEST_OPTIONS,
496+
$THREADS_TEST_OPTIONS,
497+
]
492498
steps:
493499
- name: checkout
494500
uses: actions/checkout@v3
@@ -513,7 +519,7 @@ jobs:
513519
run: sudo apt install -y ninja-build
514520

515521
- name: run spec tests
516-
run: ./test_wamr.sh ${{ matrix.test_option }}
522+
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
517523
working-directory: ./tests/wamr-test-suites
518524

519525
spec_test_x86_32:
@@ -522,6 +528,7 @@ jobs:
522528
runs-on: ubuntu-20.04
523529
strategy:
524530
matrix:
531+
running_mode: ["classic-interp", "fast-interp", "jit", "aot"]
525532
test_option: [$DEFAULT_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
526533
steps:
527534
- name: checkout
@@ -553,5 +560,5 @@ jobs:
553560
sudo apt install -y g++-multilib lib32gcc-9-dev ninja-build
554561

555562
- name: run spec tests
556-
run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }}
563+
run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
557564
working-directory: ./tests/wamr-test-suites

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ tests/wamr-test-suites/workspace
2626
!/test-tools/wamr-ide/VSCode-Extension/.vscode
2727

2828
samples/socket-api/wasm-src/inc/pthread.h
29+
30+
**/__pycache__

ATTRIBUTIONS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ WAMR project reused some components from other open source project:
1313
- **WebAssembly debugging patch for LLDB**: for extending the ability of LLDB to support wasm debugging
1414
- **libuv**: for the WASI Libc with uvwasi implementation
1515
- **uvwasi**: for the WASI Libc with uvwasi implementation
16+
- **asmjit**: for the Fast JIT x86-64 codegen implementation
17+
- **zydis**: for the Fast JIT x86-64 codegen implementation
1618

1719
The WAMR fast interpreter is a clean room development. We would acknowledge the inspirations by [WASM3](https://github.com/wasm3/wasm3) open source project for the approach of pre-calculated oprand stack location.
1820

@@ -29,6 +31,8 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the
2931
| WebAssembly debugging patch for LLDB | unspecified | unspecified | https://reviews.llvm.org/D78801 | |
3032
| libuv | v1.42.0 | v1.44.1 | https://github.com/libuv/libuv | https://www.cvedetails.com/vendor/15402/Libuv-Project.html |
3133
| uvwasi | unspecified | v0.0.12 | https://github.com/nodejs/uvwasi | |
34+
| asmjit | unspecified | unspecified | https://github.com/asmjit/asmjit | |
35+
| zydis | unspecified | e14a07895136182a5b53e181eec3b1c6e0b434de | https://github.com/zyantific/zydis | |
3236

3337
## Licenses
3438

@@ -79,3 +83,9 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the
7983

8084
### uvwasi
8185
[LICENSE](./core/iwasm/libraries/libc-uvwasi/LICENSE_UVWASI)
86+
87+
### asmjit
88+
[LICENSE](./core/iwasm/fast-jit/cg/LICENSE_ASMJIT)
89+
90+
### zydis
91+
[LICENSE](./core/iwasm/fast-jit/cg/LICENSE_ZYDIS)

0 commit comments

Comments
 (0)