Skip to content

Commit e170c35

Browse files
committed
Merge branch main into dev/wasi_threads
2 parents ee1871d + 50650e4 commit e170c35

File tree

163 files changed

+7138
-1842
lines changed

Some content is hidden

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

163 files changed

+7138
-1842
lines changed

.devcontainer/Dockerfile

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,23 @@ ENV TZ=Asian/Shanghai
1212
# hadolint ignore=DL3008
1313
RUN apt-get update \
1414
&& apt-get install -y apt-transport-https apt-utils build-essential \
15-
ca-certificates curl g++-multilib git gnupg \
15+
ca-certificates ccache curl g++-multilib git gnupg \
1616
libgcc-9-dev lib32gcc-9-dev lsb-release \
1717
ninja-build ocaml ocamlbuild python2.7 \
1818
software-properties-common tree tzdata \
1919
unzip valgrind vim wget zip --no-install-recommends \
2020
&& apt-get clean -y \
2121
&& rm -rf /var/lib/apt/lists/*
2222

23+
#
24+
# binaryen
25+
ARG BINARYEN_VER=111
26+
WORKDIR /opt
27+
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VER}/binaryen-version_${BINARYEN_VER}-x86_64-linux.tar.gz \
28+
&& tar xf binaryen-version_${BINARYEN_VER}-x86_64-linux.tar.gz \
29+
&& ln -sf /opt/binaryen-version_111 /opt/binaryen \
30+
&& rm binaryen-version_${BINARYEN_VER}-x86_64-linux.tar.gz
31+
2332
#
2433
# CMAKE (https://apt.kitware.com/)
2534
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -31,55 +40,56 @@ RUN wget --progress=dot:giga -O - https://apt.kitware.com/keys/kitware-archive-l
3140
&& apt-get install -y kitware-archive-keyring --no-install-recommends \
3241
&& apt-get install -y cmake --no-install-recommends \
3342
&& apt-get clean -y \
34-
&& rm -rf /var/lib/apt/lists/*
43+
&& rm -rf /var/lib/apt/lists/*
3544

3645
#
3746
# install emsdk
3847
WORKDIR /opt
3948
RUN git clone https://github.com/emscripten-core/emsdk.git
4049

50+
ARG EMSDK_VER=3.0.0
4151
WORKDIR /opt/emsdk
4252
RUN git pull \
43-
&& ./emsdk install 2.0.26 \
44-
&& ./emsdk activate 2.0.26 \
53+
&& ./emsdk install ${EMSDK_VER} \
54+
&& ./emsdk activate ${EMSDK_VER} \
4555
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
4656

4757
#
4858
# install wasi-sdk
49-
ARG WASI_SDK_VER=16
59+
ARG WASI_SDK_VER=19
5060
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 \
5161
&& 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 \
62+
&& ln -sf /opt/wasi-sdk-${WASI_SDK_VER}.0 /opt/wasi-sdk \
5363
&& rm /opt/wasi-sdk-${WASI_SDK_VER}.0-linux.tar.gz
5464

5565
#
5666
#install wabt
5767
ARG WABT_VER=1.0.29
5868
RUN wget -c --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt \
5969
&& tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
60-
&& ln -fs /opt/wabt-${WABT_VER} /opt/wabt \
70+
&& ln -sf /opt/wabt-${WABT_VER} /opt/wabt \
6171
&& rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz
6272

6373
#
6474
# install bazelisk
6575
ARG BAZELISK_VER=1.12.0
66-
RUN mkdir /opt/bazelisk \
76+
RUN mkdir /opt/bazelisk \
6777
&& wget -c --progress=dot:giga https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk \
6878
&& chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
6979
&& ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel
7080

7181
#
7282
# install clang+llvm
83+
ARG LLVM_VER=14
84+
RUN apt-get purge -y clang-10 llvm-10 && apt autoremove -y
7385
WORKDIR /etc/apt/apt.conf.d
7486
RUN touch 99verfiy-peer.conf \
7587
&& echo "Acquire { https::Verify-Peer false }" > 99verfiy-peer.conf
7688

77-
WORKDIR /tmp
89+
WORKDIR /tmp
7890
RUN wget --progress=dot:giga https://apt.llvm.org/llvm.sh \
7991
&& 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/*
92+
&& ./llvm.sh ${LLVM_VER} all
8393

8494
#
8595
# [Optional]
@@ -96,17 +106,28 @@ RUN apt-get update \
96106
# Install required python packages
97107
# hadolint ignore=DL3013
98108
RUN python3 -m pip install --no-cache-dir --upgrade pip \
99-
&& pip3 install --no-cache-dir --user black nose pycparser pylint
109+
&& pip3 install --no-cache-dir black nose pycparser pylint
110+
111+
#
112+
# Install github-cli. It doens't work as a feature of devcontainer.json
113+
RUN cd /tmp \
114+
&& wget https://github.com/cli/cli/releases/download/v2.20.2/gh_2.20.2_linux_amd64.deb \
115+
&& dpkg -i gh_2.20.2_linux_amd64.deb
100116

101-
# set path, PS and clean up
102-
ENV PATH "/opt/bazelisk:/opt/clang-llvm/bin:${PATH}"
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 \
117+
#
118+
# Install NodeJS
119+
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash -
120+
RUN apt-get install -y nodejs
121+
122+
# set path
123+
ENV PATH="/opt/bazelisk:/usr/lib/llvm-${LLVM_VER}/bin:${PATH}"
124+
ENV CC=/usr/lib/llvm-${LLVM_VER}/bin/clang CXX=/usr/lib/llvm-${LLVM_VER}/bin/clang++
125+
RUN printf "%s\n" "PS1='\n[ \u@wamr-dev-docker \W ]\n$ '" >> /root/.bashrc \
105126
&& apt-get autoremove -y \
106127
&& apt-get clean -y \
107128
&& rm -rf /var/lib/apt/lists/* \
108129
&& rm -rf /tmp/*
109130

110131
# set workdir when container run
111-
VOLUME /workspace
112-
WORKDIR /workspace
132+
VOLUME /workspaces
133+
WORKDIR /workspaces

.devcontainer/devcontainer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (C) 2019 Intel Corporation. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3-
43
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
54
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
65
{
@@ -10,7 +9,12 @@
109
// Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
1110
// Use Debian 11, Debian 9, Ubuntu 18.04 or Ubuntu 21.04 on local arm64/Apple Silicon
1211
"args": {
13-
"VARIANT": "ubuntu-20.04"
12+
"BINARYEN_VER": "111",
13+
"EMSDK_VER": "3.0.0",
14+
"LLVM_VER": "15",
15+
"VARIANT": "ubuntu-20.04",
16+
"WASI_SDK_VER": "19",
17+
"WABT_VER": "1.0.31"
1418
}
1519
},
1620
"runArgs": [
@@ -27,12 +31,10 @@
2731
// Add the IDs of extensions you want installed when the container is created.
2832
"extensions": [
2933
"dtsvet.vscode-wasm",
30-
"esbenp.prettier-vscode",
34+
"llvm-vs-code-extensions.vscode-clangd",
3135
"ms-python.python",
3236
"ms-python.vscode-pylance",
3337
"ms-vscode.cmake-tools",
34-
"ms-vscode.cpptools",
35-
"twxs.cmake"
3638
]
3739
}
3840
},

.github/workflows/build_iwasm_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: generate iwasm binary release
3737
run: |
3838
cmake -S . -B build \
39-
-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 \
39+
-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
4040
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
4141
-DWAMR_BUILD_DEBUG_INTERP=0 \
4242
-DWAMR_BUILD_DEBUG_AOT=0 \

.github/workflows/build_llvm_libraries.yml

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,46 @@ name: Reusable workflow-build_llvm_libraries
55
on:
66
workflow_call:
77
inputs:
8-
runs-on:
8+
os:
99
required: true
1010
type: string
11+
arch:
12+
required: true
13+
type: string
14+
outputs:
15+
cache_key:
16+
description: "A cached key of LLVM libraries"
17+
value: ${{ jobs.build_llvm_libraries.outputs.key}}
1118

1219
jobs:
1320
build_llvm_libraries:
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
os: ${{ fromJson(inputs.runs-on) }}
21+
runs-on: ${{ inputs.os }}
22+
outputs:
23+
key: ${{ steps.create_lib_cache_key.outputs.key}}
1824

1925
steps:
2026
- name: checkout
2127
uses: actions/checkout@v3
2228

29+
- name: install dependencies
30+
run: /usr/bin/env python3 -m pip install -r requirements.txt
31+
working-directory: build-scripts
32+
33+
- name: retrive the last commit ID
34+
id: get_last_commit
35+
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py --llvm-ver)" >> $GITHUB_OUTPUT
36+
working-directory: build-scripts
37+
38+
# Bump the prefix number to evict all previous caches and
39+
# enforce a clean build, in the unlikely case that some
40+
# weird build error occur and llvm/build becomes a potential
41+
# suspect.
42+
- name: form the cache key of libraries
43+
id: create_lib_cache_key
44+
run: echo "key=0-llvm-libraries-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.get_last_commit.outputs.last_commit }}" >> $GITHUB_OUTPUT
45+
2346
- name: Cache LLVM libraries
24-
id: cache_llvm
47+
id: retrieve_llvm_libs
2548
uses: actions/cache@v3
2649
with:
2750
path: |
@@ -30,10 +53,39 @@ jobs:
3053
./core/deps/llvm/build/lib
3154
./core/deps/llvm/build/libexec
3255
./core/deps/llvm/build/share
33-
key: ${{ matrix.os }}-build-llvm_libraries_ex
56+
key: ${{ steps.create_lib_cache_key.outputs.key}}
57+
58+
- uses: actions/cache@v3
59+
with:
60+
path: ~/.ccache
61+
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
62+
restore-keys: |
63+
0-ccache-${{ inputs.os }}
64+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'ubuntu-20.04'
65+
66+
- uses: actions/cache@v3
67+
with:
68+
path: ~/.cache/ccache
69+
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
70+
restore-keys: |
71+
0-ccache-${{ inputs.os }}
72+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'ubuntu-22.04'
73+
74+
- run: sudo apt install -y ccache ninja-build
75+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'ubuntu')
76+
77+
- uses: actions/cache@v3
78+
with:
79+
path: ~/Library/Caches/ccache
80+
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
81+
restore-keys: |
82+
0-ccache-${{ inputs.os }}
83+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'macos')
84+
85+
- run: brew install ccache ninja
86+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'macos')
3487

35-
- name: Build llvm
36-
id: build_llvm
37-
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
38-
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
88+
- name: Build LLVM libraries
89+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
90+
run: /usr/bin/env python3 ./build_llvm.py --arch ${{ inputs.arch }}
3991
working-directory: build-scripts
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
complinace_job:
18+
compliance_job:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: checkout

0 commit comments

Comments
 (0)