forked from facebookexperimental/MIRAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate.sh
executable file
·42 lines (35 loc) · 1.45 KB
/
validate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash -v
#Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Exit immediately if a command exits with a non-zero status.
set -e
# start clean
cargo clean
cargo update
# Run format checks
cargo fmt --all
# Run lint checks
cargo audit
cargo clippy --all-features --all-targets -- -D warnings
# Build mirai (in debug mode) so that we can build the standard contracts
cargo build
# build the mirai-standard-contracts crate
touch standard_contracts/src/lib.rs
RUSTFLAGS="-C overflow-checks=off" cargo build --lib -p mirai-standard-contracts
touch standard_contracts/src/lib.rs
RUSTFLAGS="-C overflow-checks=off" RUSTC_WRAPPER=target/debug/mirai RUST_BACKTRACE=1 MIRAI_LOG=warn MIRAI_START_FRESH=true MIRAI_SHARE_PERSISTENT_STORE=true MIRAI_FLAGS="--diag=paranoid" cargo build --lib -p mirai-standard-contracts
# collect the summary store into a tar file
cd target/debug/deps
tar -c -f ../../../binaries/summary_store.tar .summary_store.sled
cd ../../..
# Run cargo test, starting clean so that the new summary store is used.
cargo clean
cargo build --tests
time cargo test
# Install MIRAI into cargo so that we can use optimized binaries to analyze debug binaries built with special flags
cargo uninstall mirai || true
cargo install --path ./checker
# Run mirai on itself (using the optimized build in cargo as the bootstrap).
cargo clean
cargo mirai