Skip to content

Commit 443a8c8

Browse files
committed
More improvements to merge-prs script
1 parent 3cc3cac commit 443a8c8

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

contrib/merge-prs.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ BITCOIN_UPSTREAM="${BITCOIN_UPSTREAM_REMOTE}/master"
99
ELEMENTS_UPSTREAM_REMOTE=upstream
1010
ELEMENTS_UPSTREAM="${ELEMENTS_UPSTREAM_REMOTE}/master"
1111

12+
# Replace this with the location where we should put the fuzz test corpus
13+
BITCOIN_QA_ASSETS="${HOME}/.tmp/bitcoin/qa-assets"
14+
FUZZ_CORPUS="${BITCOIN_QA_ASSETS}/fuzz_seed_corpus/"
15+
mkdir -p "$(dirname ${BITCOIN_QA_ASSETS})"
16+
1217
# BEWARE: On some systems /tmp/ gets periodically cleaned, which may cause
1318
# random files from this directory to disappear based on timestamp, and
1419
# make git very confused
15-
WORKTREE="/tmp/elements-merge-worktree"
20+
WORKTREE="${HOME}/.tmp/elements-merge-worktree"
21+
mkdir -p "${HOME}/.tmp"
1622

1723
# These should be tuned to your machine; below values are for an 8-core
1824
# 16-thread macbook pro
@@ -29,13 +35,23 @@ if [[ "$1" == "setup" ]]; then
2935
echo
3036
git config remote.upstream.url >/dev/null || remote add upstream "https://github.com/ElementsProject/elements.git"
3137
git config remote.bitcoin.url >/dev/null || git remote add bitcoin "https://github.com/bitcoin/bitcoin.git"
38+
if git worktree list --porcelain | grep --silent prunable; then
39+
echo "You have stale git worktrees, please either fix them or run 'git worktree prune'."
40+
exit 1
41+
fi
3242
git worktree list --porcelain | grep --silent "${WORKTREE}" || git worktree add "${WORKTREE}" --force --no-checkout --detach
3343
echo
3444
echo "Fetching all remotes..."
3545
echo
3646
git fetch --all
3747
echo
38-
echo "Done!"
48+
#echo "Cloning fuzz test corpus..."
49+
#echo
50+
#if [[ ! -d "${BITCOIN_QA_ASSETS}" ]]; then
51+
# cd "$(dirname ${BITCOIN_QA_ASSETS})" && git clone https://github.com/bitcoin-core/qa-assets.git
52+
#fi
53+
#echo
54+
echo "Done! Remember to also check out merged-master, and push it back up when finished."
3955
exit 0
4056
elif [[ "$1" == "continue" ]]; then
4157
SKIP_MERGE=1
@@ -171,7 +187,7 @@ do
171187
quietly ./configure --with-incompatible-bdb --enable-fuzz --with-sanitizers=address,fuzzer,undefined CC=clang CXX=clang++
172188
quietly make -j"$PARALLEL_BUILD" -k
173189
echo "Fuzzing"
174-
quietly ./test/fuzz/test_runner.py -j"$PARALLEL_FUZZ" ~/code/bitcoin/qa-assets/fuzz_seed_corpus/
190+
quietly ./test/fuzz/test_runner.py -j"$PARALLEL_FUZZ" "${FUZZ_CORPUS}"
175191
fi
176192

177193
if [[ "$KEEP_GOING" == "0" ]]; then

0 commit comments

Comments
 (0)