xref: /rust-libc-0.2.174/ci/wasi.sh (revision 3e48e4b2)
1#!/usr/bin/env bash
2
3set -eux
4
5apt-get update
6apt-get install -y --no-install-recommends \
7    ca-certificates \
8    curl \
9    clang \
10    xz-utils
11
12# Wasmtime is used to execute tests and wasi-sdk is used to compile tests.
13# Download appropriate versions here and configure various flags below.
14#
15# At the time of this writing wasmtime 24.0.0 is the latest release and
16# wasi-sdk-24 is the latest release, that these numbers match is just
17# coincidence.
18wasmtime=24.0.0
19wasi_sdk=24
20
21curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$wasmtime/wasmtime-v$wasmtime-x86_64-linux.tar.xz |
22    tar xJf -
23mv wasmtime-v$wasmtime-x86_64-linux wasmtime
24
25# The pre-built `*.deb` files for wasi-sdk install to `/opt/wasi-sdk`
26curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$wasi_sdk/wasi-sdk-$wasi_sdk.0-x86_64-linux.deb
27dpkg -i ./wasi-sdk-*.deb
28