diff --git a/contrib/gen_label_config.sh b/contrib/gen_label_config.sh index 066113e3..9ad7e626 100755 --- a/contrib/gen_label_config.sh +++ b/contrib/gen_label_config.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -euo pipefail # Generates the label configuration using crates in the repository. # The label configuration is appended to the labeler config file. diff --git a/contrib/release.sh b/contrib/release.sh index 0de3a5ee..558ba0fb 100755 --- a/contrib/release.sh +++ b/contrib/release.sh @@ -3,7 +3,7 @@ # Check that we can publish crates in their current form if there are changes on top of the tip of # master that imply that we are about to do a release. -set -ex +set -euox pipefail main () { for crate in "internals" "hashes" "bitcoin"; do diff --git a/contrib/run_task.sh b/contrib/run_task.sh index d99042f4..b3a80cc3 100755 --- a/contrib/run_task.sh +++ b/contrib/run_task.sh @@ -1,6 +1,6 @@ #!/bin/env bash -set -ex +set -euox pipefail # Make all cargo invocations verbose. export CARGO_TERM_VERBOSE=true @@ -165,6 +165,10 @@ do_lint() { # We should not have any duplicate dependencies. This catches mistakes made upgrading dependencies # in one crate and not in another (e.g. upgrade bitcoin_hashes in bitcoin but not in secp). do_dup_deps() { + # We can't use pipefail because these grep statements fail by design when there is no duplicate, + # the shell therefore won't pick up mistakes in your pipe - you are on your own. + set +o pipefail + duplicate_dependencies=$( # Only show the actual duplicated deps, not their reverse tree, then # whitelist the 'syn' crate which is duplicated but it's not our fault. @@ -182,6 +186,8 @@ do_dup_deps() { cargo tree --target=all --all-features --duplicates exit 1 fi + + set -o pipefail } # Build the docs with a nightly toolchain, in unison with the function diff --git a/fuzz/cycle.sh b/fuzz/cycle.sh index 7de15c82..b72c44da 100755 --- a/fuzz/cycle.sh +++ b/fuzz/cycle.sh @@ -5,7 +5,8 @@ # # For hfuzz options see https://github.com/google/honggfuzz/blob/master/docs/USAGE.md -set -e +set -euo pipefail + REPO_DIR=$(git rev-parse --show-toplevel) # shellcheck source=./fuzz-util.sh source "$REPO_DIR/fuzz/fuzz-util.sh" diff --git a/fuzz/fuzz.sh b/fuzz/fuzz.sh index a22e01cc..c85b8e4e 100755 --- a/fuzz/fuzz.sh +++ b/fuzz/fuzz.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -ex +set -euox pipefail REPO_DIR=$(git rev-parse --show-toplevel) diff --git a/fuzz/generate-files.sh b/fuzz/generate-files.sh index 18cba6a8..bbb36ea4 100755 --- a/fuzz/generate-files.sh +++ b/fuzz/generate-files.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -euo pipefail REPO_DIR=$(git rev-parse --show-toplevel)