Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions contrib/update-lock-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@
set -euo pipefail

for file in Cargo-minimal.lock Cargo-recent.lock; do
cp --force "$file" Cargo.lock
cargo check --all-features
cp "$file" Cargo.lock

# Workspace crates with all features
workspace_crates=("client" "types" "jsonrpc")
for crate in "${workspace_crates[@]}"; do
(cd "$crate" && cargo check --all-features)
done

# Crates with version features (use latest)
version_crates=("node" "integration_test")
for crate in "${version_crates[@]}"; do
(cd "$crate" && cargo check --features=latest)
done

# Other crates
other_crates=("verify")
for crate in "${other_crates[@]}"; do
(cd "$crate" && cargo check)
done

cp --force Cargo.lock "$file"
done
2 changes: 2 additions & 0 deletions integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ edition = "2021"
[features]
download = ["node/download"]

latest = ["29_0"]

# Enable the same feature in `node` and the version feature here.
# All minor releases of the latest three versions.
29_0 = ["v29_and_below", "node/29_0"]
Expand Down
39 changes: 36 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,43 @@ default:
# Cargo build everything.
build:
cargo build --workspace --all-targets --all-features
cargo build -p corepc-client --all-targets --all-features
cargo build -p corepc-types --all-targets --all-features
cargo build -p jsonrpc --all-targets --all-features
cargo build -p corepc-node --all-targets --features=latest
cargo build --manifest-path verify/Cargo.toml --all-targets

# Cargo check everything.
check:
cargo check --workspace --all-targets --all-features
cargo check -p corepc-client --all-targets --all-features
cargo check -p corepc-types --all-targets --all-features
cargo check -p jsonrpc --all-targets --all-features
cargo check -p corepc-node --all-targets --features=latest
cargo check --manifest-path verify/Cargo.toml --all-targets

# Lint everything.
lint: lint-verify lint-integration-tests
cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings
cargo build -p corepc-client --all-targets --all-features
cargo build -p corepc-types --all-targets --all-features
cargo build -p jsonrpc --all-targets --all-features
cargo build -p corepc-node --all-targets --features=latest
cargo build --manifest-path verify/Cargo.toml --all-targets

# Cargo check everything.
check:
cargo check -p corepc-client --all-targets --all-features
cargo check -p corepc-types --all-targets --all-features
cargo check -p jsonrpc --all-targets --all-features
cargo check -p corepc-node --all-targets --features=latest
cargo check --manifest-path verify/Cargo.toml --all-targets

# Lint everything.
lint: lint-verify lint-integration-tests
cargo +$(cat ./nightly-version) clippy -p corepc-client --all-targets --all-features -- --deny warnings
cargo +$(cat ./nightly-version) clippy -p corepc-types --all-targets --all-features -- --deny warnings
cargo +$(cat ./nightly-version) clippy -p jsonrpc --all-targets --all-features -- --deny warnings
cargo +$(cat ./nightly-version) clippy -p corepc-node --all-targets --features=latest -- --deny warnings
cargo +$(cat ./nightly-version) clippy --manifest-path verify/Cargo.toml --all-targets -- --deny warnings

lint-verify:
$REPO_DIR/contrib/lint-verify.sh
Expand All @@ -40,7 +69,11 @@ format:

# Generate documentation.
docsrs *flags:
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --all-features {{flags}}
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc -p corepc-client --all-features {{flags}}
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc -p corepc-types --all-features {{flags}}
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc -p jsonrpc --all-features {{flags}}
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc -p corepc-node --features=29_0 {{flags}}
(cd verify && RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ../nightly-version) doc {{flags}})

# Update the recent and minimal lock files.
update-lock-files:
Expand Down
3 changes: 2 additions & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ zip = { version = "0.6.6", default-features = false, features = ["bzip2", "defla
# - `cargo test --features=27_2,download` to download Bitcoin Core binary `v27.2`.
# - `cargo test --features=28_0` to use `bitcoind` from the host environment.
# - `cargo test` is equivalent to `cargo test --features=0_17_2`.
# - `cargo test --all-features`: Same as using latest version.
# - `cargo test --no-default-features` does not work, you MUST enable a version feature.
[features]
default = ["0_17_2"]

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

latest = ["29_0"]

# We support all minor releases of the latest three versions.
29_0 = ["28_2"]
28_2 = ["28_1"]
Expand Down