Skip to content

Commit 85dabad

Browse files
Merge pull request #4049 from bytecodealliance/main
Sync with main
2 parents 19160f0 + 7f1e612 commit 85dabad

File tree

163 files changed

+5526
-3346
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

+5526
-3346
lines changed

.github/scripts/codeql_buildscript.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ cd ${WAMR_DIR}/product-mini/platforms/linux
306306
rm -rf build && mkdir build && cd build
307307
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DYNAMIC_AOT_DEBUG=1
308308
make -j
309-
if [[ $? != 0 ]];
309+
if [[ $? != 0 ]]; then
310310
echo "Failed to build iwasm dynamic aot debug enabled!"
311311
exit 1;
312312
fi

.github/workflows/build_docker_images.yml

+5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ on:
1515
type: string
1616
required: true
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
build-and-push-images:
2023
runs-on: ubuntu-22.04
24+
permissions:
25+
contents: write # for uploading release artifacts
2126

2227
steps:
2328
- name: Checkout repository

.github/workflows/build_iwasm_release.yml

+87-33
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,78 @@ on:
3131
type: string
3232
required: false
3333

34+
env:
35+
DEFAULT_BUILD_OPTIONS:
36+
"-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
37+
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
38+
-DWAMR_BUILD_DEBUG_INTERP=0 \
39+
-DWAMR_BUILD_DEBUG_AOT=0 \
40+
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
41+
-DWAMR_BUILD_LIBC_UVWASI=0 \
42+
-DWAMR_BUILD_LIBC_EMCC=0 \
43+
-DWAMR_BUILD_LIB_RATS=0 \
44+
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
45+
-DWAMR_BUILD_MEMORY_PROFILING=0 \
46+
-DWAMR_BUILD_MINI_LOADER=0 \
47+
-DWAMR_BUILD_MULTI_MODULE=0 \
48+
-DWAMR_BUILD_PERF_PROFILING=0 \
49+
-DWAMR_BUILD_SPEC_TEST=0 \
50+
-DWAMR_BUILD_BULK_MEMORY=1 \
51+
-DWAMR_BUILD_LIB_PTHREAD=1 \
52+
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
53+
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
54+
-DWAMR_BUILD_LIBC_BUILTIN=1 \
55+
-DWAMR_BUILD_LIBC_WASI=1 \
56+
-DWAMR_BUILD_REF_TYPES=1 \
57+
-DWAMR_BUILD_SIMD=1 \
58+
-DWAMR_BUILD_SHARED_MEMORY=1 \
59+
-DWAMR_BUILD_TAIL_CALL=1 \
60+
-DWAMR_BUILD_THREAD_MGR=1"
61+
GC_EH_BUILD_OPTIONS:
62+
"-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=0 \
63+
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
64+
-DWAMR_BUILD_DEBUG_INTERP=0 \
65+
-DWAMR_BUILD_DEBUG_AOT=0 \
66+
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
67+
-DWAMR_BUILD_LIBC_UVWASI=0 \
68+
-DWAMR_BUILD_LIBC_EMCC=0 \
69+
-DWAMR_BUILD_LIB_RATS=0 \
70+
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
71+
-DWAMR_BUILD_MEMORY_PROFILING=0 \
72+
-DWAMR_BUILD_MINI_LOADER=0 \
73+
-DWAMR_BUILD_MULTI_MODULE=0 \
74+
-DWAMR_BUILD_PERF_PROFILING=0 \
75+
-DWAMR_BUILD_SPEC_TEST=0 \
76+
-DWAMR_BUILD_BULK_MEMORY=1 \
77+
-DWAMR_BUILD_LIB_PTHREAD=1 \
78+
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
79+
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
80+
-DWAMR_BUILD_LIBC_BUILTIN=1 \
81+
-DWAMR_BUILD_LIBC_WASI=1 \
82+
-DWAMR_BUILD_REF_TYPES=1 \
83+
-DWAMR_BUILD_SIMD=1 \
84+
-DWAMR_BUILD_SHARED_MEMORY=1 \
85+
-DWAMR_BUILD_TAIL_CALL=1 \
86+
-DWAMR_BUILD_THREAD_MGR=1 \
87+
-DWAMR_BUILD_EXCE_HANDLING=1 \
88+
-DWAMR_BUILD_GC=1"
89+
90+
permissions:
91+
contents: read
92+
3493
jobs:
3594
build:
3695
runs-on: ${{ inputs.runner }}
96+
strategy:
97+
matrix:
98+
include:
99+
- build_options: $DEFAULT_BUILD_OPTIONS
100+
suffix: ''
101+
- build_options: $GC_EH_BUILD_OPTIONS
102+
suffix: '-gc-eh'
103+
permissions:
104+
contents: write # for uploading release artifacts
105+
37106
steps:
38107
- uses: actions/checkout@v4
39108

