Skip to content

Commit 081c344

Browse files
authored
feat: add support for checking unsupported build configurations (#4690)
* feat: add support for checking unsupported build configurations * docs: improve clarity and formatting in build_wamr.md * feat: add check for unsupported SHARED_HEAP + FAST_JIT configuration and update documentation warning * feat: disable default SIMD setting for 64-bit platform in CMake configuration * feat: update Android and macOS workflows to handle SIMD support in classic interp mode * feat: update SGX compilation workflow to handle unsupported FAST_JIT and classic interp mode without SIMD support * feat: enhance check for unsupported CLASSIC_INTERP configurations * feat: disable fast interpreter for shared heap tests and update unsupported features test library * feat: enhance unsupported combination checks and update build configurations for JIT and SIMD * In regression tests, use llvm-jit and fast-jit to replace multi-tier-jit + running mode. Multi-tier-jit contains both fast-jit and llvm-jit. Fast-jit doesn't support SIMD, but llvm-jit does. So, should multi-tier-jit support SIMD? My answer is NO. - The regular form of multi-tier-jit uses fast-jit as tier1 and llvm-jit as tier2. Therefore, if fast-jit doesn't support SIMD, the entire multi-tier doesn't support SIMD either. - `--fast-jit` and `--llvm-jit` of multi-tier-jit should adhere to the global limitations of multi-tier-jit. * Explicitly specify SIMD, MULTI_MODULE, and their unsupported running modes. - SIMD and Ref. types are enabled by default on linux and darwin. So remove duplicate feature testing from CI - Apply new configuration for wasm-c-api compilation commands
1 parent ea9e11c commit 081c344

File tree

15 files changed

+533
-187
lines changed

15 files changed

+533
-187
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ jobs:
9191
arch: "X86"
9292

9393
build_wamrc:
94-
needs:
95-
[build_llvm_libraries_on_ubuntu_2204]
94+
needs: [build_llvm_libraries_on_ubuntu_2204]
9695
runs-on: ${{ matrix.os }}
9796
strategy:
9897
matrix:
@@ -129,8 +128,7 @@ jobs:
129128
working-directory: wamr-compiler
130129

131130
build_iwasm:
132-
needs:
133-
[build_llvm_libraries_on_ubuntu_2204]
131+
needs: [build_llvm_libraries_on_ubuntu_2204]
134132
runs-on: ${{ matrix.os }}
135133
strategy:
136134
matrix:
@@ -157,8 +155,6 @@ jobs:
157155
"-DWAMR_BUILD_MEMORY_PROFILING=1",
158156
"-DWAMR_BUILD_MULTI_MODULE=1",
159157
"-DWAMR_BUILD_PERF_PROFILING=1",
160-
"-DWAMR_BUILD_REF_TYPES=1",
161-
"-DWAMR_BUILD_SIMD=1",
162158
"-DWAMR_BUILD_LIB_SIMDE=1",
163159
"-DWAMR_BUILD_TAIL_CALL=1",
164160
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
@@ -171,8 +167,7 @@ jobs:
171167
os: [ubuntu-22.04]
172168
platform: [android, linux]
173169
exclude:
174-
# incompatible feature and platform
175-
# incompatible mode and feature
170+
# incompatible feature and platform and mode
176171
# MULTI_MODULE only on INTERP mode and AOT mode
177172
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
178173
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
@@ -182,9 +177,6 @@ jobs:
182177
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
183178
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
184179
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
185-
# SIMD only on JIT/AOT/fast interpreter mode
186-
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
187-
make_options_feature: "-DWAMR_BUILD_SIMD=1"
188180
# DEBUG_INTERP only on CLASSIC INTERP mode
189181
- make_options_run_mode: $AOT_BUILD_OPTIONS
190182
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
@@ -268,6 +260,15 @@ jobs:
268260
include:
269261
- os: ubuntu-22.04
270262
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
263+
# classic interp doesn't support SIMD
264+
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
265+
extra_options: "-DWAMR_BUILD_SIMD=0"
266+
# fast jit doesn't support SIMD
267+
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
268+
extra_options: "-DWAMR_BUILD_SIMD=0"
269+
# multi-tier jit doesn't support SIMD
270+
- make_options_run_mode: $MULTI_TIER_JIT_BUILD_OPTIONS
271+
extra_options: "-DWAMR_BUILD_SIMD=0"
271272
steps:
272273
- name: checkout
273274
uses: actions/checkout@v6
@@ -294,7 +295,7 @@ jobs:
294295
if: matrix.platform == 'linux'
295296
run: |
296297
mkdir build && cd build
297-
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
298+
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }} ${{ matrix.extra_options}}
298299
cmake --build . --config Release --parallel 4
299300
working-directory: product-mini/platforms/${{ matrix.platform }}
300301

