Skip to content

Commit 1394b8a

Browse files
authored
Merge pull request #4356 from lum1n0us/fix/merge_into_dev_shared_heap_from_main
merge commits into dev/shared_heap from main From 68e4534 Iterate callstack API to 7f968f5 wasi_socket_ext.c: avoid tls to make this library-friendly
2 parents c5a33e0 + c7473d5 commit 1394b8a

File tree

333 files changed

+9454
-4501
lines changed

Some content is hidden

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

333 files changed

+9454
-4501
lines changed

.dockerignore

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
# for now, it is used to speed up wasi-nn tests only.
22
# you shall adapt below rules to incoming requirements
33

4-
build
5-
*/build
6-
*/*/build
7-
*/*/*/build
8-
*/*/*/*/build
9-
*/*/*/*/*/build
10-
*/*/*/*/*/*/build
4+
**/build
5+
**/tmp.*
116
.*
7+
**/*.gguf
128

13-
core/deps
14-
!core/deps/tensorflow-src
15-
samples
16-
tests
9+
/core/deps/
10+
!/core/deps/tensorflow-src
11+
/samples
12+
/tests
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# Always follow https://download.01.org/intel-sgx/latest/linux-latest/docs/
5+
6+
name: "Install Intel SGX SDK"
7+
description: "Installs the Intel SGX SDK and necessary libraries for Ubuntu."
8+
author: "Intel Corporation"
9+
inputs:
10+
os:
11+
description: "Operating system to install on (ubuntu-22.04)"
12+
required: true
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Check Runner OS
18+
if: ${{ inputs.os != 'ubuntu-22.04' }}
19+
shell: bash
20+
run: |
21+
echo "::error title=⛔ error hint::Only support ubuntu-22.04 for now"
22+
exit 1
23+
24+
- name: Create installation directory
25+
shell: bash
26+
run: sudo mkdir -p /opt/intel
27+
28+
- name: Download and install SGX SDK on ubuntu-22.04
29+
if: ${{ inputs.os == 'ubuntu-22.04' }}
30+
shell: bash
31+
run: |
32+
sudo wget -O sgx_linux_x64_sdk.bin https://download.01.org/intel-sgx/sgx-linux/2.25/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.25.100.3.bin
33+
sudo chmod +x sgx_linux_x64_sdk.bin
34+
echo 'yes' | sudo ./sgx_linux_x64_sdk.bin
35+
working-directory: /opt/intel
36+
37+
- name: Add SGX repository and install libraries
38+
shell: bash
39+
run: |
40+
echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list
41+
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
42+
sudo apt update
43+
sudo apt install -y libsgx-launch libsgx-urts
44+
45+
- name: Source SGX SDK environment
46+
shell: bash
47+
run: source /opt/intel/sgxsdk/environment
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# Get URLs from:
5+
# - https://github.com/WebAssembly/wasi-sdk/releases
6+
# - https://github.com/WebAssembly/wabt/releases
7+
8+
# Install WASI-SDK and WABT at /opt
9+
# /opt is the assumed location widely used in the project
10+
name: Install WASI-SDK and WABT
11+
12+
description: A composite action to download and install wasi-sdk and wabt on Ubuntu, macOS.
13+
14+
inputs:
15+
os:
16+
description: "Operating system to install on (ubuntu, macos)"
17+
required: true
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Check Runner OS
23+
if: ${{ !startsWith(inputs.os, 'ubuntu') && !startsWith(inputs.os, 'windows') && !startsWith(inputs.os, 'macos') }}
24+
shell: bash
25+
run: |
26+
echo "::error title=⛔ error hint::Support Ubuntu, Windows, and macOS Only"
27+
exit 1
28+
29+
- name: Set up wasi-sdk and wabt on Ubuntu
30+
if: ${{ startsWith(inputs.os, 'ubuntu') }}
31+
shell: bash
32+
run: |
33+
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz
34+
sudo tar -xf wasi-sdk.tar.gz
35+
sudo ln -sf wasi-sdk-25.0-x86_64-linux/ wasi-sdk
36+
sudo wget -O wabt.tar.gz --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/1.0.37/wabt-1.0.37-ubuntu-20.04.tar.gz
37+
sudo tar -xf wabt.tar.gz
38+
sudo ln -sf wabt-1.0.37 wabt
39+
/opt/wasi-sdk/bin/clang --version
40+
/opt/wabt/bin/wasm-interp --version
41+
echo "::notice::wasi-sdk-25 and wabt-1.0.37 installed on ubuntu"
42+
working-directory: /opt
43+
44+
- name: Set up wasi-sdk and wabt on macOS-13 (intel)
45+
if: ${{ inputs.os == 'macos-13' }}
46+
shell: bash
47+
run: |
48+
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-macos.tar.gz
49+
sudo tar -xf wasi-sdk.tar.gz
50+
sudo ln -sf wasi-sdk-25.0-x86_64-macos wasi-sdk
51+
sudo wget -O wabt.tar.gz --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/1.0.36/wabt-1.0.36-macos-12.tar.gz
52+
sudo tar -xf wabt.tar.gz
53+
sudo ln -sf wabt-1.0.36 wabt
54+
/opt/wasi-sdk/bin/clang --version
55+
/opt/wabt/bin/wasm-interp --version
56+
echo "::notice::wasi-sdk-25 and wabt-1.0.36 installed on macos-13"
57+
working-directory: /opt
58+
59+
- name: Set up wasi-sdk and wabt on macOS-14 (arm64)
60+
if: ${{ inputs.os == 'macos-14' }}
61+
shell: bash
62+
run: |
63+
sudo wget -O wasi-sdk.tar.gz --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-arm64-macos.tar.gz
64+
sudo tar -xf wasi-sdk.tar.gz
65+
sudo ln -sf wasi-sdk-25.0-arm64-macos wasi-sdk
66+
sudo wget -O wabt.tar.gz --progress=dot:giga https://github.com/WebAssembly/wabt/releases/download/1.0.37/wabt-1.0.37-macos-14.tar.gz
67+
sudo tar -xf wabt.tar.gz
68+
sudo ln -sf wabt-1.0.37 wabt
69+
/opt/wasi-sdk/bin/clang --version
70+
/opt/wabt/bin/wasm-interp --version
71+
echo "::notice::wasi-sdk-25 and wabt-1.0.37 installed on macos-14"
72+
working-directory: /opt
73+
74+
#TODO: Add support for Windows
75+
- name: Set up wasi-sdk and wabt on Windows
76+
if: ${{ startsWith(inputs.os, 'windows') }}
77+
shell: powershell
78+
run: |
79+
echo "::notice::Support for Windows is not implemented yet"
80+
exit 1

.github/workflows/build_iwasm_release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ jobs:
137137
- name: compress the binary on non-Windows
138138
if: inputs.runner != 'windows-latest'
139139
run: |
140-
tar czf iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
140+
# Follow the symlink to the actual binary file
141+
tar --dereference -czf iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
141142
zip iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
142143
working-directory: ${{ inputs.cwd }}/build
143144

.github/workflows/build_llvm_libraries.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
shell: bash
6666
run: |
6767
echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --llvm-ver)" >> $GITHUB_OUTPUT
68+
working-directory: build-scripts
6869

6970
# Bump the prefix number to evict all previous caches and
7071
# enforce a clean build, in the unlikely case that some
@@ -88,14 +89,6 @@ jobs:
8889
./core/deps/llvm/build/share
8990
key: ${{ steps.create_lib_cache_key.outputs.key}}
9091

91-
- uses: actions/cache@v4
92-
with:
93-
path: ~/.ccache
94-
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
95-
restore-keys: |
96-
0-ccache-${{ inputs.os }}
97-
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'ubuntu-20.04'
98-
9992
- uses: actions/cache@v4
10093
with:
10194
path: ~/.cache/ccache

.github/workflows/build_wamr_lldb.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,20 @@ jobs:
172172
python3 ci/validate_lldb.py --port 1239 --lldb core/deps/wamr-lldb/bin/lldb --wamr wamr-debug/iwasm --verbose
173173
working-directory: .
174174

175+
# Define CMAKE_OSX_SYSROOT to avoid the error:
176+
# no such file or directory: 'llvm-project/build/tools/lldb/tools/debugserver/source/mach_excServer.c'
177+
# no such file or directory: 'llvm-project/build/tools/lldb/tools/debugserver/source/mach_excUser.c'
178+
#
179+
# This workaround should be removed when the issue is fixed in llvm-project:
180+
# - https://github.com/llvm/llvm-project/pull/138020/
175181
- name: build lldb macos
176182
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
177183
run: |
178184
echo "start to build lldb..."
179185
mkdir -p wamr-lldb
180186
cmake -S ./llvm -B build \
181187
-G Ninja \
188+
-DCMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path) \
182189
-DCMAKE_INSTALL_PREFIX=../wamr-lldb \
183190
-DCMAKE_BUILD_TYPE:STRING="Release" \
184191
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \

.github/workflows/build_wamrc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ jobs:
7373
- name: compress the binary on non-Windows
7474
if: inputs.runner != 'windows-latest' && inputs.release
7575
run: |
76-
tar czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
76+
# Follow the symlink to the actual binary file
77+
tar --dereference -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
7778
zip wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc
7879
working-directory: wamr-compiler/build
7980

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
name: confirm version.h stay in sync
4+
5+
on:
6+
workflow_call:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
confirm_version:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v4
18+
19+
- name: cmake execute to generate version.h
20+
run: cmake -B build_version -S .
21+
22+
- name: confirm version.h
23+
run: |
24+
if [ -z "$(git status --porcelain | grep version.h)" ]; then
25+
echo "version.h is in sync"
26+
else
27+
echo "version.h is not in sync"
28+
exit 1
29+
fi

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
# Initializes the CodeQL tools for scanning.
5555
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@v3.28.8
56+
uses: github/codeql-action/init@v3.28.19
5757
with:
5858
languages: ${{ matrix.language }}
5959

@@ -70,7 +70,7 @@ jobs:
7070
- run: |
7171
./.github/scripts/codeql_buildscript.sh
7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v3.28.8
73+
uses: github/codeql-action/analyze@v3.28.19
7474
with:
7575
category: "/language:${{matrix.language}}"
7676
upload: false
@@ -99,14 +99,14 @@ jobs:
9999
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
100100

101101
- name: Upload CodeQL results to code scanning
102-
uses: github/codeql-action/upload-sarif@v3.28.8
102+
uses: github/codeql-action/upload-sarif@v3.28.19
103103
with:
104104
sarif_file: ${{ steps.step1.outputs.sarif-output }}
105105
category: "/language:${{matrix.language}}"
106106

107107
- name: Upload CodeQL results as an artifact
108108
if: success() || failure()
109-
uses: actions/upload-artifact@v4.6.0
109+
uses: actions/upload-artifact@v4.6.2
110110
with:
111111
name: codeql-results
112112
path: ${{ steps.step1.outputs.sarif-output }}

.github/workflows/coding_guidelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919

2020
jobs:
2121
compliance_job:
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-22.04
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v4

0 commit comments

Comments
 (0)