Skip to content

Commit 301672d

Browse files
committed
Merge main into dev/socket
2 parents 8dd1c8a + 4489c3d commit 301672d

File tree

89 files changed

+2877
-423
lines changed

Some content is hidden

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

89 files changed

+2877
-423
lines changed

.devcontainer/Dockerfile

Lines changed: 55 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,90 +9,104 @@ FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}
99
ARG DEBIAN_FRONTEND=noninteractive
1010
ENV TZ=Asian/Shanghai
1111

12-
RUN apt update \
13-
&& apt install -y apt-transport-https apt-utils build-essential \
12+
# hadolint ignore=DL3008
13+
RUN apt-get update \
14+
&& apt-get install -y apt-transport-https apt-utils build-essential \
1415
ca-certificates curl g++-multilib git gnupg \
1516
libgcc-9-dev lib32gcc-9-dev lsb-release \
1617
ninja-build ocaml ocamlbuild python2.7 \
1718
software-properties-common tree tzdata \
18-
unzip valgrind vim wget zip
19+
unzip valgrind vim wget zip --no-install-recommends \
20+
&& apt-get clean -y \
21+
&& rm -rf /var/lib/apt/lists/*
1922

2023
#
2124
# 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 \
25+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
26+
# hadolint ignore=DL3008
27+
RUN wget --progress=dot:giga -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 \
2328
&& 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 \
29+
&& apt-get update \
2530
&& rm /usr/share/keyrings/kitware-archive-keyring.gpg \
26-
&& apt install -y kitware-archive-keyring \
27-
&& apt install -y cmake
31+
&& apt-get install -y kitware-archive-keyring --no-install-recommends \
32+
&& apt-get install -y cmake --no-install-recommends \
33+
&& apt-get clean -y \
34+
&& rm -rf /var/lib/apt/lists/*
2835

2936
#
3037
# install emsdk
31-
RUN cd /opt \
32-
&& git clone https://github.com/emscripten-core/emsdk.git
33-
RUN cd /opt/emsdk \
34-
&& git pull \
38+
WORKDIR /opt
39+
RUN git clone https://github.com/emscripten-core/emsdk.git
40+
41+
WORKDIR /opt/emsdk
42+
RUN git pull \
3543
&& ./emsdk install 2.0.26 \
3644
&& ./emsdk activate 2.0.26 \
3745
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
3846

3947
#
4048
# install wasi-sdk
4149
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
50+
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER}/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -P /opt \
51+
&& tar xf /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz -C /opt \
52+
&& ln -fs /opt/wasi-sdk-${WASI_SDK_VER}.0 /opt/wasi-sdk \
53+
&& rm /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz
4654

4755
#
4856
#install wabt
4957
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
58+
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt \
59+
&& tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
60+
&& ln -fs /opt/wabt-${WABT_VER} /opt/wabt \
61+
&& rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz
5462

5563
#
5664
# install bazelisk
5765
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 \
66+
RUN mkdir /opt/bazelisk \
67+
&& wget -c --progress=dot:giga https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk \
68+
&& chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
6169
&& ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel
6270

6371
#
6472
# install clang+llvm
65-
RUN cd /etc/apt/apt.conf.d \
66-
&& touch 99verfiy-peer.conf \
73+
WORKDIR /etc/apt/apt.conf.d
74+
RUN touch 99verfiy-peer.conf \
6775
&& 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
76+
77+
WORKDIR /tmp
78+
RUN wget --progress=dot:giga https://apt.llvm.org/llvm.sh \
79+
&& chmod a+x ./llvm.sh \
80+
&& /tmp/llvm.sh 12 all \
81+
&& ln -sf /usr/bin/clang-format-12 /usr/bin/clang-format \
82+
&& rm -rf /tmp/*
7383

7484
#
7585
# [Optional]
7686

7787
#
7888
# Install pip
79-
RUN apt update && apt install -y --reinstall python3-venv python3-pip
80-
RUN python3 -m pip install --upgrade pip
89+
# hadolint ignore=DL3008
90+
RUN apt-get update \
91+
&& apt-get install -y --reinstall python3-venv python3-pip --no-install-recommends \
92+
&& apt-get clean -y \
93+
&& rm -rf /var/lib/apt/lists/*
8194

8295
#
8396
# Install required python packages
84-
RUN pip3 install --user black nose pycparser pylint
97+
# hadolint ignore=DL3013
98+
RUN python3 -m pip install --no-cache-dir --upgrade pip \
99+
&& pip3 install --no-cache-dir --user black nose pycparser pylint
85100

86-
# set path
101+
# set path, PS and clean up
87102
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 \
103+
RUN echo "export PATH=/opt/bazelisk:/opt/clang-llvm/bin:${PATH}" >> /root/.bashrc \
104+
&& printf "%s\n" "PS1='\n[ \u@wamr-dev-docker \W ]\n$ '" >> /root/.bashrc \
105+
&& apt-get autoremove -y \
96106
&& apt-get clean -y \
97107
&& rm -rf /var/lib/apt/lists/* \
98108
&& rm -rf /tmp/*
109+
110+
# set workdir when container run
111+
VOLUME /workspace
112+
WORKDIR /workspace

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,15 @@ jobs:
413413
./build.sh
414414
./run.sh
415415
416+
- name: Build Sample [file]
417+
if: ${{ matrix.light == 'green' }}
418+
run: |
419+
cd samples/file
420+
mkdir build && cd build
421+
cmake ..
422+
cmake --build . --config Release --parallel 4
423+
./src/iwasm -f wasm-app/file.wasm -d .
424+
416425
- name: Build Sample [multi-thread]
417426
if: ${{ matrix.light == 'green' }}
418427
run: |

.github/workflows/compilation_on_macos.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,15 @@ jobs:
356356
./build.sh
357357
./run.sh
358358
359+
- name: Build Sample [file]
360+
if: ${{ matrix.light == 'green' }}
361+
run: |
362+
cd samples/file
363+
mkdir build && cd build
364+
cmake ..
365+
cmake --build . --config Release --parallel 4
366+
./src/iwasm -f wasm-app/file.wasm -d .
367+
359368
- name: Build Sample [multi-thread]
360369
if: ${{ matrix.light == 'green' }}
361370
run: |

.github/workflows/compilation_on_nuttx.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ jobs:
7272

7373
steps:
7474
- name: Install Utilities
75-
run: sudo apt install -y kconfig-frontends-nox genromfs
75+
run: |
76+
sudo apt install -y kconfig-frontends-nox genromfs
77+
pip3 install pyelftools
78+
pip3 install cxxfilt
7679
7780
- name: Install ARM Compilers
7881
if: ${{ contains(matrix.nuttx_board_config, 'arm') }}

.github/workflows/compilation_on_sgx.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
# "-DWAMR_BUILD_SIMD=1",
141141
"-DWAMR_BUILD_TAIL_CALL=1",
142142
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
143+
"-DWAMR_BUILD_SGX_IPFS=1",
143144
]
144145
os: [ubuntu-20.04]
145146
platform: [linux-sgx]
@@ -363,6 +364,15 @@ jobs:
363364
./build.sh
364365
./run.sh
365366
367+
- name: Build Sample [file]
368+
if: ${{ matrix.light == 'green' }}
369+
run: |
370+
cd samples/file
371+
mkdir build && cd build
372+
cmake ..
373+
cmake --build . --config Release --parallel 4
374+
./src/iwasm -f wasm-app/file.wasm -d .
375+
366376
- name: Build Sample [multi-thread]
367377
if: ${{ matrix.light == 'green' }}
368378
run: |

ATTRIBUTIONS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ WAMR project reused some components from other open source project:
1515
- **uvwasi**: for the WASI Libc with uvwasi implementation
1616
- **asmjit**: for the Fast JIT x86-64 codegen implementation
1717
- **zydis**: for the Fast JIT x86-64 codegen implementation
18+
- **NuttX ELF headers**: used in core/iwasm/aot/debug/elf_parser.c
1819

1920
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.
2021

@@ -33,6 +34,7 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the
3334
| uvwasi | unspecified | v0.0.12 | https://github.com/nodejs/uvwasi | |
3435
| asmjit | unspecified | unspecified | https://github.com/asmjit/asmjit | |
3536
| zydis | unspecified | e14a07895136182a5b53e181eec3b1c6e0b434de | https://github.com/zyantific/zydis | |
37+
| NuttX ELF headers | 72313301e23f9c2de969fb64b9a0f67bb4c284df | 10.3.0 | https://github.com/apache/incubator-nuttx | |
3638

3739
## Licenses
3840

@@ -89,3 +91,9 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the
8991

9092
### zydis
9193
[LICENSE](./core/iwasm/fast-jit/cg/LICENSE_ZYDIS)
94+
95+
### NuttX ELF headers
96+
97+
[LICENSE](./core/iwasm/aot/debug/LICENSE_NUTTX)
98+
99+
[NOTICE](./core/iwasm/aot/debug/NOTICE_NUTTX)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Getting started
2525
- [Build WASM applications](./doc/build_wasm_app.md)
2626
- [Port WAMR to a new platform](./doc/port_wamr.md)
2727
- [Benchmarks](./tests/benchmarks) and [Samples](./samples)
28+
- [VS Code development container](./doc/devcontainer.md)
2829

2930
iwasm VM core
3031
=========================
@@ -150,6 +151,7 @@ The WAMR [samples](./samples) integrate the iwasm VM core, application manager a
150151

151152
- [**basic**](./samples/basic): Demonstrating how to use runtime exposed API's to call WASM functions, how to register native functions and call them, and how to call WASM function from native function.
152153
- **[simple](./samples/simple/README.md)**: The runtime is integrated with most of the WAMR APP libraries, and a few WASM applications are provided for testing the WAMR APP API set. It uses **built-in libc** and executes apps in **interpreter** mode by default.
154+
- **[file](./samples/file/README.md)**: Demonstrating the supported file interaction API of WASI. This sample can also demonstrate the SGX IPFS (Intel Protected File System), enabling an enclave to seal and unseal data at rest.
153155
- **[littlevgl](./samples/littlevgl/README.md)**: Demonstrating the graphic user interface application usage on WAMR. The whole [LVGL](https://github.com/lvgl/lvgl) 2D user graphic library and the UI application are built into WASM application. It uses **WASI libc** and executes apps in **AOT mode** by default.
154156
- **[gui](./samples/gui/README.md)**: Move the [LVGL](https://github.com/lvgl/lvgl) library into the runtime and define a WASM application interface by wrapping the littlevgl API. It uses **WASI libc** and executes apps in **interpreter** mode by default.
155157
- **[multi-thread](./samples/multi-thread/)**: Demonstrating how to run wasm application which creates multiple threads to execute wasm functions concurrently, and uses mutex/cond by calling pthread related API's.

build-scripts/config_common.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,7 @@ if (WAMR_BUILD_STACK_GUARD_SIZE GREATER 0)
287287
add_definitions (-DWASM_STACK_GUARD_SIZE=${WAMR_BUILD_STACK_GUARD_SIZE})
288288
message (" Custom stack guard size: " ${WAMR_BUILD_STACK_GUARD_SIZE})
289289
endif ()
290+
if (WAMR_BUILD_SGX_IPFS EQUAL 1)
291+
add_definitions (-DWASM_ENABLE_SGX_IPFS=1)
292+
message (" SGX IPFS enabled")
293+
endif ()

build-scripts/runtime_lib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ endif ()
5252
################ optional according to settings ################
5353
if (WAMR_BUILD_INTERP EQUAL 1 OR WAMR_BUILD_JIT EQUAL 1
5454
OR WAMR_BUILD_FAST_JIT EQUAL 1)
55-
if (WAMR_BUILD_FAST_JIT EQUAL 1)
55+
if (WAMR_BUILD_FAST_JIT EQUAL 1 OR WAMR_BUILD_JIT EQUAL 1)
5656
set (WAMR_BUILD_FAST_INTERP 0)
5757
endif ()
5858
include (${IWASM_DIR}/interpreter/iwasm_interp.cmake)

ci/Dockerfile

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)