Skip to content

Commit 8f8c560

Browse files
authored
Raise wasi-sdk to 25 and wabt to 1.0.37 (#4187)
Raise wasi-sdk to 25 and wabt to 1.0.37. It includes - Refactor CI workflow to install WASI-SDK and WABT from a composite action - Use ExternalProject to bring wasm-apps for few samples. file/ wasi-threads/ - Refactor sample build and test steps in SGX compilation workflow for improved clarity and efficiency (workaround) Add CMake support for EMSCRIPTEN and WAMRC, update module paths
1 parent ecb47d9 commit 8f8c560

File tree

17 files changed

+213
-266
lines changed

17 files changed

+213
-266
lines changed
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/compilation_on_android_ubuntu.yml

Lines changed: 20 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,10 @@ jobs:
315315
fail-fast: false
316316
matrix:
317317
os: [ubuntu-22.04]
318-
wasi_sdk_release:
319-
[
320-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz"
321-
]
322-
wabt_release:
323-
[
324-
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
325-
]
326318
include:
327319
- os: ubuntu-22.04
328320
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
321+
329322
steps:
330323
- name: checkout
331324
uses: actions/checkout@v4
@@ -346,19 +339,10 @@ jobs:
346339
if: (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
347340
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
348341

349-
- name: download and install wasi-sdk
350-
run: |
351-
cd /opt
352-
sudo wget ${{ matrix.wasi_sdk_release }}
353-
sudo tar -xzf wasi-sdk-*.tar.gz
354-
sudo ln -sf wasi-sdk-25.0-x86_64-linux wasi-sdk
355-
356-
- name: download and install wabt
357-
run: |
358-
cd /opt
359-
sudo wget ${{ matrix.wabt_release }}
360-
sudo tar -xzf wabt-1.0.31-*.tar.gz
361-
sudo mv wabt-1.0.31 wabt
342+
- name: install-wasi-sdk-wabt
343+
uses: ./.github/actions/install-wasi-sdk-wabt
344+
with:
345+
os: ${{ matrix.os }}
362346

363347
- name: Build wamrc
364348
run: |
@@ -397,14 +381,6 @@ jobs:
397381
$MULTI_TIER_JIT_BUILD_OPTIONS,
398382
]
399383
os: [ubuntu-22.04]
400-
wasi_sdk_release:
401-
[
402-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz",
403-
]
404-
wabt_release:
405-
[
406-
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
407-
]
408384
include:
409385
- os: ubuntu-22.04
410386
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
@@ -430,12 +406,10 @@ jobs:
430406
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS')) && (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
431407
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
432408

433-
- name: download and install wabt
434-
run: |
435-
cd /opt
436-
sudo wget ${{ matrix.wabt_release }}
437-
sudo tar -xzf wabt-1.0.31-*.tar.gz
438-
sudo mv wabt-1.0.31 wabt
409+
- name: install-wasi-sdk-wabt
410+
uses: ./.github/actions/install-wasi-sdk-wabt
411+
with:
412+
os: ${{ matrix.os }}
439413

440414
- name: Build wamrc
441415
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
@@ -464,34 +438,14 @@ jobs:
464438
strategy:
465439
matrix:
466440
os: [ubuntu-22.04]
467-
wasi_sdk_release:
468-
[
469-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz"
470-
]
471-
wabt_release:
472-
[
473-
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
474-
]
475441
include:
476442
- os: ubuntu-22.04
477443
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
444+
478445
steps:
479446
- name: checkout
480447
uses: actions/checkout@v4
481448

482-
- name: download and install wasi-sdk
483-
run: |
484-
cd /opt
485-
sudo wget ${{ matrix.wasi_sdk_release }}
486-
sudo tar -xzf wasi-sdk-*.tar.gz
487-
sudo ln -sf wasi-sdk-25.0-x86_64-linux wasi-sdk
488-
489-
- name: download and install wabt
490-
run: |
491-
cd /opt
492-
sudo wget ${{ matrix.wabt_release }}
493-
sudo tar -xzf wabt-1.0.31-*.tar.gz
494-
sudo ln -sf wabt-1.0.31 wabt
495449
- name: Get LLVM libraries
496450
id: retrieve_llvm_libs
497451
uses: actions/cache@v4
@@ -503,12 +457,19 @@ jobs:
503457
./core/deps/llvm/build/libexec
504458
./core/deps/llvm/build/share
505459
key: ${{ matrix.llvm_cache_key }}
460+
461+
- name: install-wasi-sdk-wabt
462+
uses: ./.github/actions/install-wasi-sdk-wabt
463+
with:
464+
os: ${{ matrix.os }}
465+
506466
- name: Build wamrc
507467
run: |
508468
mkdir build && cd build
509469
cmake ..
510470
cmake --build . --config Release --parallel 4
511471
working-directory: wamr-compiler
472+
512473
- name: Build Sample [basic]
513474
run: |
514475
cd samples/basic
@@ -634,10 +595,6 @@ jobs:
634595
$MEMORY64_TEST_OPTIONS,
635596
$MULTI_MEMORY_TEST_OPTIONS,
636597
]
637-
wasi_sdk_release:
638-
[
639-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz"
640-
]
641598
include:
642599
- os: ubuntu-22.04
643600
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
@@ -706,11 +663,9 @@ jobs:
706663

