@@ -22,17 +22,30 @@ if [[ $FEATURE_BRANCH_NAME == "master" ]]; then
22
22
fi
23
23
24
24
# Create a temporary directory and store its name in a variable.
25
- TEMPD=$( mktemp -d)
25
+ FRESH_TEMPD=0
26
+ TEMPD=${TEMPD:- ' ' }
27
+ if [ -z " $TEMPD " ]; then
28
+ FRESH_TEMPD=1
29
+ TEMPD=$( mktemp -d)
30
+ fi
31
+ KEEP_TEMPD=${KEEP_TEMPD:- ' ' }
26
32
27
33
# Exit if the temp directory wasn't created successfully.
28
34
if [ ! -e " $TEMPD " ]; then
29
35
>&2 echo " Failed to create temp directory"
30
36
exit 1
31
37
fi
32
38
33
- # Make sure the temp directory gets removed and kore-rpc-booster gets killed on script exit.
34
- trap " exit 1" HUP INT PIPE QUIT TERM
35
- trap ' rm -rf "$TEMPD" && killall kore-rpc-booster || echo "No zombie processes found"' EXIT
39
+ clean_up () {
40
+ if [ -z " $KEEP_TEMPD " ]; then
41
+ rm -rf " $TEMPD "
42
+ fi
43
+ killall kore-rpc-booster || echo " no zombie processes found"
44
+ }
45
+
46
+ # Make sure the temp directory gets removed (unless KEEP_TEMPD is set) and kore-rpc-booster gets killed on script exit.
47
+ trap " exit 1" HUP INT PIPE QUIT TERM
48
+ trap clean_up EXIT
36
49
37
50
feature_shell () {
38
51
GC_DONT_GC=1 nix develop . --extra-experimental-features ' nix-command flakes' --override-input k-framework/haskell-backend $SCRIPT_DIR /../ --command bash -c " $1 "
@@ -43,7 +56,9 @@ master_shell() {
43
56
}
44
57
45
58
cd $TEMPD
46
- git clone --depth 1 --branch $KEVM_VERSION https://github.com/runtimeverification/evm-semantics.git
59
+ if [[ $FRESH_TEMPD -gt 0 ]]; then
60
+ git clone --depth 1 --branch $KEVM_VERSION https://github.com/runtimeverification/evm-semantics.git
61
+ fi
47
62
cd evm-semantics
48
63
49
64
if [[ $KEVM_VERSION == " master" ]]; then
52
67
KEVM_VERSION=" ${KEVM_VERSION// \/ / -} "
53
68
fi
54
69
55
- git submodule update --init --recursive --depth 1 kevm-pyk/src/kevm_pyk/kproj/plugin
70
+ if [[ $FRESH_TEMPD -gt 0 ]]; then
71
+ git submodule update --init --recursive --depth 1 kevm-pyk/src/kevm_pyk/kproj/plugin
72
+ fi
56
73
57
74
BUG_REPORT=' '
58
75
POSITIONAL_ARGS=()
77
94
78
95
set -- " ${POSITIONAL_ARGS[@]} " # restore positional parameters
79
96
80
- feature_shell " make poetry && poetry run -C kevm-pyk -- kdist --verbose build evm-semantics.plugin evm-semantics.haskell --jobs 4"
97
+ if [[ $FRESH_TEMPD -gt 0 ]]; then
98
+ # kompile evm-semantics
99
+ feature_shell " make poetry && poetry run -C kevm-pyk -- kdist --verbose build evm-semantics.plugin evm-semantics.haskell --jobs 4"
100
+ fi
81
101
102
+ # kompile all verification K definitions and specs
103
+ PREKOMPILED_DIR=$TEMPD /prekompiled
104
+ mkdir -p $PREKOMPILED_DIR
105
+ feature_shell " cd kevm-pyk && poetry run pytest src/tests/integration/test_prove.py::test_kompile_targets -vv --maxfail=0 --kompiled-targets-dir $PREKOMPILED_DIR "
82
106
83
107
mkdir -p $SCRIPT_DIR /logs
84
108
85
- feature_shell " make test-prove-pyk PYTEST_PARALLEL=$PYTEST_PARALLEL PYTEST_ARGS='--maxfail=0 --timeout 7200 -vv --use-booster $BUG_REPORT ' | tee $SCRIPT_DIR /logs/kevm-$KEVM_VERSION -$FEATURE_BRANCH_NAME .log"
109
+ feature_shell " make test-prove-pyk PYTEST_PARALLEL=$PYTEST_PARALLEL PYTEST_ARGS='--maxfail=0 --timeout 7200 -vv --use-booster $BUG_REPORT --kompiled-targets-dir $PREKOMPILED_DIR ' | tee $SCRIPT_DIR /logs/kevm-$KEVM_VERSION -$FEATURE_BRANCH_NAME .log"
86
110
killall kore-rpc-booster || echo " No zombie processes found"
87
111
88
112
89
113
if [ -z " $BUG_REPORT " ]; then
90
114
if [ ! -e " $SCRIPT_DIR /logs/kevm-$KEVM_VERSION -master-$MASTER_COMMIT_SHORT .log" ]; then
91
- master_shell " make test-prove-pyk PYTEST_PARALLEL=$PYTEST_PARALLEL PYTEST_ARGS='--maxfail=0 --timeout 7200 -vv --use-booster' | tee $SCRIPT_DIR /logs/kevm-$KEVM_VERSION -master-$MASTER_COMMIT_SHORT .log"
115
+ master_shell " make test-prove-pyk PYTEST_PARALLEL=$PYTEST_PARALLEL PYTEST_ARGS='--maxfail=0 --timeout 7200 -vv --use-booster --kompiled-targets-dir $PREKOMPILED_DIR ' | tee $SCRIPT_DIR /logs/kevm-$KEVM_VERSION -master-$MASTER_COMMIT_SHORT .log"
92
116
killall kore-rpc-booster || echo " No zombie processes found"
93
117
fi
94
118
0 commit comments