From 7e107c013b733acf4e4529af0cb9ce9cb838a8e9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 13:32:58 +0900 Subject: [PATCH 01/33] add install_qemu_xtensa.sh --- .github/scripts/install_qemu_xtensa.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 .github/scripts/install_qemu_xtensa.sh diff --git a/.github/scripts/install_qemu_xtensa.sh b/.github/scripts/install_qemu_xtensa.sh new file mode 100755 index 0000000000..ada34b37d0 --- /dev/null +++ b/.github/scripts/install_qemu_xtensa.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +URL=https://github.com/espressif/qemu/releases/download/esp-develop-9.0.0-20240606/qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-x86_64-linux-gnu.tar.xz + +DIR=$(mktemp -d) +cd ${DIR} +curl -fLsS "${URL}" | xzcat | tar -x +ln -s ${DIR}/qemu/bin/qemu-system-xtensa /usr/local/bin/qemu-system/xtensa From 93fb88d12bff5d2a67970361089cb5aea8d5ebf5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 13:53:17 +0900 Subject: [PATCH 02/33] CI: wip xtensa bits --- .github/workflows/spec_test_on_nuttx.yml | 34 +++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 23913403c8..993dd41fba 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -50,7 +50,7 @@ jobs: spec_test_on_qemu: runs-on: ubuntu-latest - needs: [build_llvm_libraries] + needs: [build_llvm_libraries, build_llvm_libraries_xtensa] container: image: ghcr.io/no1wudi/nuttx/apache-nuttx-ci-linux@sha256:8c4e00b607d4d6d66ba8f51c4544819a616eac69d3a2ac669e2af2150e2eb0f9 strategy: @@ -86,6 +86,11 @@ jobs: target: "riscv64", fpu_type: "none" }, + { + config: "boards/xtensa/esp32s3/esp32s3-devkit/configs/toywasm", + target: "xtensa", + fpu_type: "none" + }, ] wamr_test_option: [ @@ -149,7 +154,7 @@ jobs: ./core/deps/llvm/build/lib ./core/deps/llvm/build/libexec ./core/deps/llvm/build/share - key: ${{ needs.build_llvm_libraries.outputs.cache_key }} + key: ${{ matrix.target_config.target == 'xtensa' && needs.build_llvm_libraries_xtensa.outputs.cache_key || needs.build_llvm_libraries.outputs.cache_key }} - name: Quit if cache miss if: contains(matrix.wamr_test_option.mode, 'aot') && steps.retrieve_llvm_libs.outputs.cache-hit != 'true' @@ -206,15 +211,32 @@ jobs: cmake -Bbuild . cmake --build build - - name: Build - id: build_firmware + - name: Build NuttX run: | cd nuttx tools/configure.sh ${{ matrix.target_config.config }} make -j$(nproc) - echo "firmware=$PWD/nuttx" >> $GITHUB_OUTPUT + + - name: Post build processing (xtensa) + if: matrix.target_config.target == 'xtensa' + run: | + cd nuttx + dd if=/dev/zero of=flash.img bs=1024 count=8192 + dd if=nuttx of=flash.img conv=notrunc + mv flash.img nuttx + + - name: Build firmware path + id: build_firmware_path + run: | + echo "firmware=$PWD/nuttx/nuttx" >> $GITHUB_OUTPUT + - name: Install QEMU (xtensa) + if: matrix.target_config.target == 'xtensa' + run: | + ./.github/scripts/install_qemu_xtensa.sh + qemu-system-xtensa --version + - name: Test run: | cd apps/interpreters/wamr/wamr/tests/wamr-test-suites - ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -P -F ${{ steps.build_firmware.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -P -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} From b8c507ceb03b03ecd36ee801ec7b1ec38efe94db Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 15:16:47 +0900 Subject: [PATCH 03/33] spec_test_on_nuttx.yml: use unreleased nuttx for xtensa because 12.4 doesn't have recent esp32s3 related changes. --- .github/workflows/spec_test_on_nuttx.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 993dd41fba..8ad081a5a9 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -127,14 +127,14 @@ jobs: uses: actions/checkout@v4 with: repository: apache/nuttx - ref: releases/12.4 + ref: ${{ matrix.target_config.target == 'xtensa' && '95a9facf3a952eaf3e630cab923ae13db678c875' || 'releases/12.4' }} path: nuttx - name: Checkout NuttX Apps uses: actions/checkout@v4 with: repository: apache/nuttx-apps - ref: releases/12.4 + ref: ${{ matrix.target_config.target == 'xtensa' && '1852731df87e5895e299b74aabdb1984b7e3f795' || 'releases/12.4' }} path: apps - name: Checkout WAMR From 8db053f6b888f3ba8ff4848d7621bbd1d6b36edc Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 17:03:32 +0900 Subject: [PATCH 04/33] spec_test_on_nuttx.yml: tweak nuttx config for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 8ad081a5a9..090e4d07f5 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -204,6 +204,11 @@ jobs: run: | find nuttx/boards -name defconfig | xargs sed -i '$a\# CONFIG_ARCH_DPFPU is not set\n' + - name: Tweak NuttX config (xtensa) + if: matrix.target_config.target == 'xtensa' + run: | + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_XTENSA_SEMIHOSTING_HOSTFS=y\\nCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\\n' + - name: Build wamrc if: contains(matrix.wamr_test_option.mode, 'aot') working-directory: apps/interpreters/wamr/wamr/wamr-compiler From 25e429852d9a0be298cdff8c97755e04b292bcf2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 17:15:10 +0900 Subject: [PATCH 05/33] spec_test_on_nuttx.yml: fix a filename of xtensa image --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 090e4d07f5..43c3a19bb3 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -227,7 +227,7 @@ jobs: run: | cd nuttx dd if=/dev/zero of=flash.img bs=1024 count=8192 - dd if=nuttx of=flash.img conv=notrunc + dd if=nuttx.bin of=flash.img conv=notrunc mv flash.img nuttx - name: Build firmware path From 739c3c6b636b0bc7d3940216417be98b8001fe02 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 17:18:22 +0900 Subject: [PATCH 06/33] spec_test_on_nuttx.yml: install the latest esptool.py for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 43c3a19bb3..23c9bfcd74 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -216,6 +216,12 @@ jobs: cmake -Bbuild . cmake --build build + - name: Install the latest esptool.py (xtensa) + if: matrix.target_config.target == 'xtensa' + run: | + pip3 install esptool==4.7.0 + esptool.py version + - name: Build NuttX run: | cd nuttx From a8cb4a4170a58aafd46e4130f1577854dd7caceb Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 17:59:53 +0900 Subject: [PATCH 07/33] spec_test_on_nuttx.yml: fix install_qemu_xtensa.sh path --- .github/workflows/spec_test_on_nuttx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 23c9bfcd74..2e7c6dbb99 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -246,6 +246,7 @@ jobs: run: | ./.github/scripts/install_qemu_xtensa.sh qemu-system-xtensa --version + working-directory: apps/interpreters/wamr/wamr - name: Test run: | From d3a55975d77bb3f515bc65a10cf4171e507ea18e Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 18:10:35 +0900 Subject: [PATCH 08/33] install_qemu_xtensa.sh: fix a typo --- .github/scripts/install_qemu_xtensa.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/install_qemu_xtensa.sh b/.github/scripts/install_qemu_xtensa.sh index ada34b37d0..4a0e0fe5c0 100755 --- a/.github/scripts/install_qemu_xtensa.sh +++ b/.github/scripts/install_qemu_xtensa.sh @@ -7,4 +7,4 @@ URL=https://github.com/espressif/qemu/releases/download/esp-develop-9.0.0-202406 DIR=$(mktemp -d) cd ${DIR} curl -fLsS "${URL}" | xzcat | tar -x -ln -s ${DIR}/qemu/bin/qemu-system-xtensa /usr/local/bin/qemu-system/xtensa +ln -s ${DIR}/qemu/bin/qemu-system-xtensa /usr/local/bin/qemu-system-xtensa From 6ca01b1e4a608b35ca031ceb015437e61c010437 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 18:47:55 +0900 Subject: [PATCH 09/33] spec_test_on_nuttx.yml: install libsdl2 for qemu --- .github/workflows/spec_test_on_nuttx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 2e7c6dbb99..fd2bbd0e66 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -244,6 +244,7 @@ jobs: - name: Install QEMU (xtensa) if: matrix.target_config.target == 'xtensa' run: | + apt-get update && apt-get install -y libsdl2-2.0-0 ./.github/scripts/install_qemu_xtensa.sh qemu-system-xtensa --version working-directory: apps/interpreters/wamr/wamr From 10acfae08092978de3d864a0c5b2f6ee122e2229 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 19:27:13 +0900 Subject: [PATCH 10/33] spec_test_on_nuttx.yml: disable -P for now --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index fd2bbd0e66..6e3650e148 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -252,4 +252,4 @@ jobs: - name: Test run: | cd apps/interpreters/wamr/wamr/tests/wamr-test-suites - ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -P -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} From 54092b3f7beae31dd5f469d8d902e87d1007e9c8 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 20:21:43 +0900 Subject: [PATCH 11/33] spec_test_on_nuttx.yml: remove existing qemu before installing a new one --- .github/workflows/spec_test_on_nuttx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 6e3650e148..7e3ea5467b 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -244,6 +244,7 @@ jobs: - name: Install QEMU (xtensa) if: matrix.target_config.target == 'xtensa' run: | + apt-get remove -y qemu-system-misc apt-get update && apt-get install -y libsdl2-2.0-0 ./.github/scripts/install_qemu_xtensa.sh qemu-system-xtensa --version From 8c3371aa19625f97f28409f35bb839df6009d8e0 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 21:34:47 +0900 Subject: [PATCH 12/33] spec_test_on_nuttx.yml: use esp32s3-devkit:qemu_debug --- .github/workflows/spec_test_on_nuttx.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 7e3ea5467b..e5e0cd9581 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -87,7 +87,7 @@ jobs: fpu_type: "none" }, { - config: "boards/xtensa/esp32s3/esp32s3-devkit/configs/toywasm", + config: "boards/xtensa/esp32s3/esp32s3-devkit/configs/qemu_debug", target: "xtensa", fpu_type: "none" }, @@ -207,7 +207,7 @@ jobs: - name: Tweak NuttX config (xtensa) if: matrix.target_config.target == 'xtensa' run: | - find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_XTENSA_SEMIHOSTING_HOSTFS=y\\nCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\\n' + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\\n' - name: Build wamrc if: contains(matrix.wamr_test_option.mode, 'aot') From fb43b86913c887ad6f572b0da1c92126c1655308 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 17 Jul 2024 22:00:39 +0900 Subject: [PATCH 13/33] spec_test_on_nuttx.yml: avoid multiple FS_HOSTFS --- .github/workflows/spec_test_on_nuttx.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index e5e0cd9581..6b973885cf 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -29,7 +29,9 @@ env: LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex" WASI_SDK_PATH: "/opt/wasi-sdk" WAMR_COMMON_OPTION: - "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_STACKSIZE=327680\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_ARM_SEMIHOSTING_HOSTFS=y\\nCONFIG_ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE=y\\nCONFIG_RISCV_SEMIHOSTING_HOSTFS=y\\nCONFIG_FS_HOSTFS=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n" + "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_STACKSIZE=327680\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n" + HOSTFS_OPTION: + "CONFIG_ARM_SEMIHOSTING_HOSTFS=y\\nCONFIG_ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE=y\\nCONFIG_RISCV_SEMIHOSTING_HOSTFS=y\\nCONFIG_FS_HOSTFS=y\\n" jobs: build_llvm_libraries: @@ -184,6 +186,11 @@ jobs: - name: Enable WAMR for NuttX run: | find nuttx/boards -name defconfig | xargs sed -i '$a\${{ env.WAMR_COMMON_OPTION }}' + + - name: Enable hostfs for NuttX + if: matrix.target_config.target != 'xtensa' + run: | + find nuttx/boards -name defconfig | xargs sed -i '$a\${{ env.HOSTFS_OPTION }}' - name: Enable WAMR Interpreter for NuttX run: | From f09dfe1fcd72d66fa2d8f4483cc3c4c8396d32f7 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 17:44:08 +0900 Subject: [PATCH 14/33] spec_test_on_nuttx.yml: bump nuttx version for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 6b973885cf..accd304b57 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -129,7 +129,7 @@ jobs: uses: actions/checkout@v4 with: repository: apache/nuttx - ref: ${{ matrix.target_config.target == 'xtensa' && '95a9facf3a952eaf3e630cab923ae13db678c875' || 'releases/12.4' }} + ref: ${{ matrix.target_config.target == 'xtensa' && '985d395b025cf2012b22f6bb4461959fa6d87645' || 'releases/12.4' }} path: nuttx - name: Checkout NuttX Apps From 9992b1459f8af4eaac9576733cfec5928c7ff066 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 18:38:56 +0900 Subject: [PATCH 15/33] spec_test_on_nuttx.yml: upload the report dir for post-mortem debugging --- .github/workflows/spec_test_on_nuttx.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index accd304b57..d26f3ec65e 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -261,3 +261,16 @@ jobs: run: | cd apps/interpreters/wamr/wamr/tests/wamr-test-suites ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} + + - name: pack the log + if: always() + run: | + mkdir log + tar -C apps/interpreters/wamr/wamr/tests/wamr-test-suites/workspace -cvzf log/report.tgz report + + - name: upload the log + if: always() + uses: actions/upload-artifact@v3 + with: + name: spec-test-log-${{ github.run_id }}-${{ strategy.job-index }}-${{ matrix.target_config.target }} + path: log From 13ce92c8929088316e8577b629d338c421e29c71 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 19:51:38 +0900 Subject: [PATCH 16/33] spec_test_on_nuttx.yml: reduce stack size for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index d26f3ec65e..ce355d9100 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -29,7 +29,7 @@ env: LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex" WASI_SDK_PATH: "/opt/wasi-sdk" WAMR_COMMON_OPTION: - "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_STACKSIZE=327680\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n" + "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n" HOSTFS_OPTION: "CONFIG_ARM_SEMIHOSTING_HOSTFS=y\\nCONFIG_ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE=y\\nCONFIG_RISCV_SEMIHOSTING_HOSTFS=y\\nCONFIG_FS_HOSTFS=y\\n" @@ -187,6 +187,16 @@ jobs: run: | find nuttx/boards -name defconfig | xargs sed -i '$a\${{ env.WAMR_COMMON_OPTION }}' + - name: Set WAMR stack size for NuttX + if: matrix.target_config.target != 'xtensa' + run: | + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=327680\n' + + - name: Set WAMR stack size for NuttX (xtensa) + if: matrix.target_config.target == 'xtensa' + run: | + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=25600\n' + - name: Enable hostfs for NuttX if: matrix.target_config.target != 'xtensa' run: | From 574d6b16c5d9a4fd69e596b51b99f2f81b58e8fb Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 20:46:10 +0900 Subject: [PATCH 17/33] spec_test_on_nuttx.yml: collect a few more things --- .github/workflows/spec_test_on_nuttx.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index ce355d9100..362ee3df54 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -276,6 +276,8 @@ jobs: if: always() run: | mkdir log + cp $PWD/nuttx/.config log/dot-config + cp ${{ steps.build_firmware_path.outputs.firmware }} log tar -C apps/interpreters/wamr/wamr/tests/wamr-test-suites/workspace -cvzf log/report.tgz report - name: upload the log From 116ba377bd270f1eb3aa4247ef69dd031035cd06 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 21:02:18 +0900 Subject: [PATCH 18/33] spec_test_on_nuttx.yml: disable INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 362ee3df54..ec648b84ed 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -224,7 +224,7 @@ jobs: - name: Tweak NuttX config (xtensa) if: matrix.target_config.target == 'xtensa' run: | - find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\\n' + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\\n# CONFIG_INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR is not set\\n' - name: Build wamrc if: contains(matrix.wamr_test_option.mode, 'aot') From 5f5bfd0569137dfb61804a75af08069308675e76 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 21:17:35 +0900 Subject: [PATCH 19/33] spec_test_on_nuttx.yml: fix escape --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index ec648b84ed..79a66dac22 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -224,7 +224,7 @@ jobs: - name: Tweak NuttX config (xtensa) if: matrix.target_config.target == 'xtensa' run: | - find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\\n# CONFIG_INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR is not set\\n' + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_AOT_WORD_ALIGN_READ=y\n\# CONFIG_INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR is not set\n' - name: Build wamrc if: contains(matrix.wamr_test_option.mode, 'aot') From bdb8cff443d729c7d2b888086ccd54c52576d6b6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Jul 2024 21:35:45 +0900 Subject: [PATCH 20/33] spec_test_on_nuttx.yml: reduce the stack size for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 79a66dac22..3eaf2179bf 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -195,7 +195,7 @@ jobs: - name: Set WAMR stack size for NuttX (xtensa) if: matrix.target_config.target == 'xtensa' run: | - find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=25600\n' + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=16384\n' - name: Enable hostfs for NuttX if: matrix.target_config.target != 'xtensa' From b5a62d53833be1a7809277f548fb5681ca3c546f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 12:24:29 +0900 Subject: [PATCH 21/33] spec_test_on_nuttx.yml: bump nuttx-apps version for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 3eaf2179bf..d8b3703792 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -136,7 +136,7 @@ jobs: uses: actions/checkout@v4 with: repository: apache/nuttx-apps - ref: ${{ matrix.target_config.target == 'xtensa' && '1852731df87e5895e299b74aabdb1984b7e3f795' || 'releases/12.4' }} + ref: ${{ matrix.target_config.target == 'xtensa' && '2ef3eb25c0cec944b13792185f7e5d5a05990d5f' || 'releases/12.4' }} path: apps - name: Checkout WAMR @@ -169,6 +169,7 @@ jobs: # Inject the config option to NuttX # TODO: Merge this into NuttX once GC is generally available - name: Modify Kconfig + if: matrix.target_config.target != 'xtensa' run: | echo "\n" >> apps/interpreters/wamr/Kconfig echo "config INTERPRETERS_WAMR_GC" >> apps/interpreters/wamr/Kconfig From 864ce60901e25fabf3ce624f68d308f5ba2f6d27 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 12:30:06 +0900 Subject: [PATCH 22/33] spec_test_on_nuttx.yml: reduce xtensa stack size further --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index d8b3703792..bd19cbb9b1 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -196,7 +196,7 @@ jobs: - name: Set WAMR stack size for NuttX (xtensa) if: matrix.target_config.target == 'xtensa' run: | - find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=16384\n' + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=8192\n' - name: Enable hostfs for NuttX if: matrix.target_config.target != 'xtensa' From 8c103a4d2091503af13c6ba830b92051029615a9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 18:11:20 +0900 Subject: [PATCH 23/33] spec_test_on_nuttx.yml: tweak xtensa stack size again the previous value was not enough for a few tests. (eg. call.wast) --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index bd19cbb9b1..3b54a290bb 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -196,7 +196,7 @@ jobs: - name: Set WAMR stack size for NuttX (xtensa) if: matrix.target_config.target == 'xtensa' run: | - find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=8192\n' + find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=25600\n' - name: Enable hostfs for NuttX if: matrix.target_config.target != 'xtensa' From 47b2965e2b371eba6680d1d51148ab3cd49ad034 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 18:57:19 +0900 Subject: [PATCH 24/33] spec_test_on_nuttx.yml: CONFIG_NSH_LINELEN=255 --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 3b54a290bb..4307ee6b60 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -29,7 +29,7 @@ env: LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex" WASI_SDK_PATH: "/opt/wasi-sdk" WAMR_COMMON_OPTION: - "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n" + "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\nCONFIG_NSH_LINELEN=255\\n" HOSTFS_OPTION: "CONFIG_ARM_SEMIHOSTING_HOSTFS=y\\nCONFIG_ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE=y\\nCONFIG_RISCV_SEMIHOSTING_HOSTFS=y\\nCONFIG_FS_HOSTFS=y\\n" From e5306ec2ce13f52a8772fc7b62d1165a7d4f1cb2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 19:10:28 +0900 Subject: [PATCH 25/33] Revert "spec_test_on_nuttx.yml: CONFIG_NSH_LINELEN=255" This reverts commit 34fa7584952dca8fae8dae2125fd667f298c2fa5. --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 4307ee6b60..3b54a290bb 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -29,7 +29,7 @@ env: LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex" WASI_SDK_PATH: "/opt/wasi-sdk" WAMR_COMMON_OPTION: - "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\nCONFIG_NSH_LINELEN=255\\n" + "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_LOG=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\\nCONFIG_EOL_IS_LF=y\\nCONFIG_LIBC_FLOATINGPOINT=y\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n" HOSTFS_OPTION: "CONFIG_ARM_SEMIHOSTING_HOSTFS=y\\nCONFIG_ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE=y\\nCONFIG_RISCV_SEMIHOSTING_HOSTFS=y\\nCONFIG_FS_HOSTFS=y\\n" From b35f8b8f967d86ce788548e2b3d8e7136512702d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 19:14:31 +0900 Subject: [PATCH 26/33] spec_test_on_nuttx.yml: CONFIG_NSH_LINELEN=255 --- .github/workflows/spec_test_on_nuttx.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 3b54a290bb..2b613c34bf 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -240,11 +240,21 @@ jobs: pip3 install esptool==4.7.0 esptool.py version - - name: Build NuttX + - name: Configure NuttX run: | - cd nuttx tools/configure.sh ${{ matrix.target_config.config }} + working-directory: nuttx + + - name: Tweak NuttX config + run: | + kconfig-tweak --set-val CONFIG_NSH_LINELEN 255 + working-directory: nuttx + + - name: Build NuttX + run: | + make olddefconfig make -j$(nproc) + working-directory: nuttx - name: Post build processing (xtensa) if: matrix.target_config.target == 'xtensa' From 1e3c874f9a72d069b2e238a10a6287bfdc207e13 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2024 19:41:40 +0900 Subject: [PATCH 27/33] spec_test_on_nuttx.yml: exclude xtensa+gc --- .github/workflows/spec_test_on_nuttx.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 2b613c34bf..9fefc1657a 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -124,6 +124,10 @@ jobs: - target_config: { config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh64" } wamr_test_option: { mode: "-t aot -X" } + # Our xtensa environment doesn't have enough memory + - target_config: { target: "xtensa" } + wamr_feature_option: { mode: "-G" } + steps: - name: Checkout NuttX uses: actions/checkout@v4 From 8fd47ad8d12c5be8829106fd53c51b824e509dd0 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 22 Jul 2024 14:26:46 +0900 Subject: [PATCH 28/33] Revert "spec_test_on_nuttx.yml: disable -P for now" This reverts commit f190c9669e8835915dcb0c652d8f69a6dba1967a. --- .github/workflows/spec_test_on_nuttx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 9fefc1657a..b4375f173b 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -285,7 +285,7 @@ jobs: - name: Test run: | cd apps/interpreters/wamr/wamr/tests/wamr-test-suites - ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -P -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} - name: pack the log if: always() From 1fbc812d42c063ea1e1fae5c945e9c5729f761a5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 22 Jul 2024 14:56:39 +0900 Subject: [PATCH 29/33] spec_test_on_nuttx.yml: comments --- .github/workflows/spec_test_on_nuttx.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index b4375f173b..98a43e983e 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -136,6 +136,8 @@ jobs: ref: ${{ matrix.target_config.target == 'xtensa' && '985d395b025cf2012b22f6bb4461959fa6d87645' || 'releases/12.4' }} path: nuttx + # Note: we use an unnreleased version nuttx for xtensa because + # 12.4 doesn't contain necessary esp32s3 changes. - name: Checkout NuttX Apps uses: actions/checkout@v4 with: @@ -172,6 +174,10 @@ jobs: # Inject the config option to NuttX # TODO: Merge this into NuttX once GC is generally available + # + # Note: the version of nuttx-apps we use for xtensa does have + # an equivalent. (the default of INTERPRETERS_WAMR_TAIL_CALL is + # different though.) - name: Modify Kconfig if: matrix.target_config.target != 'xtensa' run: | @@ -197,6 +203,8 @@ jobs: run: | find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=327680\n' + # because qemu doesn't have a proper emulation of esp32s3 psram, + # we are limited to the internal ram, which is about 400KB. - name: Set WAMR stack size for NuttX (xtensa) if: matrix.target_config.target == 'xtensa' run: | @@ -226,6 +234,12 @@ jobs: run: | find nuttx/boards -name defconfig | xargs sed -i '$a\# CONFIG_ARCH_DPFPU is not set\n' + # Note: while a real hardware would need + # INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR=y, + # it doesn't work with xtensa qemu which we use on the CI because it + # doesn't have a proper emulation of I/D separate mappings. + # we work it around by using INTERPRETERS_WAMR_MEM_DUAL_BUS_MIRROR=n. + # this configuration won't work on a real hardware. - name: Tweak NuttX config (xtensa) if: matrix.target_config.target == 'xtensa' run: | @@ -238,6 +252,9 @@ jobs: cmake -Bbuild . cmake --build build + # the nuttx version we use for xtensa requires esptool.py newer than + # what we have in the version of the apache-nuttx-ci-linux image we + # currently use. - name: Install the latest esptool.py (xtensa) if: matrix.target_config.target == 'xtensa' run: | @@ -249,6 +266,9 @@ jobs: tools/configure.sh ${{ matrix.target_config.config }} working-directory: nuttx + # depending on configurations, the iwasm command line generated + # by spec-test-script can be longer than the default NSH_LINELEN, + # which is 64 or 80. - name: Tweak NuttX config run: | kconfig-tweak --set-val CONFIG_NSH_LINELEN 255 @@ -260,6 +280,9 @@ jobs: make -j$(nproc) working-directory: nuttx + # for xtensa, build a 8MB firmware image. + # simple boot is assumed. (thus the nuttx.bin offset in the image is 0) + # qemu will infer the flash size from the file size. - name: Post build processing (xtensa) if: matrix.target_config.target == 'xtensa' run: | @@ -273,6 +296,7 @@ jobs: run: | echo "firmware=$PWD/nuttx/nuttx" >> $GITHUB_OUTPUT + # for xtensa, use the espressif fork of qemu, which has esp32s3 support. - name: Install QEMU (xtensa) if: matrix.target_config.target == 'xtensa' run: | From 385528015a076333c151df2454e72f501d5c7637 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 22 Jul 2024 23:37:04 +0900 Subject: [PATCH 30/33] spec_test_on_nuttx.yml: disable parallell execution for xtensa --- .github/workflows/spec_test_on_nuttx.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 98a43e983e..a8a47532e7 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -307,10 +307,23 @@ jobs: working-directory: apps/interpreters/wamr/wamr - name: Test + if: matrix.target_config.target != 'xtensa' run: | cd apps/interpreters/wamr/wamr/tests/wamr-test-suites ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -P -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} + # for xtensa, for some reasons, when running the tests + # with test_wamr.sh -P, nuttx occasionally hangs after + # "total segments stored 6" on the CI. + # i (yamamoto) couldn't reproduce it locally (macOS) even + # with the identical flash image. + # for now, run the tests without -P. + - name: Test + if: matrix.target_config.target == 'xtensa' + run: | + cd apps/interpreters/wamr/wamr/tests/wamr-test-suites + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} + - name: pack the log if: always() run: | From 2e851ed2f2e31d7cd6b5b44dbaed032170785476 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 23 Jul 2024 00:22:51 +0900 Subject: [PATCH 31/33] spec_test_on_nuttx.yml: comments --- .github/workflows/spec_test_on_nuttx.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index a8a47532e7..a5af5ceaf4 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -129,6 +129,8 @@ jobs: wamr_feature_option: { mode: "-G" } steps: + # Note: we use an unreleased version nuttx for xtensa because + # 12.4 doesn't contain necessary esp32s3 changes. - name: Checkout NuttX uses: actions/checkout@v4 with: @@ -136,8 +138,6 @@ jobs: ref: ${{ matrix.target_config.target == 'xtensa' && '985d395b025cf2012b22f6bb4461959fa6d87645' || 'releases/12.4' }} path: nuttx - # Note: we use an unnreleased version nuttx for xtensa because - # 12.4 doesn't contain necessary esp32s3 changes. - name: Checkout NuttX Apps uses: actions/checkout@v4 with: @@ -210,6 +210,8 @@ jobs: run: | find nuttx/boards -name defconfig | xargs sed -i '$aCONFIG_INTERPRETERS_WAMR_STACKSIZE=25600\n' + # Note: the nuttx config we happened to use for xtensa already has + # hostfs enabled. - name: Enable hostfs for NuttX if: matrix.target_config.target != 'xtensa' run: | From 3ee978d698f49dd97aad4b5134cefb1a9106315a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 24 Jul 2024 17:09:16 +0900 Subject: [PATCH 32/33] spec_test_on_nuttx.yml: remove post-mortem debugging stuff to make the patch smaller. i probabyl will submit this as a separate PR later. --- .github/workflows/spec_test_on_nuttx.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index a5af5ceaf4..2cfa54cb47 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -325,18 +325,3 @@ jobs: run: | cd apps/interpreters/wamr/wamr/tests/wamr-test-suites ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -F ${{ steps.build_firmware_path.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}} - - - name: pack the log - if: always() - run: | - mkdir log - cp $PWD/nuttx/.config log/dot-config - cp ${{ steps.build_firmware_path.outputs.firmware }} log - tar -C apps/interpreters/wamr/wamr/tests/wamr-test-suites/workspace -cvzf log/report.tgz report - - - name: upload the log - if: always() - uses: actions/upload-artifact@v3 - with: - name: spec-test-log-${{ github.run_id }}-${{ strategy.job-index }}-${{ matrix.target_config.target }} - path: log From 2ce141ad00f450951c8889286e5fc897b88a3fb3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 25 Jul 2024 13:09:22 +0900 Subject: [PATCH 33/33] spec_test_on_nuttx.yml: comment --- .github/workflows/spec_test_on_nuttx.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/spec_test_on_nuttx.yml b/.github/workflows/spec_test_on_nuttx.yml index 2cfa54cb47..6d476aa1e2 100644 --- a/.github/workflows/spec_test_on_nuttx.yml +++ b/.github/workflows/spec_test_on_nuttx.yml @@ -255,8 +255,7 @@ jobs: cmake --build build # the nuttx version we use for xtensa requires esptool.py newer than - # what we have in the version of the apache-nuttx-ci-linux image we - # currently use. + # what we have in our version of the apache-nuttx-ci-linux image. - name: Install the latest esptool.py (xtensa) if: matrix.target_config.target == 'xtensa' run: |