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 <anchao@xiaomi.com>
This commit is contained in:
parent
83bbb54558
commit
a7de849944
@ -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
|
||||
|
||||
|
@ -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 && \
|
||||
|
Loading…
x
Reference in New Issue
Block a user