707664
- name: download and install wasi-sdk
708665
if: matrix.test_option == '$WASI_TEST_OPTIONS'
709-
run: |
710-
cd /opt
711-
sudo wget ${{ matrix.wasi_sdk_release }}
712-
sudo tar -xzf wasi-sdk-*.tar.gz
713-
sudo ln -sf wasi-sdk-25.0-x86_64-linux wasi-sdk
666+
uses: ./.github/actions/install-wasi-sdk-wabt
667+
with:
668+
os: ${{ matrix.os }}
714669

715670
# It is a temporary solution until new wasi-sdk that includes bug fixes is released
716671
- name: build wasi-libc from source

.github/workflows/compilation_on_macos.yml

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -228,24 +228,14 @@ jobs:
228228
#$AOT_BUILD_OPTIONS,
229229
]
230230
os: [macos-13]
231-
wasi_sdk_release:
232-
[
233-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-macos.tar.gz",
234-
]
235-
wabt_release:
236-
[
237-
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-macos-12.tar.gz",
238-
]
239231
steps:
240232
- name: checkout
241233
uses: actions/checkout@v4
242234

243-
- name: download and install wabt
244-
run: |
245-
cd /opt
246-
sudo wget ${{ matrix.wabt_release }}
247-
sudo tar -xzf wabt-1.0.31-*.tar.gz
248-
sudo mv wabt-1.0.31 wabt
235+
- name: install-wasi-sdk-wabt
236+
uses: ./.github/actions/install-wasi-sdk-wabt
237+
with:
238+
os: ${{ matrix.os }}
249239

250240
- name: Build Sample [wasm-c-api]
251241
run: |
@@ -260,14 +250,6 @@ jobs:
260250
strategy:
261251
matrix:
262252
os: [macos-13, macos-14]
263-
wasi_sdk_release:
264-
[
265-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-macos.tar.gz",
266-
]
267-
wabt_release:
268-
[
269-
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-macos-12.tar.gz",
270-
]
271253
include:
272254
- os: macos-13
273255
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
@@ -277,19 +259,10 @@ jobs:
277259
- name: checkout
278260
uses: actions/checkout@v4
279261

280-
- name: download and install wasi-sdk
281-
run: |
282-
cd /opt
283-
sudo wget ${{ matrix.wasi_sdk_release }}
284-
sudo tar -xzf wasi-sdk-*.tar.gz
285-
sudo ln -sf wasi-sdk-20.0 wasi-sdk
286-
287-
- name: download and install wabt
288-
run: |
289-
cd /opt
290-
sudo wget ${{ matrix.wabt_release }}
291-
sudo tar -xzf wabt-1.0.31-*.tar.gz
292-
sudo ln -sf wabt-1.0.31 wabt
262+
- name: install-wasi-sdk-wabt
263+
uses: ./.github/actions/install-wasi-sdk-wabt
264+
with:
265+
os: ${{ matrix.os }}
293266

294267
- name: Build Sample [basic]
295268
run: |
@@ -356,12 +329,13 @@ jobs:
356329
cmake --build . --config Release --parallel 4
357330
working-directory: wamr-compiler
358331

332+
# cmake --build . --config Debug --parallel 4
359333
- name: Build Sample [wasi-threads]
360334
run: |
361335
cd samples/wasi-threads
362336
mkdir build && cd build
363337
cmake ..
364-
cmake --build . --config Debug --parallel 4
338+
cmake --build . --config Debug --verbose
365339
./iwasm wasm-apps/no_pthread.wasm
366340
367341
../../../wamr-compiler/build/wamrc --size-level=0 --enable-multi-thread -o wasm-apps/no_pthread.aot wasm-apps/no_pthread.wasm

0 commit comments

Comments
 (0)