Skip to content

Commit ca2a959

Browse files
committed
Add latest feature to avoid hardcoded versions in build scripts
1 parent b779398 commit ca2a959

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

contrib/update-lock-files.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@
55
set -euo pipefail
66

77
for file in Cargo-minimal.lock Cargo-recent.lock; do
8-
cp --force "$file" Cargo.lock
9-
cargo check --all-features
8+
cp "$file" Cargo.lock
9+
10+
# Workspace crates with all features
11+
workspace_crates=("client" "types" "jsonrpc")
12+
for crate in "${workspace_crates[@]}"; do
13+
(cd "$crate" && cargo check --all-features)
14+
done
15+
16+
# Crates with version features (use latest)
17+
version_crates=("node" "integration_test")
18+
for crate in "${version_crates[@]}"; do
19+
(cd "$crate" && cargo check --features=latest)
20+
done
21+
22+
# Other crates
23+
other_crates=("verify")
24+
for crate in "${other_crates[@]}"; do
25+
(cd "$crate" && cargo check)
26+
done
27+
1028
cp --force Cargo.lock "$file"
1129
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 = ["29_0"]
17+
1618
# Enable the same feature in `node` and the version feature here.
1719
# All minor releases of the latest three versions.
1820
29_0 = ["v29_and_below", "node/29_0"]

justfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ default:
1212

1313
# Cargo build everything.
1414
build:
15+
<<<<<<< HEAD
1516
cargo build --workspace --all-targets --all-features
1617

1718
# Cargo check everything.
@@ -21,6 +22,29 @@ check:
2122
# Lint everything.
2223
lint: lint-verify lint-integration-tests
2324
cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings
25+
=======
26+
cargo build -p corepc-client --all-targets --all-features
27+
cargo build -p corepc-types --all-targets --all-features
28+
cargo build -p jsonrpc --all-targets --all-features
29+
cargo build -p corepc-node --all-targets --features=latest
30+
cargo build --manifest-path verify/Cargo.toml --all-targets
31+
32+
# Cargo check everything.
33+
check:
34+
cargo check -p corepc-client --all-targets --all-features
35+
cargo check -p corepc-types --all-targets --all-features
36+
cargo check -p jsonrpc --all-targets --all-features
37+
cargo check -p corepc-node --all-targets --features=latest
38+
cargo check --manifest-path verify/Cargo.toml --all-targets
39+
40+
# Lint everything.
41+
lint: lint-verify lint-integration-tests
42+
cargo +$(cat ./nightly-version) clippy -p corepc-client --all-targets --all-features -- --deny warnings
43+
cargo +$(cat ./nightly-version) clippy -p corepc-types --all-targets --all-features -- --deny warnings
44+
cargo +$(cat ./nightly-version) clippy -p jsonrpc --all-targets --all-features -- --deny warnings
45+
cargo +$(cat ./nightly-version) clippy -p corepc-node --all-targets --features=latest -- --deny warnings
46+
cargo +$(cat ./nightly-version) clippy --manifest-path verify/Cargo.toml --all-targets -- --deny warnings
47+
>>>>>>> 2d0ee43 (Add latest feature to avoid hardcoded versions in build scripts)
2448

2549
lint-verify:
2650
$REPO_DIR/contrib/lint-verify.sh

node/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ zip = { version = "0.6.6", default-features = false, features = ["bzip2", "defla
3737
# - `cargo test --features=27_2,download` to download Bitcoin Core binary `v27.2`.
3838
# - `cargo test --features=28_0` to use `bitcoind` from the host environment.
3939
# - `cargo test` is equivalent to `cargo test --features=0_17_2`.
40-
# - `cargo test --all-features`: Same as using latest version.
4140
# - `cargo test --no-default-features` does not work, you MUST enable a version feature.
4241
[features]
4342
default = ["0_17_2"]
4443

4544
download = ["anyhow", "bitcoin_hashes", "flate2", "tar", "minreq", "zip"]
4645

46+
latest = ["29_0"]
47+
4748
# We support all minor releases of the latest three versions.
4849
29_0 = ["28_2"]
4950
28_2 = ["28_1"]

0 commit comments

Comments
 (0)