@@ -51,40 +120,25 @@ jobs:
51120
fail-on-cache-miss: true
52121

53122
- name: generate iwasm binary release
123+
shell: bash
54124
run: |
55-
cmake -S . -B build \
56-
-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
57-
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
58-
-DWAMR_BUILD_DEBUG_INTERP=0 \
59-
-DWAMR_BUILD_DEBUG_AOT=0 \
60-
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
61-
-DWAMR_BUILD_LIBC_UVWASI=0 \
62-
-DWAMR_BUILD_LIBC_EMCC=0 \
63-
-DWAMR_BUILD_LIB_RATS=0 \
64-
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
65-
-DWAMR_BUILD_MEMORY_PROFILING=0 \
66-
-DWAMR_BUILD_MINI_LOADER=0 \
67-
-DWAMR_BUILD_MULTI_MODULE=0 \
68-
-DWAMR_BUILD_PERF_PROFILING=0 \
69-
-DWAMR_BUILD_SPEC_TEST=0 \
70-
-DWAMR_BUILD_BULK_MEMORY=1 \
71-
-DWAMR_BUILD_LIB_PTHREAD=1 \
72-
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
73-
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
74-
-DWAMR_BUILD_LIBC_BUILTIN=1 \
75-
-DWAMR_BUILD_LIBC_WASI=1 \
76-
-DWAMR_BUILD_REF_TYPES=1 \
77-
-DWAMR_BUILD_SIMD=1 \
78-
-DWAMR_BUILD_SHARED_MEMORY=1 \
79-
-DWAMR_BUILD_TAIL_CALL=1 \
80-
-DWAMR_BUILD_THREAD_MGR=1
125+
cmake -S . -B build ${{ matrix.build_options }}
81126
cmake --build build --config Release --parallel 4
82127
working-directory: ${{ inputs.cwd }}
83128

84-
- name: compress the binary
129+
- name: Compress the binary on Windows
130+
if: inputs.runner == 'windows-latest'
131+
run: |
132+
tar -czf iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm.exe
133+
Compress-Archive -Path iwasm.exe -DestinationPath iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
134+
mv iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.* ../
135+
working-directory: ${{ inputs.cwd }}/build/Release
136+
137+
- name: compress the binary on non-Windows
138+
if: inputs.runner != 'windows-latest'
85139
run: |
86-
tar czf iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
87-
zip iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
140+
tar czf iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
141+
zip iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
88142
working-directory: ${{ inputs.cwd }}/build
89143

90144
- name: upload release tar.gz
@@ -93,8 +147,8 @@ jobs:
93147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94148
with:
95149
upload_url: ${{ inputs.upload_url }}
96-
asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
97-
asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
150+
asset_path: ${{ inputs.cwd }}/build/iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
151+
asset_name: iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
98152
asset_content_type: application/x-gzip
99153

100154
- name: upload release zip
@@ -103,6 +157,6 @@ jobs:
103157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104158
with:
105159
upload_url: ${{ inputs.upload_url }}
106-
asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
107-
asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
160+
asset_path: ${{ inputs.cwd }}/build/iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
161+
asset_name: iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
108162
asset_content_type: application/zip

.github/workflows/build_llvm_libraries.yml

+29-4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ on:
2727
description: "A cached key of LLVM libraries"
2828
value: ${{ jobs.build_llvm_libraries.outputs.key}}
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
build_llvm_libraries:
3235
runs-on: ${{ inputs.os }}
@@ -36,13 +39,17 @@ jobs:
3639
image: ${{ inputs.container_image }}
3740
outputs:
3841
key: ${{ steps.create_lib_cache_key.outputs.key}}
42+
permissions:
43+
contents: read
44+
actions: write # for uploading cached artifact
3945

4046
steps:
4147
- name: checkout
4248
uses: actions/checkout@v4
4349

4450
- name: install dependencies for non macos-14
4551
if: inputs.os != 'macos-14'
52+
shell: bash
4653
run: /usr/bin/env python3 -m pip install -r requirements.txt
4754
working-directory: build-scripts
4855

@@ -51,18 +58,23 @@ jobs:
5158
run: /usr/bin/env python3 -m pip install -r requirements.txt --break-system-packages
5259
working-directory: build-scripts
5360