@@ -308,20 +309,13 @@ jobs:
308309
working-directory: product-mini/platforms/${{ matrix.platform }}
309310

310311
build_unit_tests:
311-
needs:
312-
[
313-
build_llvm_libraries_on_ubuntu_2204,
314-
build_wamrc
315-
]
312+
needs: [build_llvm_libraries_on_ubuntu_2204, build_wamrc]
316313
runs-on: ${{ matrix.os }}
317314
strategy:
318315
fail-fast: false
319316
matrix:
320317
os: [ubuntu-22.04]
321-
build_target: [
322-
"X86_64",
323-
"X86_32",
324-
]
318+
build_target: ["X86_64", "X86_32"]
325319
include:
326320
- os: ubuntu-22.04
327321
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
@@ -350,7 +344,7 @@ jobs:
350344
uses: ./.github/actions/install-wasi-sdk-wabt
351345
with:
352346
os: ${{ matrix.os }}
353-
347+
354348
- name: Build wamrc
355349
run: |
356350
mkdir build && cd build
@@ -374,16 +368,15 @@ jobs:
374368
working-directory: tests/unit
375369

376370
build_regression_tests:
377-
needs:
378-
[build_llvm_libraries_on_ubuntu_2204]
371+
needs: [build_llvm_libraries_on_ubuntu_2204]
379372
runs-on: ${{ matrix.os }}
380373
strategy:
381374
matrix:
382375
os: [ubuntu-22.04]
383376
include:
384377
- os: ubuntu-22.04
385378
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
386-
379+
387380
steps:
388381
- name: checkout
389382
uses: actions/checkout@v6
@@ -403,24 +396,19 @@ jobs:
403396
- name: Quit if cache miss
404397
if: (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
405398
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
406-
399+
407400
- name: Build wamrc and iwasm
408401
run: |
409402
./build_wamr.sh
410403
working-directory: tests/regression/ba-issues
411-
404+
412405
- name: Run regression tests
413406
run: |
414407
python run.py
415408
working-directory: tests/regression/ba-issues
416409

417410
build_samples_wasm_c_api:
418-
needs:
419-
[
420-
build_iwasm,
421-
build_llvm_libraries_on_ubuntu_2204,
422-
build_wamrc,
423-
]
411+
needs: [build_iwasm, build_llvm_libraries_on_ubuntu_2204, build_wamrc]
424412
runs-on: ${{ matrix.os }}
425413
strategy:
426414
fail-fast: false
@@ -439,6 +427,20 @@ jobs:
439427
include:
440428
- os: ubuntu-22.04
441429
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
430+
# classic interp doesn't support SIMD
431+
- make_options: $CLASSIC_INTERP_BUILD_OPTIONS
432+
extra_options: "-DWAMR_BUILD_SIMD=0"
433+
# fast jit doesn't support Multi-module and SIMD
434+
- make_options: $FAST_JIT_BUILD_OPTIONS
435+
extra_options: "-DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_MULTI_MODULE=0"
436+
# multi-tier jit doesn't support Multi-module and SIMD
437+
- make_options: $MULTI_TIER_JIT_BUILD_OPTIONS
438+
extra_options: "-DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_MULTI_MODULE=0"
439+
# LLVM JIT doesn't support Multi-module
440+
- make_options: $LLVM_LAZY_JIT_BUILD_OPTIONS
441+
extra_options: "-DWAMR_BUILD_MULTI_MODULE=0"
442+
- make_options: $LLVM_EAGER_JIT_BUILD_OPTIONS
443+
extra_options: "-DWAMR_BUILD_MULTI_MODULE=0"
442444

443445
steps:
444446
- name: checkout
@@ -477,7 +479,7 @@ jobs:
477479
- name: Build Sample [wasm-c-api]
478480
run: |
479481
VERBOSE=1
480-
cmake -S . -B build ${{ matrix.make_options }}
482+
cmake -S . -B build ${{ matrix.make_options }} ${{ matrix.extra_options }}
481483
cmake --build build --config Debug --parallel 4
482484
ctest --test-dir build --output-on-failure
483485
working-directory: samples/wasm-c-api
@@ -488,12 +490,7 @@ jobs:
488490
working-directory: samples/printversion
489491

490492
build_samples_others:
491-
needs:
492-
[
493-
build_iwasm,
494-
build_llvm_libraries_on_ubuntu_2204,
495-
build_wamrc,
496-
]
493+
needs: [build_iwasm, build_llvm_libraries_on_ubuntu_2204, build_wamrc]
497494
runs-on: ${{ matrix.os }}
498495
strategy:
499496
matrix:
@@ -632,12 +629,7 @@ jobs:
632629
./import-func-callback
633630
634631
test:
635-
needs:
636-
[
637-
build_iwasm,
638-
build_llvm_libraries_on_ubuntu_2204,
639-
build_wamrc,
640-
]
632+
needs: [build_iwasm, build_llvm_libraries_on_ubuntu_2204, build_wamrc]
641633
runs-on: ${{ matrix.os }}
642634
strategy:
643635
fail-fast: false

.github/workflows/compilation_on_macos.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ jobs:
138138
"-DWAMR_BUILD_MEMORY_PROFILING=1",
139139
"-DWAMR_BUILD_MULTI_MODULE=1",
140140
"-DWAMR_BUILD_PERF_PROFILING=1",
141-
"-DWAMR_BUILD_REF_TYPES=1",
142-
"-DWAMR_BUILD_SIMD=1",
143141
"-DWAMR_BUILD_TAIL_CALL=1",
144142
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
145143
"-DWAMR_BUILD_EXTENDED_CONST_EXPR=1",
@@ -154,11 +152,6 @@ jobs:
154152
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
155153
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
156154
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
157-
# SIMD only on JIT/AOT mode
158-
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
159-
make_options_feature: "-DWAMR_BUILD_SIMD=1"
160-
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
161-
make_options_feature: "-DWAMR_BUILD_SIMD=1"
162155
# DEBUG_INTERP only on CLASSIC INTERP mode
163156
- make_options_run_mode: $AOT_BUILD_OPTIONS
164157
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
@@ -188,6 +181,9 @@ jobs:
188181
include:
189182
- os: macos-13
190183
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
184+
# classic interp doesn't support SIMD
185+
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
186+
extra_options: "-DWAMR_BUILD_SIMD=0"
191187
steps:
192188
- name: checkout
193189
uses: actions/checkout@v6
@@ -213,7 +209,7 @@ jobs:
213209
- name: Build iwasm
214210
run: |
215211
mkdir build && cd build
216-
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
212+
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }} ${{ matrix.extra_options }}
217213
cmake --build . --config Release --parallel 4
218214
working-directory: product-mini/platforms/${{ matrix.platform }}
219215

