From 64a84447f5934a8e192883cbb11a3c6f1b196bf5 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Tue, 1 Jul 2025 12:06:25 -0400 Subject: [PATCH] Make shebangs consistent 1. Use /usr/bin/env for lookup 2. Use bash instead of sh 3. Set euo and pipefail for bash --- coq/extracted/patch.sh | 2 +- docker_entry_point.sh | 2 +- public/deploy.sh | 2 +- tests/bmc/run_bmc_tests_slow.sh | 2 +- tests/common.sh | 2 +- tests/csmith/small_arrays/gen.sh | 2 +- tests/csmith/small_int_arith/gen.sh | 2 +- tests/csmith/small_mix/gen.sh | 2 +- tests/csmith/tools/run_compare.sh | 2 +- tests/gcc-torture/breakdown/run.sh | 2 +- tests/gcc-torture/run.sh | 2 +- tests/hacl-star/build.sh | 2 +- tests/popl/cppmem/run.sh | 2 +- tests/popl/section4/run.sh | 2 +- tests/run-cheri.sh | 2 +- tests/run-ci.sh | 2 +- tests/run-core.sh | 2 +- tests/run-ocaml.sh | 2 +- tests/run.sh | 2 +- tests/run_tcc.sh | 2 +- tests/tests-cheri.sh | 2 +- tests/tests.sh | 2 +- tools/colours.sh | 2 +- tools/hack.sh | 2 +- tools/jenkins.sh | 2 +- tools/load-wg14.sh | 2 +- tools/mysloc | 2 +- tools/tex.sh | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/coq/extracted/patch.sh b/coq/extracted/patch.sh index f835d7ce8..c79447be1 100755 --- a/coq/extracted/patch.sh +++ b/coq/extracted/patch.sh @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail patch -p0 -r 0 -s --read-only=ignore --follow-symlinks -o - $1 -i extracted/CRelationClasses.mli.patch diff --git a/docker_entry_point.sh b/docker_entry_point.sh index f430b6663..502661387 100644 --- a/docker_entry_point.sh +++ b/docker_entry_point.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail eval `opam env` && $* diff --git a/public/deploy.sh b/public/deploy.sh index d0e458599..3c877f42b 100755 --- a/public/deploy.sh +++ b/public/deploy.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail ## This script deploy Cerberus UI and send it to the server ## PS: only works in my machine due to SSH credentials diff --git a/tests/bmc/run_bmc_tests_slow.sh b/tests/bmc/run_bmc_tests_slow.sh index 2a3af5f59..57841bfe4 100755 --- a/tests/bmc/run_bmc_tests_slow.sh +++ b/tests/bmc/run_bmc_tests_slow.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail ./run_bmc_tests.ml --check-rcu diff --git a/tests/common.sh b/tests/common.sh index 88deb9c9b..ccb517f7b 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail # Sets the CERB and CERB_INSTALL_PREFIX variables for a given backend # (given in $1). diff --git a/tests/csmith/small_arrays/gen.sh b/tests/csmith/small_arrays/gen.sh index 170c42692..dfeca2c07 100755 --- a/tests/csmith/small_arrays/gen.sh +++ b/tests/csmith/small_arrays/gen.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail GENOPTS="\ --no-pointers \ diff --git a/tests/csmith/small_int_arith/gen.sh b/tests/csmith/small_int_arith/gen.sh index e7ec23955..6c796c883 100755 --- a/tests/csmith/small_int_arith/gen.sh +++ b/tests/csmith/small_int_arith/gen.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail GENOPTS="\ --no-arrays \ diff --git a/tests/csmith/small_mix/gen.sh b/tests/csmith/small_mix/gen.sh index 3b4ab46a9..3d66ecf12 100755 --- a/tests/csmith/small_mix/gen.sh +++ b/tests/csmith/small_mix/gen.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail GENOPTS="\ --argc \ diff --git a/tests/csmith/tools/run_compare.sh b/tests/csmith/tools/run_compare.sh index 0fda34cd6..eb309977e 100755 --- a/tests/csmith/tools/run_compare.sh +++ b/tests/csmith/tools/run_compare.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail gtimeout 10s clang -DCSMITH_MINIMAL -I ../runtime -w -o compare.out $@ && ./compare.out gtimeout 30s cerberus --cpp="cc -E -nostdinc -undef -D__cerb__ -I $CERB_PATH/include/c/libc -I $CERB_PATH/include/c/posix -DCSMITH_MINIMAL -I ../runtime" --exec --batch $@ diff --git a/tests/gcc-torture/breakdown/run.sh b/tests/gcc-torture/breakdown/run.sh index 9e9c6c317..ffa361b21 100755 --- a/tests/gcc-torture/breakdown/run.sh +++ b/tests/gcc-torture/breakdown/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail SUCCESS=$(git ls-files success/*.c | wc -l) LIMBUS=$(git ls-files limbus/*.c | wc -l) diff --git a/tests/gcc-torture/run.sh b/tests/gcc-torture/run.sh index a96fe7d85..a92d93781 100755 --- a/tests/gcc-torture/run.sh +++ b/tests/gcc-torture/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail rm -rf tmp mkdir -p tmp diff --git a/tests/hacl-star/build.sh b/tests/hacl-star/build.sh index 993badde7..1595f0216 100755 --- a/tests/hacl-star/build.sh +++ b/tests/hacl-star/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail #gcc -fPIC -Wall -Wextra -Wno-parentheses -Wno-unused compact/*.c minimal/*.c -I. -Iinclude -Icompact -Iminimal -shared -olibhacl.so -Xlinker -z -Xlinker noexecstack -Xlinker --unresolved-symbols=report-all CERBERUS="../../_build/default/backend/driver/main.exe" diff --git a/tests/popl/cppmem/run.sh b/tests/popl/cppmem/run.sh index a6010760a..173ac3e78 100755 --- a/tests/popl/cppmem/run.sh +++ b/tests/popl/cppmem/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail time ../../../cerbcore --impl gcc_4.9.0_x86_64-apple-darwin10.8.0 $@.core > $@.dot dot -Tpdf $@.dot > $@.pdf diff --git a/tests/popl/section4/run.sh b/tests/popl/section4/run.sh index a6010760a..173ac3e78 100755 --- a/tests/popl/section4/run.sh +++ b/tests/popl/section4/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail time ../../../cerbcore --impl gcc_4.9.0_x86_64-apple-darwin10.8.0 $@.core > $@.dot dot -Tpdf $@.dot > $@.pdf diff --git a/tests/run-cheri.sh b/tests/run-cheri.sh index bec0bd019..092ce8668 100755 --- a/tests/run-cheri.sh +++ b/tests/run-cheri.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail TESTSDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd ${TESTSDIR} diff --git a/tests/run-ci.sh b/tests/run-ci.sh index ce55a02d4..dc1ace499 100755 --- a/tests/run-ci.sh +++ b/tests/run-ci.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail TESTSDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd ${TESTSDIR} diff --git a/tests/run-core.sh b/tests/run-core.sh index 28dfdea43..fe9130f66 100755 --- a/tests/run-core.sh +++ b/tests/run-core.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail # This script tests if Core pretty printer and parse coincide! function report { diff --git a/tests/run-ocaml.sh b/tests/run-ocaml.sh index 973ae921d..6996319a7 100755 --- a/tests/run-ocaml.sh +++ b/tests/run-ocaml.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail source tests.sh diff --git a/tests/run.sh b/tests/run.sh index 05afa3442..a01dbb0a7 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`ocamlfind query z3` export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`ocamlfind query z3` diff --git a/tests/run_tcc.sh b/tests/run_tcc.sh index 59af74442..ebd5ed705 100755 --- a/tests/run_tcc.sh +++ b/tests/run_tcc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail trap ctrl_c INT function ctrl_c() { diff --git a/tests/tests-cheri.sh b/tests/tests-cheri.sh index 4979a146c..33dc3c988 100644 --- a/tests/tests-cheri.sh +++ b/tests/tests-cheri.sh @@ -1,4 +1,4 @@ -#!/usr/bash +#!/usr/bin/env -S bash -euo pipefail citests=( 0001-emptymain.c diff --git a/tests/tests.sh b/tests/tests.sh index bc486c06c..f34b91430 100644 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -1,4 +1,4 @@ -#!/usr/bash +#!/usr/bin/env -S bash -euo pipefail citests=( 0001-emptymain.c diff --git a/tools/colours.sh b/tools/colours.sh index ceb00271c..5e201bc12 100755 --- a/tools/colours.sh +++ b/tools/colours.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail if [[ "$OSTYPE" == "linux-gnu" ]]; then $@ diff --git a/tools/hack.sh b/tools/hack.sh index 7e6f466f8..9e0489d97 100755 --- a/tools/hack.sh +++ b/tools/hack.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env -S bash -euo pipefail for f in _lem/*.lem do diff --git a/tools/jenkins.sh b/tools/jenkins.sh index 4bdf9bc39..7e84457ee 100755 --- a/tools/jenkins.sh +++ b/tools/jenkins.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail export CERB_PATH=/local/jenkins/home/workspace/rems/cerberus export DEPPATH=$CERB_PATH/dependencies diff --git a/tools/load-wg14.sh b/tools/load-wg14.sh index c486769ba..34423a823 100755 --- a/tools/load-wg14.sh +++ b/tools/load-wg14.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail #DIR=/home/jm/work/wg14 DIR=/home/pes20/tmp/wg14 diff --git a/tools/mysloc b/tools/mysloc index b403832a1..5d953e680 100755 --- a/tools/mysloc +++ b/tools/mysloc @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail echo $@ rm -rf tmp-los/* cp $@ tmp-los diff --git a/tools/tex.sh b/tools/tex.sh index 088122ba4..7df2bcc76 100755 --- a/tools/tex.sh +++ b/tools/tex.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S bash -euo pipefail for FILE in "$@" do