-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathdetect.sh
More file actions
executable file
·56 lines (52 loc) · 1.76 KB
/
Copy pathdetect.sh
File metadata and controls
executable file
·56 lines (52 loc) · 1.76 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# this script's location
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
recursive=false
while [ $# -gt 0 ]; do
case "$1" in
-r|--recursive)
recursive=true
shift
;;
*)
detecting_dir="$1"
shift
;;
esac
done
if [ -z "${detecting_dir:-}" ]; then
echo "No detecting directory is provided"
echo "Usage: ./detect.sh [-r|--recursive] DIRNAME"
exit 1
fi
# Build lockbud
# cargo build
# For development of lockbud use debug
# export RUSTC_WRAPPER=${PWD}/target/debug/lockbud
# For usage use release
cargo build --release
export RUSTC_WRAPPER=${PWD}/target/release/lockbud
export RUST_BACKTRACE=full
export LOCKBUD_LOG=info
# To only detect inter,intra
#export LOCKBUD_FLAGS="--detector-kind deadlock --crate-name-list inter,intra"
# or shorter
#export LOCKBUD_FLAGS="-k deadlock -l inter,intra"
# To skip detecting inter or intra
#export LOCKBUD_FLAGS="--detector-kind deadlock --blacklist-mode --crate-name-list inter,intra"
# or shorter
#export LOCKBUD_FLAGS="-k deadlock -b -l inter,intra"
#export LOCKBUD_FLAGS="-k deadlock -b -l cc"
#export LOCKBUD_FLAGS="-k atomicity_violation"
#export LOCKBUD_FLAGS="-k memory"
#export LOCKBUD_FLAGS="-k panic"
pushd "${detecting_dir}" > /dev/null
if [ "${recursive}" = true ]; then
export LOCKBUD_FLAGS=${LOCKBUD_FLAGS:-"-k all"}
else
crate_name=$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json, sys; data = json.load(sys.stdin); print(data["packages"][0]["name"])')
export LOCKBUD_FLAGS=${LOCKBUD_FLAGS:-"-k all -l ${crate_name}"}
fi
cargo clean
cargo build
popd > /dev/null