You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/03/03 17:40:32 UTC
[nuttx] branch master updated: tools/ci: setup wasi-sdk/wamrc into cibuild
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new a7de849944 tools/ci: setup wasi-sdk/wamrc into cibuild
a7de849944 is described below
commit a7de849944e5b4e90055a4611d3dc95a4573ddf3
Author: chao an <an...@xiaomi.com>
AuthorDate: Fri Mar 3 15:24:16 2023 +0800
tools/ci: setup wasi-sdk/wamrc into cibuild
wasi-sdk:
https://github.com/WebAssembly/wasi-sdk
wamrc:
https://github.com/bytecodealliance/wasm-micro-runtime
Signed-off-by: chao an <an...@xiaomi.com>
---
tools/ci/cibuild.sh | 37 +++++++++++++++++++++++++++++++++++--
tools/ci/docker/linux/Dockerfile | 19 +++++++++++++++++++
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/tools/ci/cibuild.sh b/tools/ci/cibuild.sh
index a5ce2f6992..19a830ed9a 100755
--- a/tools/ci/cibuild.sh
+++ b/tools/ci/cibuild.sh
@@ -447,6 +447,39 @@ function u-boot-tools {
fi
}
+function wasi-sdk {
+ add_path "${tools}"/wamrc
+
+ if [ ! -f "${tools}/wasi-sdk/bin/clang" ]; then
+ cd "${tools}"
+ mkdir wamrc
+
+ case ${os} in
+ Darwin)
+ wget --quiet https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-macos.tar.gz
+ tar xzf wasi-sdk-19.0-macos.tar.gz
+ mv wasi-sdk-19.0 wasi-sdk
+ cd wamrc
+ wget --quiet https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-macos-latest.tar.gz
+ tar xzf wamrc-1.1.2-x86_64-macos-latest.tar.gz
+ ;;
+ Linux)
+ wget --quiet https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
+ tar xzf wasi-sdk-19.0-linux.tar.gz
+ mv wasi-sdk-19.0 wasi-sdk
+ cd wamrc
+ wget --quiet https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
+ tar xzf wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
+ ;;
+ esac
+ fi
+
+ export WASI_SDK_PATH="${tools}/wasi-sdk"
+
+ ${WASI_SDK_PATH}/bin/clang --version
+ wamrc --version
+}
+
function usage {
echo ""
echo "USAGE: $0 [-i] [-s] [-c] [-*] <testlist>"
@@ -516,7 +549,7 @@ function install_tools {
case ${os} in
Darwin)
- install="arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty elf-toolchain gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust xtensa-esp32-gcc-toolchain u-boot-tools c-cache"
+ install="arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty elf-toolchain gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust xtensa-esp32-gcc-toolchain u-boot-tools wasi-sdk c-cache"
mkdir -p "${tools}"/homebrew
export HOMEBREW_CACHE=${tools}/homebrew
# https://github.com/apache/arrow/issues/15025
@@ -535,7 +568,7 @@ case ${os} in
brew update --quiet
;;
Linux)
- install="arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty clang-tidy gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust rx-gcc-toolchain sparc-gcc-toolchain xtensa-esp32-gcc-toolchain u-boot-tools c-cache"
+ install="arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty clang-tidy gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust rx-gcc-toolchain sparc-gcc-toolchain xtensa-esp32-gcc-toolchain u-boot-tools wasi-sdk c-cache"
;;
esac
diff --git a/tools/ci/docker/linux/Dockerfile b/tools/ci/docker/linux/Dockerfile
index 925b57f7fd..99ada3ba25 100644
--- a/tools/ci/docker/linux/Dockerfile
+++ b/tools/ci/docker/linux/Dockerfile
@@ -211,6 +211,20 @@ RUN mkdir -p /tools/blobs && cd /tools/blobs \
&& curl -s -L "https://github.com/espressif/esp-nuttx-bootloader/releases/download/latest/partition-table-esp32s2.bin" -o partition-table-esp32s2.bin \
&& curl -s -L "https://github.com/espressif/esp-nuttx-bootloader/releases/download/latest/partition-table-esp32s3.bin" -o partition-table-esp32s3.bin
+###############################################################################
+# Build image for tool required by WASM builds
+###############################################################################
+FROM nuttx-toolchain-base AS nuttx-toolchain-wasm
+# Download the latest WASI-enabled WebAssembly C/C++ toolchain prebuilt by WASM
+RUN mkdir wasi-sdk && \
+ curl -s -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz" \
+ | tar -C wasi-sdk --strip-components 1 -xz
+
+# Download the latest "wamrc" AOT compiler prebuilt by WAMR
+RUN mkdir wamrc && \
+ curl -s -L "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz" \
+ | tar -C wamrc -xz
+
###############################################################################
# Final Docker image used for running CI system. This includes all toolchains
# supported by the CI system.
@@ -350,6 +364,11 @@ ENV PATH="/tools/xtensa-esp32s3-elf-gcc/bin:$PATH"
RUN mkdir -p /tools/blobs/esp-bins
COPY --from=nuttx-toolchain-esp32 /tools/blobs/* /tools/blobs/esp-bins/
+# WASI-enabled WebAssembly C/C++ toolchain
+COPY --from=nuttx-toolchain-wasm /tools/wasi-sdk/ wasi-sdk/
+ENV WASI_SDK_PATH="/tools/wasi-sdk"
+ENV PATH="/tools/wamr:$PATH"
+
# Configure ccache
RUN mkdir -p /tools/ccache/bin && \
ln -sf `which ccache` /tools/ccache/bin/aarch64-none-elf-gcc && \