@@ -240,6 +236,20 @@ jobs:
240236
include:
241237
- os: macos-13
242238
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
239+
# classic interp doesn't support SIMD
240+
- make_options: $CLASSIC_INTERP_BUILD_OPTIONS
241+
extra_options: "-DWAMR_BUILD_SIMD=0"
242+
# fast jit doesn't support Multi-module and SIMD
243+
- make_options: $FAST_JIT_BUILD_OPTIONS
244+
extra_options: "-DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_MULTI_MODULE=0"
245+
# multi-tier jit doesn't support Multi-module and SIMD
246+
- make_options: $MULTI_TIER_JIT_BUILD_OPTIONS
247+
extra_options: "-DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_MULTI_MODULE=0"
248+
# LLVM JIT doesn't support Multi-module
249+
- make_options: $LLVM_LAZY_JIT_BUILD_OPTIONS
250+
extra_options: "-DWAMR_BUILD_MULTI_MODULE=0"
251+
- make_options: $LLVM_EAGER_JIT_BUILD_OPTIONS
252+
extra_options: "-DWAMR_BUILD_MULTI_MODULE=0"
243253

244254
steps:
245255
- name: checkout
@@ -278,7 +288,7 @@ jobs:
278288
- name: Build Sample [wasm-c-api]
279289
run: |
280290
VERBOSE=1
281-
cmake -S . -B build ${{ matrix.make_options }}
291+
cmake -S . -B build ${{ matrix.make_options }} ${{ matrix.extra_options }}
282292
cmake --build build --config Debug --parallel 4
283293
ctest --test-dir build --output-on-failure
284294
working-directory: samples/wasm-c-api

.github/workflows/compilation_on_sgx.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ jobs:
114114
# MINI_LOADER only on INTERP mode
115115
- make_options_run_mode: $AOT_BUILD_OPTIONS
116116
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
117+
# FAST_JIT doesn't support MULTI_MODULE
118+
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
119+
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
120+
include:
121+
# classic interp mode doesn't support SIMD
122+
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
123+
make_options_feature: "-DWAMR_BUILD_SIMD=0"
117124
steps:
118125
- name: checkout
119126
uses: actions/checkout@v6

.github/workflows/compilation_on_windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ jobs:
7878
"-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
7979
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
8080
"-DWAMR_BUILD_REF_TYPES=1",
81-
"-DWAMR_BUILD_SIMD=1",
8281
"-DWAMR_BUILD_DEBUG_INTERP=1",
8382
"-DWAMR_BUILD_LIB_PTHREAD=1",
8483
"-DWAMR_BUILD_LIB_WASI_THREADS=1",

0 commit comments

Comments
 (0)