54-
- name: retrieve the last commit ID
61+
- name: Retrieve the last commit ID
5562
id: get_last_commit
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
57-
working-directory: build-scripts
63+
env:
64+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
shell: bash
66+
run: |
67+
echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --llvm-ver)" >> $GITHUB_OUTPUT
5868
5969
# Bump the prefix number to evict all previous caches and
6070
# enforce a clean build, in the unlikely case that some
6171
# weird build error occur and llvm/build becomes a potential
6272
# suspect.
6373
- name: form the cache key of libraries
6474
id: create_lib_cache_key
65-
run: echo "key=0-llvm-libraries-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.get_last_commit.outputs.last_commit }}${{ inputs.cache_key_suffix }}" >> $GITHUB_OUTPUT
75+
shell: bash
76+
run: |
77+
echo "key=0-llvm-libraries-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.get_last_commit.outputs.last_commit }}${{ inputs.cache_key_suffix }}" >> $GITHUB_OUTPUT
6678
6779
- name: Cache LLVM libraries
6880
id: retrieve_llvm_libs
@@ -107,7 +119,20 @@ jobs:
107119
- run: brew install ccache ninja
108120
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'macos')
109121

122+
- uses: actions/cache@v4
123+
with:
124+
path: ~/.cache/ccache
125+
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
126+
restore-keys: |
127+
0-ccache-${{ inputs.os }}
128+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
129+
130+
# Install tools on Windows
131+
- run: choco install -y ccache ninja
132+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
133+
110134
- name: Build LLVM libraries
111135
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
136+
shell: bash
112137
run: /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --arch ${{ inputs.arch }}
113138
working-directory: build-scripts

.github/workflows/build_wamr_lldb.yml

+8
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ on:
2828
required: false
2929
default: "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz"
3030

31+
permissions:
32+
contents: read
33+
3134
jobs:
3235
try_reuse:
36+
permissions:
37+
contents: write # for uploading release artifacts
3338
uses: ./.github/workflows/reuse_latest_release_binaries.yml
3439
with:
3540
binary_name_stem: "wamr-lldb-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}"
@@ -46,6 +51,9 @@ jobs:
4651
PYTHON_VERSION: '3.10'
4752
PYTHON_UBUNTU_STANDALONE_BUILD: https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11+20230507-x86_64-unknown-linux-gnu-install_only.tar.gz
4853
PYTHON_MACOS_STANDALONE_BUILD: https://github.com/indygreg/python-build-standalone/releases/download/20230507/cpython-3.10.11+20230507-x86_64-apple-darwin-install_only.tar.gz
54+
permissions:
55+
contents: write # for uploading release artifacts
56+
4957
steps:
5058
- uses: actions/checkout@v4
5159

.github/workflows/build_wamr_sdk.yml

+6
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ on:
3535
type: string
3636
required: true
3737

38+
permissions:
39+
contents: read
40+
3841
jobs:
3942
build:
4043
runs-on: ${{ inputs.runner }}
44+
permissions:
45+
contents: write # for uploading release artifacts
46+
4147
steps:
4248
- uses: actions/checkout@v4
4349

.github/workflows/build_wamr_vscode_ext.yml

+6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ on:
1414
type: string
1515
required: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
runs-on: ubuntu-22.04
23+
permissions:
24+
contents: write # for uploading release artifacts
25+
2026
steps:
2127
- uses: actions/checkout@v4
2228

.github/workflows/build_wamrc.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ on:
3131
type: string
3232
required: false
3333

34+
permissions:
35+
contents: read
36+
3437
jobs:
3538
build:
3639
runs-on: ${{ inputs.runner }}
40+
permissions:
41+
contents: write # for uploading release artifacts
42+
3743
steps:
3844
- uses: actions/checkout@v4
3945

@@ -56,8 +62,16 @@ jobs:
5662
cmake --build build --config Release --parallel 4
5763
working-directory: wamr-compiler
5864

59-
- name: compress the binary
60-
if: inputs.release
65+
- name: Compress the binary on Windows
66+
if: inputs.runner == 'windows-latest' && inputs.release
67+
run: |
68+
tar -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc.exe
69+
Compress-Archive -Path wamrc.exe -DestinationPath wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
70+
mv wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.* ../
71+
working-directory: wamr-compiler/build/Release
72+
73+
- name: compress the binary on non-Windows
74+
if: inputs.runner != 'windows-latest' && inputs.release
6175
run: |
6276
tar czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
6377
zip wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc

0 commit comments

Comments
 (0)