diff --git a/bootstrap.sh b/bootstrap.sh index 62b93deb023..72729dd117f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu export CLEAN=${1:-} diff --git a/bootstrap_docker.sh b/bootstrap_docker.sh index a8025f08aa1..b51bdf9a16e 100755 --- a/bootstrap_docker.sh +++ b/bootstrap_docker.sh @@ -16,7 +16,7 @@ # cd yarn-project/end-to-end # ONLY_TARGET=false ../../bootstrap_docker.sh -set -e +set -xe TARGET_PROJECT=$1 COMMIT_HASH=$(git rev-parse HEAD) diff --git a/build-system/remote_build/remote_build b/build-system/remote_build/remote_build index 8eab556ee57..83e33bf356c 100755 --- a/build-system/remote_build/remote_build +++ b/build-system/remote_build/remote_build @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts diff --git a/build-system/scripts/build b/build-system/scripts/build index 4add19d1f1a..24fd93587b2 100755 --- a/build-system/scripts/build +++ b/build-system/scripts/build @@ -22,7 +22,7 @@ # - Perform the build of the image itself. With the cache primed we should only have to rebuild the necessary layers. # - Push the image tagged with the commit hash to the cache. -set -euo pipefail +set -xeuo pipefail REPOSITORY=$1 FORCE_BUILD=${2:-"false"} diff --git a/build-system/scripts/build_local b/build-system/scripts/build_local index bb1d6340844..2215c8c45a9 100755 --- a/build-system/scripts/build_local +++ b/build-system/scripts/build_local @@ -6,7 +6,7 @@ # If DOCKERFILE is excluded it tries to default to ./Dockerfile then .//Dockerfile # If REPO is excluded it defaults to PROJECT_DIR_NAME. -set -eu +set -xeu TARGET_PROJECT=$1 ONLY_TARGET=$2 diff --git a/build-system/scripts/check_npm_version b/build-system/scripts/check_npm_version index 0d7de47828e..91bd924b9e5 100755 --- a/build-system/scripts/check_npm_version +++ b/build-system/scripts/check_npm_version @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu readonly LOCAL_VERSION=$(node -pe "require('./package.json').version") readonly PACKAGE_NAME=${1:-./} diff --git a/build-system/scripts/check_rebuild b/build-system/scripts/check_rebuild index d80e9493684..e58eabd6ff2 100755 --- a/build-system/scripts/check_rebuild +++ b/build-system/scripts/check_rebuild @@ -2,7 +2,7 @@ # Fails if any files matching the rebuild patterns, have changed since the base commit. # If this script fails (nonzero exit), then the caller should rebuild. # The rebuild patterns are taken from the build manifest (computed from set of dependencies). -set -euo pipefail +set -xeuo pipefail TAG=$1 REPOSITORY=$2 diff --git a/build-system/scripts/cond_spot_run_build b/build-system/scripts/cond_spot_run_build index 61f262307e5..7b4dc1552aa 100755 --- a/build-system/scripts/cond_spot_run_build +++ b/build-system/scripts/cond_spot_run_build @@ -1,6 +1,6 @@ #!/bin/bash -set -eu -set -o pipefail +set -xeu +set -xo pipefail REPOSITORY=$1 shift diff --git a/build-system/scripts/cond_spot_run_script b/build-system/scripts/cond_spot_run_script index 154b70c8b68..8b17520078a 100755 --- a/build-system/scripts/cond_spot_run_script +++ b/build-system/scripts/cond_spot_run_script @@ -14,7 +14,7 @@ # 2. SUCCESS_TAG: To track if this job needs to be run, the repository image is tagged with a prefix after a # successful run. The script will only run if there were relevant code changes since the last successful commit. # 3... ARGS: Arguments to pass to spot_run_script. -set -eu +set -xeu REPOSITORY=$1 shift diff --git a/build-system/scripts/cond_spot_run_test_script b/build-system/scripts/cond_spot_run_test_script index c760e69d00f..575f839465a 100755 --- a/build-system/scripts/cond_spot_run_test_script +++ b/build-system/scripts/cond_spot_run_test_script @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu SCRIPT_PATH=$1 REPOSITORY=$2 shift @@ -9,5 +9,5 @@ cd $(query_manifest projectDir $REPOSITORY) mkdir -p /tmp/test-logs -set -o pipefail +set -xo pipefail cond_spot_run_script $REPOSITORY $JOB_NAME 32 $SCRIPT_PATH $@ | tee "/tmp/test-logs/$JOB_NAME.log" diff --git a/build-system/scripts/cond_spot_run_tests b/build-system/scripts/cond_spot_run_tests index 78097379f1f..c898c0700d2 100755 --- a/build-system/scripts/cond_spot_run_tests +++ b/build-system/scripts/cond_spot_run_tests @@ -1,4 +1,4 @@ #!/bin/bash -set -eu +set -xeu cond_spot_run_test_script ./scripts/run_tests $@ diff --git a/build-system/scripts/deploy b/build-system/scripts/deploy index ae6d92a69ba..0eacf7847da 100755 --- a/build-system/scripts/deploy +++ b/build-system/scripts/deploy @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu REPOSITORY=$1 SERVICES=${2:-$REPOSITORY} diff --git a/build-system/scripts/deploy_dockerhub b/build-system/scripts/deploy_dockerhub index d7e0442d30b..09783f59ee1 100755 --- a/build-system/scripts/deploy_dockerhub +++ b/build-system/scripts/deploy_dockerhub @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu if [ -z "$COMMIT_TAG" ]; then echo "Will only push tagged builds to dockerhub. Skipping." diff --git a/build-system/scripts/deploy_ecr b/build-system/scripts/deploy_ecr index aa512cc1b4b..7c8f8dbe96b 100755 --- a/build-system/scripts/deploy_ecr +++ b/build-system/scripts/deploy_ecr @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu REPOSITORY=$1 IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH diff --git a/build-system/scripts/deploy_global b/build-system/scripts/deploy_global index 5114a067a74..e54afb05133 100755 --- a/build-system/scripts/deploy_global +++ b/build-system/scripts/deploy_global @@ -1,6 +1,6 @@ #!/bin/bash # Deployment script for global service (e.g. company website and metrics). -set -eu +set -xeu REPOSITORY=$1 diff --git a/build-system/scripts/deploy_npm b/build-system/scripts/deploy_npm index 1847e2463d1..9df0e10d1a5 100755 --- a/build-system/scripts/deploy_npm +++ b/build-system/scripts/deploy_npm @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu readonly REPOSITORY=$1 readonly STANDALONE=$2 diff --git a/build-system/scripts/deploy_s3 b/build-system/scripts/deploy_s3 index 947062da206..cd076e59077 100755 --- a/build-system/scripts/deploy_s3 +++ b/build-system/scripts/deploy_s3 @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu REPOSITORY=$1 # A global deploy, doesn't namespace under a deploy tag (e.g. company website, metrics) diff --git a/build-system/scripts/deploy_service b/build-system/scripts/deploy_service index c126becdf56..34b5df87f1e 100755 --- a/build-system/scripts/deploy_service +++ b/build-system/scripts/deploy_service @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Redeploy service with latest image. SERVICE_NAME=$1 diff --git a/build-system/scripts/deploy_terraform b/build-system/scripts/deploy_terraform index 637ef5c8be1..1a813cc4591 100755 --- a/build-system/scripts/deploy_terraform +++ b/build-system/scripts/deploy_terraform @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu REPOSITORY=$1 TF_DIR=$2 diff --git a/build-system/scripts/ensure_apt_package b/build-system/scripts/ensure_apt_package index 33326c7f1fd..fe5d3d39f9f 100755 --- a/build-system/scripts/ensure_apt_package +++ b/build-system/scripts/ensure_apt_package @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu if dpkg -s $1 &> /dev/null; then exit 0 diff --git a/build-system/scripts/ensure_repo b/build-system/scripts/ensure_repo index 186b204cd4e..d0f62dc3700 100755 --- a/build-system/scripts/ensure_repo +++ b/build-system/scripts/ensure_repo @@ -1,7 +1,7 @@ #!/bin/bash # Logs the shell into the ECR instance at the given region, establishes if the given repository exists, creates it if it # doesn't, and re-applies thie lifecycle policy (determines when images should be automatically deleted) if it does. -set -eu +set -xeu LIFECYCLE_POLICY='{ "rules": [ diff --git a/build-system/scripts/ensure_terraform b/build-system/scripts/ensure_terraform index e04231e79f1..d70f1d9cf84 100755 --- a/build-system/scripts/ensure_terraform +++ b/build-system/scripts/ensure_terraform @@ -1,6 +1,6 @@ #!/bin/bash # Downloads and installs `terraform` if it's not installed. -set -eu +set -xeu [ ! -f /usr/local/bin/terraform ] || exit 0 diff --git a/build-system/scripts/erase_image_tags b/build-system/scripts/erase_image_tags index 8f99c3f1569..a2bd8acb257 100755 --- a/build-system/scripts/erase_image_tags +++ b/build-system/scripts/erase_image_tags @@ -1,7 +1,7 @@ #!/bin/bash # Erase the image tag associated with the last commit for the given repository. # If TILL_COMMIT_HASH is given, erase tags going back in time until we reach TILL_COMMIT_HASH. -set -eu +set -xeu REPOSITORY=$1 TILL_COMMIT_HASH=$2 diff --git a/build-system/scripts/extract_repo b/build-system/scripts/extract_repo index 8bd7ef2c606..1756b361811 100755 --- a/build-system/scripts/extract_repo +++ b/build-system/scripts/extract_repo @@ -1,6 +1,6 @@ #!/bin/bash # Given a repository, extracts the builds entire /usr/src dir to the given path. -set -eu +set -xeu REPOSITORY=$1 EXTRACT_FROM=${2:-/usr/src} diff --git a/build-system/scripts/init_submodules b/build-system/scripts/init_submodules index c456aa1a995..1efa2db83f3 100755 --- a/build-system/scripts/init_submodules +++ b/build-system/scripts/init_submodules @@ -1,6 +1,6 @@ #!/bin/bash # For a given repository, init any required submodules. -set -euo pipefail +set -xeuo pipefail REPOSITORY=$1 diff --git a/build-system/scripts/query_manifest b/build-system/scripts/query_manifest index ba7b8c1fe33..ad2b23b5668 100755 --- a/build-system/scripts/query_manifest +++ b/build-system/scripts/query_manifest @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu CMD=$1 REPO=$2 diff --git a/build-system/scripts/remote_run_script b/build-system/scripts/remote_run_script index c33d386f1f9..a4efda7cf6a 100755 --- a/build-system/scripts/remote_run_script +++ b/build-system/scripts/remote_run_script @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu IP=$1 CONTENT_HASH=$2 diff --git a/build-system/scripts/request_spot b/build-system/scripts/request_spot index d87fd829eee..d756ad64898 100755 --- a/build-system/scripts/request_spot +++ b/build-system/scripts/request_spot @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu NAME=$1 CPUS=${2:-32} diff --git a/build-system/scripts/retry_10 b/build-system/scripts/retry_10 index 2d111c6e3dc..e0e499ba624 100755 --- a/build-system/scripts/retry_10 +++ b/build-system/scripts/retry_10 @@ -1,4 +1,4 @@ -set -eu +set -xeu # Retries up to 10 times with 10 second intervals for i in $(seq 1 10); do "$@" && exit || sleep 10 diff --git a/build-system/scripts/setup_env b/build-system/scripts/setup_env index 2df97fbfd5a..3284b4778fc 100755 --- a/build-system/scripts/setup_env +++ b/build-system/scripts/setup_env @@ -6,7 +6,7 @@ # The script should be sourced from the root of the repository, e.g: # source ./build-system/scripts/setup_env # This ensures the resultant variables are set in the calling shell. -set -eu +set -xeu COMMIT_HASH=$1 COMMIT_TAG=$2 diff --git a/build-system/scripts/spot_run_script b/build-system/scripts/spot_run_script index 63f16928c85..094d03cedb7 100755 --- a/build-system/scripts/spot_run_script +++ b/build-system/scripts/spot_run_script @@ -3,7 +3,7 @@ # 1. Content hash for our repository contents. Used for identify spot jobs and image tags. # 2. SPEC: Instance specification filename. # 3... ARGS: Arguments to pass to remote_run_script. -set -eu +set -xeu CONTENT_HASH=$1 SPEC=$2 shift 2 diff --git a/build-system/scripts/spot_run_test_script b/build-system/scripts/spot_run_test_script index 06d4d455380..b121bd65cbc 100755 --- a/build-system/scripts/spot_run_test_script +++ b/build-system/scripts/spot_run_test_script @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu SCRIPT_PATH=$1 REPOSITORY=$2 shift @@ -9,7 +9,7 @@ cd $(query_manifest projectDir $REPOSITORY) mkdir -p /tmp/test-logs -set -o pipefail +set -xo pipefail CONTENT_HASH=$(calculate_content_hash $REPOSITORY) echo "Content hash: $CONTENT_HASH" diff --git a/build-system/scripts/spot_run_tests b/build-system/scripts/spot_run_tests index e7d8183c048..e9b14c1fd88 100755 --- a/build-system/scripts/spot_run_tests +++ b/build-system/scripts/spot_run_tests @@ -1,4 +1,4 @@ #!/bin/bash -set -eu +set -xeu spot_run_test_script ./scripts/run_tests $@ diff --git a/build-system/scripts/store_test_benchmark_logs b/build-system/scripts/store_test_benchmark_logs index d44f3c2cd9f..9ac9ff71c04 100755 --- a/build-system/scripts/store_test_benchmark_logs +++ b/build-system/scripts/store_test_benchmark_logs @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu REPOSITORY=$1 shift diff --git a/build-system/scripts/tag_remote_image b/build-system/scripts/tag_remote_image index 741009ff125..0bf67437019 100755 --- a/build-system/scripts/tag_remote_image +++ b/build-system/scripts/tag_remote_image @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu REPOSITORY=$1 EXISTING_TAG=$2 diff --git a/circuits/cpp/barretenberg/acir_tests/run_acir_tests.sh b/circuits/cpp/barretenberg/acir_tests/run_acir_tests.sh index b04b43fcd9b..92b68e6580c 100755 --- a/circuits/cpp/barretenberg/acir_tests/run_acir_tests.sh +++ b/circuits/cpp/barretenberg/acir_tests/run_acir_tests.sh @@ -3,7 +3,7 @@ # BB: to specify a different binary to test with (e.g. bb.js or bb.js-dev). # VERBOSE: to enable logging for each test. -set -eu +set -xeu BB=$PWD/${BB:-../cpp/build/bin/bb} CRS_PATH=~/.bb-crs diff --git a/circuits/cpp/barretenberg/bootstrap_docker.sh b/circuits/cpp/barretenberg/bootstrap_docker.sh index e2f88e22525..3db07de7bc7 100755 --- a/circuits/cpp/barretenberg/bootstrap_docker.sh +++ b/circuits/cpp/barretenberg/bootstrap_docker.sh @@ -1,7 +1,7 @@ #!/bin/bash # This script builds the projects listed in build_mainifest.sh. -set -eu +set -xeu COMMIT_HASH=$(git rev-parse HEAD) source ./build-system/scripts/setup_env $COMMIT_HASH '' mainframe_$USER $(git rev-parse --show-toplevel) diff --git a/circuits/cpp/barretenberg/cpp/bin-test/bin-test.sh b/circuits/cpp/barretenberg/cpp/bin-test/bin-test.sh index eb634c96065..ff4692b4758 100755 --- a/circuits/cpp/barretenberg/cpp/bin-test/bin-test.sh +++ b/circuits/cpp/barretenberg/cpp/bin-test/bin-test.sh @@ -1,6 +1,6 @@ #!/bin/sh # Script is assumed to be run from -set -eu +set -xeu bb() { ../build/bin/bb "$@" -v diff --git a/circuits/cpp/barretenberg/cpp/bootstrap.sh b/circuits/cpp/barretenberg/cpp/bootstrap.sh index 869bbc9c885..ef389491f40 100755 --- a/circuits/cpp/barretenberg/cpp/bootstrap.sh +++ b/circuits/cpp/barretenberg/cpp/bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Clean. rm -rf ./build diff --git a/circuits/cpp/barretenberg/cpp/format.sh b/circuits/cpp/barretenberg/cpp/format.sh index 48315e39621..f866bea9c15 100755 --- a/circuits/cpp/barretenberg/cpp/format.sh +++ b/circuits/cpp/barretenberg/cpp/format.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu if [ "$1" == "staged" ]; then echo Formatting staged files... diff --git a/circuits/cpp/barretenberg/cpp/scripts/bb-tests.sh b/circuits/cpp/barretenberg/cpp/scripts/bb-tests.sh index 235aa111ff4..66117d7dbf7 100755 --- a/circuits/cpp/barretenberg/cpp/scripts/bb-tests.sh +++ b/circuits/cpp/barretenberg/cpp/scripts/bb-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash # This script runs all test suites that have not been broken out into their own jobs for parallelisation. # Might be better to list exclusions here rather than inclusions as risky to maintain. -set -eu +set -xeu $(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null REPOSITORY=barretenberg-x86_64-linux-clang-assert diff --git a/circuits/cpp/barretenberg/cpp/scripts/bin-test.sh b/circuits/cpp/barretenberg/cpp/scripts/bin-test.sh index b06c26036ba..c25434289ee 100755 --- a/circuits/cpp/barretenberg/cpp/scripts/bin-test.sh +++ b/circuits/cpp/barretenberg/cpp/scripts/bin-test.sh @@ -1,6 +1,6 @@ #!/bin/bash # Executes the bb binary test script. -set -eu +set -xeu $(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null REPOSITORY=barretenberg-x86_64-linux-clang-assert diff --git a/circuits/cpp/barretenberg/cpp/scripts/install-wasi-sdk.sh b/circuits/cpp/barretenberg/cpp/scripts/install-wasi-sdk.sh index 3a8eecf2438..3dd76aa9c46 100755 --- a/circuits/cpp/barretenberg/cpp/scripts/install-wasi-sdk.sh +++ b/circuits/cpp/barretenberg/cpp/scripts/install-wasi-sdk.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Clean. rm -rf ./src/wasi-sdk-* diff --git a/circuits/cpp/barretenberg/cpp/scripts/run_aztec_circuits_tests b/circuits/cpp/barretenberg/cpp/scripts/run_aztec_circuits_tests index d67176f098f..a40e8b3c97e 100755 --- a/circuits/cpp/barretenberg/cpp/scripts/run_aztec_circuits_tests +++ b/circuits/cpp/barretenberg/cpp/scripts/run_aztec_circuits_tests @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # To be called from CI for testing with docker and AWS. # Can't be called locally unless AWS credentials are set up. diff --git a/circuits/cpp/barretenberg/cpp/scripts/run_tests b/circuits/cpp/barretenberg/cpp/scripts/run_tests index 965307ff5a5..24c68e7467b 100755 --- a/circuits/cpp/barretenberg/cpp/scripts/run_tests +++ b/circuits/cpp/barretenberg/cpp/scripts/run_tests @@ -3,7 +3,7 @@ # 1. The number of ignition transcripts to download. # 2. The set of gtest binary names to run. # 3-n. The arguments to pass to the gtest binaries. -set -eu +set -xeu NUM_TRANSCRIPTS=$1 TESTS=$2 diff --git a/circuits/cpp/barretenberg/cpp/srs_db/download_ignition.sh b/circuits/cpp/barretenberg/cpp/srs_db/download_ignition.sh index 478f442f9af..d9e1bcd7fe5 100755 --- a/circuits/cpp/barretenberg/cpp/srs_db/download_ignition.sh +++ b/circuits/cpp/barretenberg/cpp/srs_db/download_ignition.sh @@ -13,7 +13,7 @@ # If a checksums file is available, it will be used to validate if a download is required # and also check the validity of the downloaded transcripts. If not the script downloads # whatever is requested but does not check the validity of the downloads. -set -eu +set -xeu mkdir -p ignition cd ignition diff --git a/circuits/cpp/barretenberg/scripts/bindgen.sh b/circuits/cpp/barretenberg/scripts/bindgen.sh index 1a2034a213a..43740d746e1 100755 --- a/circuits/cpp/barretenberg/scripts/bindgen.sh +++ b/circuits/cpp/barretenberg/scripts/bindgen.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu #find ./cpp/src -type f -name "c_bind*.hpp" | ./scripts/decls_json.py > exports.json cat ./scripts/c_bind_files.txt | ./scripts/decls_json.py > exports.json diff --git a/circuits/cpp/barretenberg/sol/scripts/install_foundry.sh b/circuits/cpp/barretenberg/sol/scripts/install_foundry.sh index e085beb76d5..02bcbf8db3b 100755 --- a/circuits/cpp/barretenberg/sol/scripts/install_foundry.sh +++ b/circuits/cpp/barretenberg/sol/scripts/install_foundry.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -eu +set -xeu export FOUNDRY_DIR="$PWD/.foundry" FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin" diff --git a/circuits/cpp/bootstrap.sh b/circuits/cpp/bootstrap.sh index 0462e0085f6..b9f487e5678 100755 --- a/circuits/cpp/bootstrap.sh +++ b/circuits/cpp/bootstrap.sh @@ -1,7 +1,7 @@ #!/bin/bash # Takes a list of targets from commandline # Takes CLEAN as an environment variable. If passed, cleans build artifacts -set -eu +set -xeu export WASI_VERSION=20 diff --git a/circuits/cpp/format.sh b/circuits/cpp/format.sh index 48315e39621..f866bea9c15 100755 --- a/circuits/cpp/format.sh +++ b/circuits/cpp/format.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu if [ "$1" == "staged" ]; then echo Formatting staged files... diff --git a/circuits/cpp/scripts/build_run_tests_docker_local b/circuits/cpp/scripts/build_run_tests_docker_local index a075cbba172..fa64b29e330 100755 --- a/circuits/cpp/scripts/build_run_tests_docker_local +++ b/circuits/cpp/scripts/build_run_tests_docker_local @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # To be called only LOCALLY for testing WITH docker. # Builds a docker image and runs tests in it. diff --git a/circuits/cpp/scripts/run_coverage b/circuits/cpp/scripts/run_coverage index d0e4bb097f4..7979f7d1c6c 100755 --- a/circuits/cpp/scripts/run_coverage +++ b/circuits/cpp/scripts/run_coverage @@ -1,5 +1,5 @@ #!bin/bash -set -eu +set -xeu # To be called LOCALLY for testing WITHOUT docker. # diff --git a/circuits/cpp/scripts/run_tests b/circuits/cpp/scripts/run_tests index b3fbc43f459..eb8a2a28a6c 100755 --- a/circuits/cpp/scripts/run_tests +++ b/circuits/cpp/scripts/run_tests @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # To be called from CI for testing with docker and AWS. # Can't be called locally unless AWS credentials are set up. diff --git a/circuits/cpp/scripts/run_tests_local b/circuits/cpp/scripts/run_tests_local index 4c942a0f13a..a67649e471d 100755 --- a/circuits/cpp/scripts/run_tests_local +++ b/circuits/cpp/scripts/run_tests_local @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu DIR="$(dirname "$0")" diff --git a/circuits/cpp/scripts/tidy.sh b/circuits/cpp/scripts/tidy.sh index e239fc3b1a6..13e46f5469c 100755 --- a/circuits/cpp/scripts/tidy.sh +++ b/circuits/cpp/scripts/tidy.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Run clang-tidy on all C++ source files # diff --git a/l1-contracts/bootstrap.sh b/l1-contracts/bootstrap.sh index 58aba5449eb..cfe00c96988 100755 --- a/l1-contracts/bootstrap.sh +++ b/l1-contracts/bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu cd "$(dirname "$0")" diff --git a/l1-contracts/scripts/install_foundry.sh b/l1-contracts/scripts/install_foundry.sh index e085beb76d5..02bcbf8db3b 100755 --- a/l1-contracts/scripts/install_foundry.sh +++ b/l1-contracts/scripts/install_foundry.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -eu +set -xeu export FOUNDRY_DIR="$PWD/.foundry" FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin" diff --git a/scripts/ci/store_test_benchmark_logs b/scripts/ci/store_test_benchmark_logs index 8f87ba04462..2b36f14a4ea 100755 --- a/scripts/ci/store_test_benchmark_logs +++ b/scripts/ci/store_test_benchmark_logs @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu AZTEC_GITHUB_TOKEN=$1 diff --git a/scripts/fix_subrepo_edge_case.sh b/scripts/fix_subrepo_edge_case.sh index 6888875eaff..7a236435868 100755 --- a/scripts/fix_subrepo_edge_case.sh +++ b/scripts/fix_subrepo_edge_case.sh @@ -6,7 +6,7 @@ # in the face of e.g. a .gitrepo whitespace change, but it's a fallback, # we only have this issue in master, and the file should only be edited # generally by subrepo commands. -set -eu +set -xeu SUBREPO_PATH="${1:-}" echo "Auto-fixing squashed parent in $SUBREPO_PATH/.gitrepo." diff --git a/scripts/git-subrepo/ext/bashplus/bin/bash+ b/scripts/git-subrepo/ext/bashplus/bin/bash+ index e0bc1f73913..57d3e19655c 100755 --- a/scripts/git-subrepo/ext/bashplus/bin/bash+ +++ b/scripts/git-subrepo/ext/bashplus/bin/bash+ @@ -5,7 +5,7 @@ # Copyright (c) 2013-2020 Ingy döt Net #------------------------------------------------------------------------------ -set -eu +set -xeu shopt -s compat31 &>/dev/null || true #------------------------------------------------------------------------------ diff --git a/scripts/git-subrepo/ext/bashplus/lib/bash+.bash b/scripts/git-subrepo/ext/bashplus/lib/bash+.bash index b52e17b55a6..16ea238245f 100644 --- a/scripts/git-subrepo/ext/bashplus/lib/bash+.bash +++ b/scripts/git-subrepo/ext/bashplus/lib/bash+.bash @@ -2,7 +2,7 @@ # # Copyright (c) 2013-2020 Ingy döt Net -set -eu +set -xeu [[ ${BASHPLUS_VERSION-} ]] && return 0 diff --git a/scripts/git-subrepo/ext/bashplus/test/setup b/scripts/git-subrepo/ext/bashplus/test/setup index c8b138d7e32..a3535659a5a 100644 --- a/scripts/git-subrepo/ext/bashplus/test/setup +++ b/scripts/git-subrepo/ext/bashplus/test/setup @@ -7,7 +7,7 @@ # how nice Bash can be. #------------------------------------------------------------------------------ -set -e -o pipefail +set -xe -o pipefail PATH=$PWD/bin:$PATH diff --git a/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ b/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ index e0bc1f73913..57d3e19655c 100755 --- a/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +++ b/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ @@ -5,7 +5,7 @@ # Copyright (c) 2013-2020 Ingy döt Net #------------------------------------------------------------------------------ -set -eu +set -xeu shopt -s compat31 &>/dev/null || true #------------------------------------------------------------------------------ diff --git a/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash b/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash index e0e15cfc49d..28d8df1c78f 100644 --- a/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +++ b/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash @@ -2,7 +2,7 @@ # # Copyright (c) 2013-2020 Ingy döt Net -set -eu +set -xeu [[ ${BASHPLUS_VERSION-} ]] && return 0 diff --git a/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/test/setup b/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/test/setup index 35124d0f69d..176f989ef32 100644 --- a/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/test/setup +++ b/scripts/git-subrepo/ext/test-more-bash/ext/bashplus/test/setup @@ -7,7 +7,7 @@ # how nice Bash can be. #------------------------------------------------------------------------------ -set -e -u -o pipefail +set -xe -u -o pipefail [[ $BASH_VERSION == 4.0* ]] && set +u run=0 diff --git a/scripts/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash b/scripts/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash index cc34dcb9a2a..a4f0d192449 100644 --- a/scripts/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +++ b/scripts/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash @@ -6,7 +6,7 @@ Test::Tap:die() { echo "$@" >&2; trap EXIT; exit 1; } #------------------------------------------------------------------------------ -set -e -u -o pipefail +set -xe -u -o pipefail [[ ${BASH_VERSION-} == 4.0* ]] && set +u # shellcheck disable=2034 diff --git a/scripts/git-subrepo/ext/test-more-bash/lib/test/more.bash b/scripts/git-subrepo/ext/test-more-bash/lib/test/more.bash index 6fa9f56d93f..815dd498f95 100644 --- a/scripts/git-subrepo/ext/test-more-bash/lib/test/more.bash +++ b/scripts/git-subrepo/ext/test-more-bash/lib/test/more.bash @@ -2,7 +2,7 @@ # # Copyright (c) 2013-2020. Ingy döt Net. -set -e -u -o pipefail +set -xe -u -o pipefail # shellcheck disable=2034 Test__More_VERSION=0.0.5 diff --git a/scripts/git-subrepo/ext/test-more-bash/test/setup b/scripts/git-subrepo/ext/test-more-bash/test/setup index 99df35d614f..1d910f3ceb1 100644 --- a/scripts/git-subrepo/ext/test-more-bash/test/setup +++ b/scripts/git-subrepo/ext/test-more-bash/test/setup @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e -u -o pipefail +set -xe -u -o pipefail BASHLIB=$(find "$PWD" -type d | grep -E '/(bin|lib)$' | xargs -n1 printf "%s:") PATH=$BASHLIB:$PATH diff --git a/scripts/git-subrepo/lib/git-subrepo b/scripts/git-subrepo/lib/git-subrepo index 9f4a3384cd1..78ed42e0bc3 100755 --- a/scripts/git-subrepo/lib/git-subrepo +++ b/scripts/git-subrepo/lib/git-subrepo @@ -7,7 +7,7 @@ # shellcheck disable=1090,1091,2034 # Exit on any errors: -set -eu +set -xeu export FILTER_BRANCH_SQUELCH_WARNING=1 diff --git a/scripts/git-subrepo/lib/git-subrepo.d/help-functions.bash b/scripts/git-subrepo/lib/git-subrepo.d/help-functions.bash index 98e34dd272b..1933b6eb280 100644 --- a/scripts/git-subrepo/lib/git-subrepo.d/help-functions.bash +++ b/scripts/git-subrepo/lib/git-subrepo.d/help-functions.bash @@ -2,7 +2,7 @@ # DO NOT EDIT. This file generated by pkg/bin/generate-help-functions.pl. -set -eu +set -xeu help:all() { cat <<'...' diff --git a/scripts/git-subrepo/note/init-test b/scripts/git-subrepo/note/init-test index a20854de88a..4d4ef58690b 100755 --- a/scripts/git-subrepo/note/init-test +++ b/scripts/git-subrepo/note/init-test @@ -1,6 +1,6 @@ #!/bin/bash -set -ex +set -xex cat $0 # Show this script in the output REPO=${1:-ingydotnet/djson-pm} diff --git a/scripts/git-subrepo/note/recreate-rebase-conflict.sh b/scripts/git-subrepo/note/recreate-rebase-conflict.sh index 62bbd9617c1..5e9694a0999 100644 --- a/scripts/git-subrepo/note/recreate-rebase-conflict.sh +++ b/scripts/git-subrepo/note/recreate-rebase-conflict.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -eu +set -xeu set -x # Make a directory to work in: diff --git a/scripts/git-subrepo/note/subtree-rebase-fail-example/test.bash b/scripts/git-subrepo/note/subtree-rebase-fail-example/test.bash index df8b818cee6..ac77fe7361a 100755 --- a/scripts/git-subrepo/note/subtree-rebase-fail-example/test.bash +++ b/scripts/git-subrepo/note/subtree-rebase-fail-example/test.bash @@ -1,6 +1,6 @@ #!/bin/bash -set -ex +set -xex rm -fr repo{1,2,3} mkdir repo{1,2} diff --git a/scripts/git-subrepo/note/test-subrepo-push.sh b/scripts/git-subrepo/note/test-subrepo-push.sh index afceb5efa92..40160368c9e 100644 --- a/scripts/git-subrepo/note/test-subrepo-push.sh +++ b/scripts/git-subrepo/note/test-subrepo-push.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -ex +set -xex # Make a directory to work in: { diff --git a/scripts/git-subrepo/pkg/bin/generate-help-functions.pl b/scripts/git-subrepo/pkg/bin/generate-help-functions.pl index 5dd949e6ed9..b23a011ef5f 100644 --- a/scripts/git-subrepo/pkg/bin/generate-help-functions.pl +++ b/scripts/git-subrepo/pkg/bin/generate-help-functions.pl @@ -33,7 +33,7 @@ sub write_start { # DO NOT EDIT. This file generated by pkg/bin/generate-help-functions.pl. -set -eu +set -xeu ... } diff --git a/scripts/git_subrepo.sh b/scripts/git_subrepo.sh index df9743a2bd5..0651c7c7da5 100755 --- a/scripts/git_subrepo.sh +++ b/scripts/git_subrepo.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu SCRIPT_DIR=$(dirname "$(realpath "$0")") diff --git a/scripts/migrate_barretenberg_branch.sh b/scripts/migrate_barretenberg_branch.sh index 9f3001c7421..d78935bf4fb 100755 --- a/scripts/migrate_barretenberg_branch.sh +++ b/scripts/migrate_barretenberg_branch.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Usage: ./this.sh # Script for migrating PRs from barretenberg repo to aztec-packages. diff --git a/scripts/update.sh b/scripts/update.sh index ab78b6827dc..b374d765a14 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Script for running after updating the working copy with remote changes. # Similar to bootstrap, but more lightweight and oriented towards working on end-to-end. diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 39036119ed7..a2879ddef87 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -eu +set -xeu # Navigate to script folder cd "$(dirname "$0")" diff --git a/yarn-project/canary/scripts/run_tests b/yarn-project/canary/scripts/run_tests index dac0f0bd921..fc39a781c95 100755 --- a/yarn-project/canary/scripts/run_tests +++ b/yarn-project/canary/scripts/run_tests @@ -1,7 +1,7 @@ #!/bin/bash # This script is used to run an e2e test in CI (see config.yml and cond_spot_run_tests). # It sets a few environment variables used inside the docker-compose.yml, pulls images, and runs docker-compose. -set -eu +set -xeu export TEST=$1 export IMAGE=${2:-canary} diff --git a/yarn-project/canary/scripts/update_packages.sh b/yarn-project/canary/scripts/update_packages.sh index 0b5a3c59b43..608bcdb3035 100755 --- a/yarn-project/canary/scripts/update_packages.sh +++ b/yarn-project/canary/scripts/update_packages.sh @@ -1,4 +1,4 @@ -set -eu +set -xeu COMMIT_TAG=$1 diff --git a/yarn-project/end-to-end/scripts/cond_run_script b/yarn-project/end-to-end/scripts/cond_run_script index e8159655bf2..96f9463f8cb 100755 --- a/yarn-project/end-to-end/scripts/cond_run_script +++ b/yarn-project/end-to-end/scripts/cond_run_script @@ -14,7 +14,7 @@ # 2. SUCCESS_TAG: To track if this job needs to be run, the repository image is tagged with a success tag after a # successful run. The script will only run if there were relevant code changes since the last successful commit. # 3... ARGS: Script to run and args. -set -eu +set -xeu set -x REPOSITORY=$1 diff --git a/yarn-project/end-to-end/scripts/run_tests b/yarn-project/end-to-end/scripts/run_tests index fad024b1eb2..ba874d060cc 100755 --- a/yarn-project/end-to-end/scripts/run_tests +++ b/yarn-project/end-to-end/scripts/run_tests @@ -1,7 +1,7 @@ #!/bin/bash # This script is used to run an e2e test in CI (see config.yml and cond_spot_run_tests). # It sets a few environment variables used inside the docker-compose.yml, pulls images, and runs docker-compose. -set -eu +set -xeu export TEST=$1 export COMPOSE_FILE=${2:-docker-compose.yml} diff --git a/yarn-project/end-to-end/scripts/run_tests_local b/yarn-project/end-to-end/scripts/run_tests_local index 846d54173c4..01b9ac4c10b 100755 --- a/yarn-project/end-to-end/scripts/run_tests_local +++ b/yarn-project/end-to-end/scripts/run_tests_local @@ -1,7 +1,7 @@ #!/bin/bash # This script is used to run an e2e test in CI (see config.yml and cond_run_script). # It sets a few environment variables used inside the docker-compose.yml, pulls images, and runs docker-compose. -set -eu +set -xeu export TEST=$1 export COMPOSE_FILE=${2:-./scripts/docker-compose.yml} diff --git a/yarn-project/end-to-end/scripts/start_e2e.sh b/yarn-project/end-to-end/scripts/start_e2e.sh index 018c3d79603..45f6d13800a 100755 --- a/yarn-project/end-to-end/scripts/start_e2e.sh +++ b/yarn-project/end-to-end/scripts/start_e2e.sh @@ -1,5 +1,5 @@ #! /bin/bash -set -eu +set -xeu export NODE_NO_WARNINGS=1 node ${NODE_ARGS-} --openssl-legacy-provider --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --passWithNoTests $@ diff --git a/yarn-project/end-to-end/scripts/start_p2p_e2e.sh b/yarn-project/end-to-end/scripts/start_p2p_e2e.sh index 9b1b661a7fe..ed24c853826 100755 --- a/yarn-project/end-to-end/scripts/start_p2p_e2e.sh +++ b/yarn-project/end-to-end/scripts/start_p2p_e2e.sh @@ -1,5 +1,5 @@ #! /bin/bash -set -eu +set -xeu export DEBUG='aztec:*' export ARCHIVER_POLLING_INTERVAL=500 export P2P_CHECK_INTERVAL=50 diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.sh b/yarn-project/end-to-end/src/guides/up_quick_start.sh index c27ff3454f3..85012b10027 100755 --- a/yarn-project/end-to-end/src/guides/up_quick_start.sh +++ b/yarn-project/end-to-end/src/guides/up_quick_start.sh @@ -1,7 +1,7 @@ # Run locally from end-to-end folder while running anvil and sandbox with: # PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh -set -eux +set -xeux # docs:start:declare-accounts ALICE="0x2e13f0201905944184fc2c09d29fcf0cac07647be171656a275f63d99b819360" diff --git a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh index 1c4bd5e2ba9..86b8bb95708 100755 --- a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh +++ b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -euo pipefail; +set -xeuo pipefail; target_dir=./generated diff --git a/yarn-project/noir-contracts/scripts/install_noir.sh b/yarn-project/noir-contracts/scripts/install_noir.sh index c0c9d70d729..8021c0685ca 100755 --- a/yarn-project/noir-contracts/scripts/install_noir.sh +++ b/yarn-project/noir-contracts/scripts/install_noir.sh @@ -1,6 +1,6 @@ #!/bin/bash # Script to install noirup and the latest aztec nargo -set -eu +set -xeu VERSION="aztec" diff --git a/yarn-project/noir-contracts/scripts/install_noirup.sh b/yarn-project/noir-contracts/scripts/install_noirup.sh index 11ba9b15d31..efa83d5b668 100755 --- a/yarn-project/noir-contracts/scripts/install_noirup.sh +++ b/yarn-project/noir-contracts/scripts/install_noirup.sh @@ -1,6 +1,6 @@ #!/bin/bash # Script to install noirup and the latest nargo -set -eu +set -xeu SPECIFIED_HOME=${1:-$HOME} diff --git a/yarn-project/noir-contracts/scripts/types.sh b/yarn-project/noir-contracts/scripts/types.sh index a9d249c437f..9f499a4e0d7 100755 --- a/yarn-project/noir-contracts/scripts/types.sh +++ b/yarn-project/noir-contracts/scripts/types.sh @@ -8,7 +8,7 @@ # Enable strict mode: # Exit on error (set -xe), treat unset variables as an error (set -u), -set -eu; +set -xeu; artifacts_dir="src/artifacts" types_dir="src/types" diff --git a/yarn-project/noir-contracts/src/scripts/compile.sh b/yarn-project/noir-contracts/src/scripts/compile.sh index 74719291c65..384c1d0d537 100755 --- a/yarn-project/noir-contracts/src/scripts/compile.sh +++ b/yarn-project/noir-contracts/src/scripts/compile.sh @@ -9,7 +9,7 @@ # Enable strict mode: # Exit on error (set -xe), treat unset variables as an error (set -u), # and propagate the exit status of the first failing command in a pipeline (set -o pipefail). -set -euo pipefail; +set -xeuo pipefail; # Run build scripts ./scripts/compile.sh "$@" diff --git a/yarn-project/p2p-bootstrap/scripts/start_bootnode.sh b/yarn-project/p2p-bootstrap/scripts/start_bootnode.sh index 2abace6942d..7621979ab44 100755 --- a/yarn-project/p2p-bootstrap/scripts/start_bootnode.sh +++ b/yarn-project/p2p-bootstrap/scripts/start_bootnode.sh @@ -1,5 +1,5 @@ #! /bin/bash -set -eu +set -xeu cd .. export P2P_TCP_LISTEN_PORT=40400