aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/wire-check
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/wire-check')
-rwxr-xr-xscripts/wire-check26
1 files changed, 19 insertions, 7 deletions
diff --git a/scripts/wire-check b/scripts/wire-check
index f53dafb..c634d17 100755
--- a/scripts/wire-check
+++ b/scripts/wire-check
@@ -9,10 +9,12 @@
#
# TAG is the latest v* tag unless given. The nodes: a of the tag (the swarm's first), b
# of this tree, c of the tag, d of this tree, each seeded with the one before it.
-# CONTINUUM_WIRE_CHECK_FEATURES are the features both are built with, libp2p among them
-# (federation,libp2p unless given); the tag's build is kept in CONTINUUM_RELEASE_TARGET
-# (~/.cache/continuum/release unless given), as scripts/release keeps it. The nodes
-# listen from CONTINUUM_WIRE_CHECK_PORT on (47600 unless given), eight ports.
+# Both are built with CONTINUUM_WIRE_CHECK_FEATURES (libp2p among them), unless given:
+# this tree with `most`, the tag with it too where it has it, else with the features it
+# stands for, as scripts/release builds them; the tag's build is kept in
+# CONTINUUM_RELEASE_TARGET (~/.cache/continuum/release unless given), as scripts/release
+# keeps it. The nodes listen from CONTINUUM_WIRE_CHECK_PORT on (47600 unless given),
+# eight ports.
set -eu
@@ -23,7 +25,17 @@ if [ -z "$tag" ]; then
echo "wire-check: no v* tag to check against" >&2
exit 2
fi
-features=${CONTINUUM_WIRE_CHECK_FEATURES:-federation,libp2p}
+# The features tag $1 builds with: `most` where it has that feature, else the ones `most`
+# stands for, which a tag before it has.
+features_of() {
+ if git show "$1:Cargo.toml" 2>/dev/null | grep -q "^most = "; then
+ echo most
+ else
+ echo dashboard,federation,libp2p,mycelium,tor
+ fi
+}
+features=${CONTINUUM_WIRE_CHECK_FEATURES:-most}
+tag_features=${CONTINUUM_WIRE_CHECK_FEATURES:-$(features_of "$tag")}
cache=${XDG_CACHE_HOME:-$HOME/.cache}
target=${CONTINUUM_RELEASE_TARGET:-$cache/continuum/release}
port=${CONTINUUM_WIRE_CHECK_PORT:-47600}
@@ -55,12 +67,12 @@ fail() {
exit 1
}
-say "building this tree and $tag (features $features)"
+say "building this tree (features $features) and $tag (features $tag_features)"
cargo build -q --features "$features" --bin continuum
here_dir=${CARGO_TARGET_DIR:-$(pwd)/target}
cp "$here_dir/debug/continuum" "$work/here"
git worktree add -q --detach "$work/tagged" "$tag"
-(cd "$work/tagged" && CARGO_TARGET_DIR=$target cargo build -q --features "$features" --bin continuum)
+(cd "$work/tagged" && CARGO_TARGET_DIR=$target cargo build -q --features "$tag_features" --bin continuum)
cp "$target/debug/continuum" "$work/there"
wire() { "$1" --version | sed -n 's/^wire versions \([0-9]*\) to \([0-9]*\)$/\1 \2/p'; }