diff --git a/.gitignore b/.gitignore index 9666d11842..62c4b718ce 100644 --- a/.gitignore +++ b/.gitignore @@ -55,8 +55,8 @@ hie.yaml *~ dev-tools/*.cabal booster/*.cabal -/booster/scripts/logs -/booster/scripts/bug-reports +/scripts/logs +/scripts/bug-reports /booster/test/rpc-integration/resources/*.dylib /booster/test/*/definition/*kompiled/ diff --git a/scripts/booster-analysis.sh b/scripts/booster-analysis.sh index fb4c5509a6..098f7ad600 100755 --- a/scripts/booster-analysis.sh +++ b/scripts/booster-analysis.sh @@ -18,11 +18,11 @@ nix_shell() { nix_shell "cabal build kore-rpc-booster" -export SERVER=$(nix_shell "cabal exec which kore-rpc-booster") +export SERVER=$(nix_shell "cabal exec which kore-rpc-booster" | tail -1) nix_shell "cabal build kore-rpc-client" -export CLIENT=$(nix_shell "cabal exec which kore-rpc-client") +export CLIENT=$(nix_shell "cabal exec which kore-rpc-client" | tail -1) export LOG_DIR=${LOG_DIR:-"$BUG_REPORT_DIR-logs"} @@ -37,7 +37,7 @@ export PLUGIN_DIR=$(nix build github:runtimeverification/blockchain-k-plugin/$PL run_tarball(){ echo "######## $1 ########"; - $SCRIPT_DIR/run-with-tarball.sh $1 -l Aborts --print-stats 2>&1 | tee $LOG_DIR/$(basename $1).out; + $SCRIPT_DIR/run-with-tarball.sh "$1" -l Aborts --print-stats 2>&1 | tee "$LOG_DIR/$(basename "$1").out"; } export -f run_tarball diff --git a/scripts/performance-tests-mx.sh b/scripts/performance-tests-mx.sh index edd035c460..313f8c79a0 100755 --- a/scripts/performance-tests-mx.sh +++ b/scripts/performance-tests-mx.sh @@ -47,12 +47,12 @@ git clone --depth 1 --branch $MX_VERSION https://github.com/runtimeverification/ cd mx-backend if [[ $MX_VERSION == "master" ]]; then - MX_VERSION=$(git name-rev --tags --name-only $(git rev-parse HEAD)) + MX_VERSION=$(git rev-parse --short HEAD) else MX_VERSION="${MX_VERSION//\//-}" fi -git submodule update --init --recursive --depth 1 kmxwasm/k-src/mx-semantics/ +git submodule update --init --recursive --depth 1 BUG_REPORT='' POSITIONAL_ARGS=() @@ -78,17 +78,17 @@ done set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters -feature_shell "poetry -C kmxwasm install && make -C kmxwasm kbuild-haskell" +feature_shell "make kmxwasm && make build" mkdir -p $SCRIPT_DIR/logs -feature_shell "make -C kmxwasm test-booster TEST_ARGS='$BUG_REPORT' && make -C kmxwasm test-integration TEST_ARGS='$BUG_REPORT' | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-$FEATURE_BRANCH_NAME.log" +feature_shell "(make -C kmxwasm test-booster TEST_ARGS='$BUG_REPORT' && make -C kmxwasm test-integration TEST_ARGS='$BUG_REPORT') | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-$FEATURE_BRANCH_NAME.log" killall kore-rpc-booster || echo "No zombie processes found" if [ -z "$BUG_REPORT" ]; then if [ ! -e "$SCRIPT_DIR/logs/mx-$MX_VERSION-master-$MASTER_COMMIT_SHORT.log" ]; then - master_shell "make -C kmxwasm test-booster && make -C kmxwasm test-integration | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-master-$MASTER_COMMIT_SHORT.log" + master_shell "(make -C kmxwasm test-booster && make -C kmxwasm test-integration) | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-master-$MASTER_COMMIT_SHORT.log" killall kore-rpc-booster || echo "No zombie processes found" fi diff --git a/scripts/run-with-tarball.sh b/scripts/run-with-tarball.sh index 245f8521db..fd9e4ed59d 100755 --- a/scripts/run-with-tarball.sh +++ b/scripts/run-with-tarball.sh @@ -14,7 +14,7 @@ set -exo pipefail tarball=${1?"Tarball argument missing"} shift -tarname=$(basename $tarball) +tarname=$(basename "$tarball") booster=${BOOSTER:-$(realpath $(dirname $0)/..)} server=${SERVER:-$booster/.build/kore/bin/kore-rpc-booster} @@ -49,7 +49,7 @@ trap 'rm -rf "$TEMPD"' EXIT if [ -z "$DEFINITION" ]; then # unpack definition file from tarball, into $TEMPD dir - tar xf $tarball -O definition.kore > $TEMPD/definition.kore + tar xf "$tarball" -O definition.kore > $TEMPD/definition.kore kore=$TEMPD/definition.kore else kore=$DEFINITION @@ -66,7 +66,7 @@ MODULE=$(grep -o -e "^module [A-Z0-9-]*" $kore | tail -1 | sed -e "s/module //") # build llvm backend unless provided if [ -z "${LLVM_LIB}" ]; then - tar xf $tarball -O llvm_definition/definition.kore > $TEMPD/llvm-definition.kore + tar xf "$tarball" -O llvm_definition/definition.kore > $TEMPD/llvm-definition.kore LLVM_DEFINITION_SHA=$(sha1sum $TEMPD/llvm-definition.kore | awk '{ print $1 }') @@ -135,7 +135,7 @@ server_port=$($LSOF -a -p${server_pid} -sTCP:LISTEN -iTCP | grep ${server_pid} | echo "Server listening on port ${server_port}" -echo "Running requests from $tarball against the server: $client run-tarball $tarball --keep-going -p ${server_port} -h 127.0.0.1" -$client run-tarball $tarball --keep-going -p ${server_port} -h 127.0.0.1 +echo "Running requests from $tarball against the server: $client run-tarball '$tarball' --keep-going -p ${server_port} -h 127.0.0.1" +$client run-tarball "$tarball" --keep-going -p ${server_port} -h 127.0.0.1 -echo "Done with $tarball" +echo "Done with '$tarball'"