Skip to content

Commit 0f235e0

Browse files
committed
Merge #11: Fix the fuzz bug
6646692 Stop treating fuzz as a special case (Tobin C. Harding) 97fba0c Use say_err (Tobin C. Harding) 274bdbb Ignore dynamic paths with shellcheck (Tobin C. Harding) Pull request description: This PR dose a few things: - Clear shellhcheck warnings due to dynamic file paths (not sure why this passed CI before) - Use `say_err` to clear another `shellcheck` warning (that I was unable to repro locally) - Runs `cargo build` and `cargo test` for all crates instead of treating `fuzz` as a special case Resolve: #10 ACKs for top commit: apoelstra: ACK 6646692 Tree-SHA512: 9ad333cc0c30f5d08bd6a04c7e59fce9c4a0781e088dd93f2a2ea5b782a25b48b5529fb0f7d44561df9500590190ec5a5c93c984b337eb4118c97f9760d8cb2a
2 parents 3494cee + 6646692 commit 0f235e0

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

ci/run_task.sh

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22
#
33
# Script used to run CI jobs, can also be used from the command line.
4+
#
5+
# Shellcheck can't search dynamic paths
6+
# shellcheck source=/dev/null
47

58
set -euox pipefail
69

@@ -111,28 +114,25 @@ build_and_test() {
111114
for crate in "${CRATES[@]}"; do
112115
local test_vars_script="$REPO_DIR/$crate/contrib/test_vars.sh"
113116

114-
# Building the fuzz crate is more-or-less just a sanity check.
115-
if [ "$crate" = "fuzz" ]; then
116-
pushd "$REPO_DIR/$crate" > /dev/null
117-
cargo --locked build
118-
popd > /dev/null
119-
break
120-
fi
117+
# Clean variables and also make sure they are defined.
118+
FEATURES_WITH_STD=""
119+
FEATURES_WITH_NO_STD=""
120+
FEATURES_WITHOUT_STD=""
121+
EXAMPLES=""
121122

122123
verbose_say "Sourcing $test_vars_script"
123124
if [ -e "$test_vars_script" ]; then
124125
# Set crate specific variables.
125126
# can't find the file because of the ENV var
126127
# shellcheck source=/dev/null
127128
. "$test_vars_script"
128-
else
129-
err "Missing $test_vars_script"
130-
fi
131-
verbose_say "Got vars"
132-
verbose_say "FEATURES_WITH_STD: ${FEATURES_WITH_STD:-}"
133-
verbose_say "FEATURES_WITHOUT_STD: ${FEATURES_WITHOUT_STD:-}"
134-
verbose_say "EXAMPLES: ${EXAMPLES:-}"
135129

130+
verbose_say "Got test vars:"
131+
verbose_say "FEATURES_WITH_STD: ${FEATURES_WITH_STD}"
132+
verbose_say "FEATURES_WITH_NO_STD: ${FEATURES_WITH_NO_STD}"
133+
verbose_say "FEATURES_WITHOUT_STD: ${FEATURES_WITHOUT_STD}"
134+
verbose_say "EXAMPLES: ${EXAMPLES:-}"
135+
fi
136136
pushd "$REPO_DIR/$crate" > /dev/null
137137

138138
do_test
@@ -147,7 +147,7 @@ do_test() {
147147
$cargo build
148148
$cargo test
149149

150-
if [ -n "${EXAMPLES+x}" ]; then
150+
if [ -n "${EXAMPLES}" ]; then
151151
for example in $EXAMPLES; do # EXAMPLES is set in contrib/test_vars.sh
152152
name="$(echo "$example" | cut -d ':' -f 1)"
153153
features="$(echo "$example" | cut -d ':' -f 2)"
@@ -165,21 +165,21 @@ do_test() {
165165
# can be better controlled.
166166
do_feature_matrix() {
167167
# rust-miniscript only: https://github.com/rust-bitcoin/rust-miniscript/issues/681
168-
if [ -n "${FEATURES_WITH_NO_STD+x}" ]; then
168+
if [ -n "${FEATURES_WITH_NO_STD}" ]; then
169169
$cargo build --no-default-features --features="no-std"
170170
$cargo test --no-default-features --features="no-std"
171171

172-
loop_features "no-std" "${FEATURES_WITH_NO_STD:-}"
172+
loop_features "no-std" "${FEATURES_WITH_NO_STD}"
173173
else
174174
$cargo build --no-default-features
175175
$cargo test --no-default-features
176176
fi
177177

178-
if [ -z "${FEATURES_WITH_STD+x}" ]; then
179-
loop_features "std" "${FEATURES_WITH_STD:-}"
178+
if [ -n "${FEATURES_WITH_STD}" ]; then
179+
loop_features "std" "${FEATURES_WITH_STD}"
180180
fi
181181

182-
if [ -z "${FEATURES_WITHOUT_STD+x}" ]; then
182+
if [ -n "${FEATURES_WITHOUT_STD}" ]; then
183183
loop_features "" "$FEATURES_WITHOUT_STD"
184184
fi
185185
}
@@ -262,9 +262,8 @@ do_dup_deps() {
262262
duplicate_dependencies=$(eval "$tree_cmd")
263263

264264
if [ "$duplicate_dependencies" -ne 0 ]; then
265-
echo "Dependency tree is broken, contains duplicates"
266265
cargo tree --target=all --all-features --duplicates
267-
exit 1
266+
say_err "Dependency tree is broken, contains duplicates"
268267
fi
269268

270269
set -o pipefail

0 commit comments

Comments
 (0)