Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

1.3 KB
Raw Blame
#!/bin/bash

# This is a small script to assist in running the `pulley_provenance_test` test
# located at `tests/all/pulley.rs`. The goal of this script is to use the native
# host to compile the wasm module in question to avoid needing to run Cranelift
# under MIRI. That enables much faster iteration on the test here.

# Note that this requires a nightly toolchain for the use of miri. If your
# default toolchain is not a nightly toolchain, you can run this script via
# `rustup run nightly ./ci/miri-provenance-test.sh`.

set -ex

compile() {
  cargo run --no-default-features --features compile,pulley,wat,gc-copying,component-model,component-model-async,debug \
    compile --target pulley64 $1 \
    -o ${1%.wat}.cwasm \
    -O memory-reservation=$((1 << 20)) \
    -O memory-guard-size=0 \
    -O signals-based-traps=n \
    -D guest-debug=y \
    -W function-references,component-model-async,component-model-async-stackful,component-model-more-async-builtins,component-model-error-context
}

compile ./tests/all/pulley_provenance_test.wat
compile ./tests/all/pulley_provenance_test_component.wat
compile ./tests/all/pulley_provenance_test_async_component.wat

MIRIFLAGS="$MIRIFLAGS -Zmiri-disable-isolation -Zmiri-permissive-provenance" \
  cargo miri test --test all -- \
    --ignored pulley_provenance_test "$@"