Skip to content

Commit f133c33

Browse files
committed
Make some parameters generic (branches, parallel jobs)
1 parent 6db8b9c commit f133c33

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

contrib/merge-prs.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@
33
set -eo pipefail
44

55
BASE=merged-master
6+
BITCOIN_UPSTREAM=bitcoin/master
7+
ELEMENTS_UPSTREAM=upstream/master
8+
9+
# BEWARE: On some systems /tmp/ gets periodically cleaned, which may cause
10+
# random files from this directory to disappear based on timestamp, and
11+
# make git very confused
612
WORKTREE="/tmp/elements-merge-worktree"
713

14+
# These should be tuned to your machine; below values are for an 8-core
15+
# 16-thread macbook pro
16+
PARALLEL_BUILD=16 # passed to make -j
17+
PARALLEL_TEST=8 # passed to test_runner.py --jobs
18+
PARALLEL_FUZZ=5 # passed to test_runner.py -j when fuzzing
19+
820
if [[ "$1" == "continue" ]]; then
921
BASE="$BASE^1"
1022
ECHO_CONTINUE=1
@@ -37,8 +49,8 @@ if [[ "$1" != "list-only" ]]; then
3749
fi
3850

3951
## Get full list of merges
40-
ELT_COMMITS=$(git -C "$WORKTREE" log master --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Elements %s')
41-
BTC_COMMITS=$(git -C "$WORKTREE" log bitcoin/master --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Bitcoin %s')
52+
ELT_COMMITS=$(git -C "$WORKTREE" log "$ELEMENTS_UPSTREAM" --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Elements %s')
53+
BTC_COMMITS=$(git -C "$WORKTREE" log "$BITCOIN_UPSTREAM" --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Bitcoin %s')
4254

4355
#ELT_COMMITS=
4456
#BTC_COMMITS=$(git -C "$WORKTREE" log v0.21.0 --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Bitcoin %s')
@@ -89,7 +101,7 @@ do
89101
# The following is an expansion of `make check` that skips the libsecp
90102
# tests and also the benchmarks (though it does build them!)
91103
echo "Building"
92-
chronic make -j80 -k
104+
chronic make -j"$PARALLEL_BUILD" -k
93105
# chronic make -j1 check
94106
echo "Linting"
95107
chronic ./ci/lint/06_script.sh
@@ -101,17 +113,17 @@ do
101113
chronic ./test/util/rpcauth-test.py
102114
chronic make -C src/univalue/ check
103115
echo "Functional testing"
104-
chronic ./test/functional/test_runner.py --jobs=40
116+
chronic ./test/functional/test_runner.py --jobs="$PARALLEL_TEST"
105117
echo "Cleaning for fuzz"
106118
chronic make distclean || true
107119
chronic git -C "$WORKTREE" clean -xf
108120
echo "Building for fuzz"
109121
chronic ./autogen.sh
110122
# TODO turn on `,integer` after this rebase
111123
chronic ./configure --with-incompatible-bdb --enable-fuzz --with-sanitizers=address,fuzzer,undefined CC=clang CXX=clang++
112-
chronic make -j80 -k
124+
chronic make -j"$PARALLEL_BUILD" -k
113125
echo "Fuzzing"
114-
chronic ./test/fuzz/test_runner.py -j24 ~/code/bitcoin/qa-assets/fuzz_seed_corpus/
126+
chronic ./test/fuzz/test_runner.py -j"$PARALLEL_FUZZ" ~/code/bitcoin/qa-assets/fuzz_seed_corpus/
115127
fi
116128

117129
if [[ "$1" == "step" ]]; then

0 commit comments

Comments
 (0)