Skip to content

Commit a9fdfb8

Browse files
committed
Merge #464: Update justfile to only build node and integration_test with the latest feature.
7607b0a update-lock-files with all or specific features (Jamil Lambert, PhD) c2298f1 Add all-features and specific features to justfile (Jamil Lambert, PhD) 14a2a5a Add a latest feature to node integration_test (Jamil Lambert, PhD) Pull request description: `node` and `integration_test` have individual features for each version of `bitcoind`. Enabling all at once makes no sense and caused a hang for a user when updating the lockfiles. - Add a `latest` feature that is set to the latest version of `bitcoind` - Update the justfile to build all crates except `node` and `integration_test` with `--all-features` and `node` and `integration_test` with only `latest`. Left as an array so that other features can be added if needed. - As above for the update lock files script. Closes #361 ACKs for top commit: tcharding: ACK 7607b0a Tree-SHA512: 4a90523c0777aa1861151d1fb4a7b2d4e3dc2e968f05b929d9c66a2689ce2fe775a5a91eb6a88863c1d735a78a3de595276b956a0062cce51849e234d338b826
2 parents 072596c + 7607b0a commit a9fdfb8

4 files changed

Lines changed: 43 additions & 5 deletions

File tree

contrib/update-lock-files.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@
44

55
set -euo pipefail
66

7+
REPO_DIR="$(git rev-parse --show-toplevel)"
8+
9+
# Targets where `--all-features` is used.
10+
ALL_FEATURE_CRATES=(bitreq client fuzz jsonrpc types verify)
11+
12+
# Targets with conflicting features and only speficic features are used.
13+
SPECIFIC_FEATURES_CRATES=(integration_test node)
14+
SPECIFIC_FEATURES=(latest)
15+
16+
update_lock_files() {
17+
for crate in "${ALL_FEATURE_CRATES[@]}"; do
18+
cargo check --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-features
19+
done
20+
21+
for crate in "${SPECIFIC_FEATURES_CRATES[@]}"; do
22+
cargo check --manifest-path "$REPO_DIR/$crate/Cargo.toml" --no-default-features --features="${SPECIFIC_FEATURES[*]}"
23+
done
24+
}
25+
726
for file in Cargo-minimal.lock Cargo-recent.lock; do
827
cp --force "$file" Cargo.lock
9-
cargo check --all-features
28+
update_lock_files
1029
cp --force Cargo.lock "$file"
1130
done

integration_test/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ edition = "2021"
1313
[features]
1414
download = ["node/download"]
1515

16+
latest = ["30_0"]
17+
1618
# Enable the same feature in `node` and the version feature here.
1719
# All minor releases of the latest four versions.
1820
30_0 = ["v30_and_below", "node/30_0"]

justfile

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ set export
22

33
REPO_DIR := `git rev-parse --show-toplevel`
44

5+
# Targets where `--all-features` is used.
6+
ALL_FEATURE_CRATES := "bitreq client fuzz jsonrpc types verify"
7+
8+
# Targets with conflicting features and only `SPECIFIC_FEATURES` are used.
9+
SPECIFIC_FEATURES_CRATES := "integration_test node"
10+
SPECIFIC_FEATURES := "latest"
11+
512
alias ulf := update-lock-files
613
alias l := lint
714
alias li := lint-integration-tests
@@ -12,15 +19,21 @@ default:
1219

1320
# Cargo build everything.
1421
build:
15-
cargo build --workspace --all-targets --all-features
22+
for crate in {{ALL_FEATURE_CRATES}}; do cargo build --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --all-features; done
23+
24+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do cargo build --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --no-default-features --features={{SPECIFIC_FEATURES}}; done
1625

1726
# Cargo check everything.
1827
check:
19-
cargo check --workspace --all-targets --all-features
28+
for crate in {{ALL_FEATURE_CRATES}}; do cargo check --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --all-features; done
29+
30+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do cargo check --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --no-default-features --features={{SPECIFIC_FEATURES}}; done
2031

2132
# Lint everything.
2233
lint: lint-verify lint-integration-tests
23-
cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings
34+
for crate in {{ALL_FEATURE_CRATES}}; do cargo +$(cat ./nightly-version) clippy --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --all-features -- --deny warnings; done
35+
36+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do cargo +$(cat ./nightly-version) clippy --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --no-default-features --features={{SPECIFIC_FEATURES}} -- --deny warnings; done
2437

2538
lint-verify:
2639
$REPO_DIR/contrib/lint-verify.sh
@@ -40,7 +53,9 @@ format:
4053

4154
# Generate documentation.
4255
docsrs *flags:
43-
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --all-features {{flags}}
56+
for crate in {{ALL_FEATURE_CRATES}}; do RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-features {{flags}}; done
57+
58+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --manifest-path "$REPO_DIR/$crate/Cargo.toml" --no-default-features --features={{SPECIFIC_FEATURES}} {{flags}}; done
4459

4560
# Update the recent and minimal lock files.
4661
update-lock-files:

node/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ default = ["0_17_2"]
4444

4545
download = ["anyhow", "bitcoin_hashes", "flate2", "tar", "bitreq", "zip"]
4646

47+
latest = ["30_0"]
48+
4749
# We support all minor releases of the latest four versions.
4850
30_0 = ["29_0"]
4951
29_0 = ["28_2"]

0 commit comments

Comments
 (0)