Skip to content

Commit 7fca458

Browse files
committed
Add latest feature to avoid hardcoded versions in build scripts
1 parent 471e0e1 commit 7fca458

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

contrib/update-lock-files.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ for file in Cargo-minimal.lock Cargo-recent.lock; do
1616
# Crates with version features (use latest)
1717
version_crates=("node" "integration_test")
1818
for crate in "${version_crates[@]}"; do
19-
(cd "$crate" && cargo check --features=29_0)
19+
(cd "$crate" && cargo check --features=latest)
2020
done
2121

2222
# Other crates

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ build:
1515
cargo build -p corepc-client --all-targets --all-features
1616
cargo build -p corepc-types --all-targets --all-features
1717
cargo build -p jsonrpc --all-targets --all-features
18-
cargo build -p corepc-node --all-targets --features=29_0
18+
cargo build -p corepc-node --all-targets --features=latest
1919
cargo build --manifest-path verify/Cargo.toml --all-targets
2020

2121
# Cargo check everything.
2222
check:
2323
cargo check -p corepc-client --all-targets --all-features
2424
cargo check -p corepc-types --all-targets --all-features
2525
cargo check -p jsonrpc --all-targets --all-features
26-
cargo check -p corepc-node --all-targets --features=29_0
26+
cargo check -p corepc-node --all-targets --features=latest
2727
cargo check --manifest-path verify/Cargo.toml --all-targets
2828

2929
# Lint everything.
3030
lint: lint-verify lint-integration-tests
3131
cargo +$(cat ./nightly-version) clippy -p corepc-client --all-targets --all-features -- --deny warnings
3232
cargo +$(cat ./nightly-version) clippy -p corepc-types --all-targets --all-features -- --deny warnings
3333
cargo +$(cat ./nightly-version) clippy -p jsonrpc --all-targets --all-features -- --deny warnings
34-
cargo +$(cat ./nightly-version) clippy -p corepc-node --all-targets --features=29_0 -- --deny warnings
34+
cargo +$(cat ./nightly-version) clippy -p corepc-node --all-targets --features=latest -- --deny warnings
3535
cargo +$(cat ./nightly-version) clippy --manifest-path verify/Cargo.toml --all-targets -- --deny warnings
3636

3737
lint-verify:

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)