diff --git a/scripts/add_queries.sh b/scripts/add_queries.sh index 88a8abc1..405b21ee 100755 --- a/scripts/add_queries.sh +++ b/scripts/add_queries.sh @@ -73,7 +73,6 @@ tar xf "$tarfile" progress "queries" 0 "Entering $source." cd "$source" -chown -R root:root . progress "queries" 0 "Creating git repo." rm -rf .git || true #Remove any existing git repo @@ -103,11 +102,11 @@ read -ra MAKES <<< $makecmd for i in ${MAKES[@]}; do IFS=' ' read -ra ARGS <<< $i - echo "/tools/btrace/sw-btrace ${ARGS[@]}" + echo "$lava/tools/btrace/sw-btrace ${ARGS[@]}" CC=/usr/lib/llvm-11/bin/clang \ CXX=/usr/lib/llvm-11/bin/clang++ \ CFLAGS="-O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/" \ - /tools/btrace/sw-btrace ${ARGS[@]} + $lava/tools/btrace/sw-btrace ${ARGS[@]} IFS='&&' done IFS=$ORIGIN_IFS @@ -120,7 +119,7 @@ bash -c $install progress "queries" 0 "Creating compile_commands.json..." # Delete any pre-existing compile commands.json (could be in archive by mistake) rm -f compile_commands.json -/tools/btrace/sw-btrace-to-compiledb /usr/lib/llvm-11/lib/clang/11/include +$lava/tools/btrace/sw-btrace-to-compiledb /usr/lib/llvm-11/lib/clang/11/include if [ -e "$directory/$name/extra_compile_commands.json" ]; then sed -i '$d' compile_commands.json echo "," >> compile_commands.json @@ -131,14 +130,14 @@ git commit -m 'Add compile_commands.json.' cd .. -c_files=$($python /tools/lavaTool/get_c_files.py $source) +c_files=$($python $lava/tools/lavaTool/get_c_files.py $source) c_dirs=$(for i in $c_files; do dirname $i; done | sort | uniq) progress "queries" 0 "Copying include files..." for i in $c_dirs; do echo " $i" if [ -d $i ]; then - cp /tools/include/*.h $i/ + cp $lava/tools/include/*.h $i/ fi done @@ -147,7 +146,7 @@ done # i.e., which have only prototypes, which have bodies. progress "queries" 0 "Figure out functions" for this_c_file in $c_files; do - /tools/install/bin/lavaFnTool $this_c_file + $lava/tools/install/bin/lavaFnTool $this_c_file done #progress "queries" 0 "Initialize variables..." @@ -167,8 +166,8 @@ fnfiles=$(echo $c_files | sed 's/\.c/\.c\.fn/g') fninstr=$directory/$name/fninstr echo "Creating fninstr [$fninstr]" -echo -e "\twith command: \"python fninstr.py -d -o $fninstr $fnfiles\"" -$python fninstr.py -d -o $fninstr $fnfiles +echo -e "\twith command: \"python $lava/scripts/fninstr.py -d -o $fninstr $fnfiles\"" +$python $lava/scripts/fninstr.py -d -o $fninstr $fnfiles if [[ ! -z "$df_fn_blacklist" ]]; then cmd=$(echo "sed -i /${df_fn_blacklist}/d $fninstr") @@ -182,7 +181,7 @@ if [ "$dataflow" = "true" ]; then # Since it's okay to pass the whitelist either way progress "queries" 0 "Inserting queries for dataflow" for i in $c_files; do - /tools/install/bin/lavaTool -action=query \ + $lava/tools/install/bin/lavaTool -action=query \ -lava-db="$directory/$name/lavadb" \ -p="$directory/$name/$source/compile_commands.json" \ -arg_dataflow \ @@ -196,7 +195,7 @@ else progress "queries" 0 "Inserting queries..." # TODO: remove lava-wl here, unless we're using it to limit where we inject for i in $c_files; do - /tools/install/bin/lavaTool -action=query \ + $lava/tools/install/bin/lavaTool -action=query \ -lava-db="$directory/$name/lavadb" \ -lava-wl="$fninstr" \ -p="$source/compile_commands.json" \ @@ -210,7 +209,7 @@ fi # Do we need to explicitly apply replacements in the root source directory # This causes clang-apply-replacements to segfault when run a 2nd time #pushd "$directory/$name/$source" -#/usr/lib/llvm-11/bin//clang-apply-replacements . +#/usr/lib/llvm-11/bin/clang-apply-replacements . #popd for i in $c_dirs; do diff --git a/scripts/lava.sh b/scripts/lava.sh index 0e258c65..b51ce698 100755 --- a/scripts/lava.sh +++ b/scripts/lava.sh @@ -105,7 +105,7 @@ fi if [[ $demo -eq 1 ]] then - gnome-terminal --geometry=90x40 -x bash -c "python $(dirname $0)/demo.py $json; read" & + gnome-terminal --geometry=90x40 -x bash -c "$python $(dirname $0)/demo.py $json; read" & fi progress "everything" 1 "JSON file is $json" @@ -134,7 +134,7 @@ RESET_DB() { progress "everything" 1 "Resetting lava db -- logging to $lf" run_remote "$buildhost" "dropdb -U postgres -h database $db || true" "$lf" run_remote "$buildhost" "createdb -U postgres -h database $db || true" "$lf" - run_remote "$buildhost" "psql -d $db -h database -f /tools/lavaODB/generated/lava.sql -U postgres" "$lf" + run_remote "$buildhost" "psql -d $db -h database -f $lava/tools/lavaODB/generated/lava.sql -U postgres" "$lf" run_remote "$buildhost" "echo dbwipe complete" "$lf" } @@ -164,7 +164,7 @@ if [ $add_queries -eq 1 ]; then lf="$logs/add_queries.log" truncate "$lf" progress "everything" 1 "Adding queries to source with type $ATP and $project_name -- logging to $lf" - run_remote "$buildhost" "'add_queries.sh $ATP_TYPE $project_name'" "$lf" + run_remote "$buildhost" "'$scripts/add_queries.sh $ATP_TYPE $project_name'" "$lf" if [ "$fixupscript" != "null" ]; then lf="$logs/fixups.log" truncate "$lf" diff --git a/scripts/vars.sh b/scripts/vars.sh index 4248f528..484e51ad 100644 --- a/scripts/vars.sh +++ b/scripts/vars.sh @@ -65,7 +65,8 @@ if [ "$(jq -r .injfixupsscript $json)" != "null" ]; then injfixupsscript="${injfixupsscript/\{bug_build\}/$bug_build}" fi -buildhost="$(jq -r '.buildhost // "docker"' $json)" +# buildhost="$(jq -r '.buildhost // "docker"' $json)" +buildhost="localhost" pandahost="$(jq -r '.pandahost // "docker"' $json)" testinghost="$(jq -r '.testinghost // "docker"' $json)" logs="$output_dir/$name/logs" @@ -79,7 +80,7 @@ configure_cmd=$(jq -r '.configure // "/bin/true"' $json) container="$(jq -r '.docker // "lava32"' $json)" # Constants -scripts="/scripts" +scripts="$lava/scripts" python="/usr/bin/python3" pdb="/usr/bin/python3 -m pdb " dockername="lava32"