From 58e924872488847bd033a9a39411cd85a3c7f0ca Mon Sep 17 00:00:00 2001 From: Renato Britto Date: Mon, 6 Apr 2026 20:10:27 -0300 Subject: [PATCH 1/4] ci: add rbmt metadata and lint configuration Add workspace and per-crate rbmt configuration needed to drive the new CI tasks. Record the rbmt toolchain and integration metadata, teach lint about expected duplicate dependencies in selected crates, and remove the old clippy msrv setting now that toolchain metadata lives in rbmt configuration. --- Cargo.toml | 29 +++++++++++++++++++++++++++++ bitreq/Cargo.toml | 4 ++++ client/Cargo.toml | 4 ++++ clippy.toml | 1 - node/Cargo.toml | 14 ++++++++++++++ rbmt-version | 1 + 6 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 rbmt-version diff --git a/Cargo.toml b/Cargo.toml index d3231233c..7400e46a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "bitreq", "client", "fuzz", "jsonrpc", "node", "types"] exclude = ["integration_test", "verify"] resolver = "2" +rust-version = "1.75.0" [patch.crates-io.corepc-client] path = "client" @@ -14,3 +15,31 @@ path = "node" [patch.crates-io.corepc-types] path = "types" + +[workspace.metadata.rbmt.toolchains] +nightly = "nightly-2025-09-12" +stable = "1.94.1" + +[workspace.metadata.rbmt.integration] +package = "integration-test" +versions = [ + "30_2", + "30_0", + "29_0", + "28_2", + "28_1", + "28_0", + "27_2", + "27_1", + "27_0", + "26_2", + "25_2", + "24_2", + "23_2", + "22_1", + "0_21_2", + "0_20_2", + "0_19_1", + "0_18_1", + "0_17_2", +] diff --git a/bitreq/Cargo.toml b/bitreq/Cargo.toml index 5f7dc5555..c6dbe1c30 100644 --- a/bitreq/Cargo.toml +++ b/bitreq/Cargo.toml @@ -45,6 +45,10 @@ url = { version = "2.4" } [package.metadata.docs.rs] all-features = true +[package.metadata.rbmt.lint] +# Unavoidable TLS/crypto dep-graph version conflicts. +allowed_duplicates = ["base64", "windows-sys"] + [features] default = ["std"] std = [] diff --git a/client/Cargo.toml b/client/Cargo.toml index b7c13e367..b1d9adecb 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -16,6 +16,10 @@ exclude = ["tests", "contrib"] all-features = true rustdoc-args = ["--cfg", "docsrs"] +[package.metadata.rbmt.lint] +# `base64`: bitcoin (via corepc-types) uses v0.21 while jsonrpc uses v0.22. +allowed_duplicates = ["base64"] + [features] # Enable this feature to get a blocking JSON-RPC client. client-sync = ["jsonrpc"] diff --git a/clippy.toml b/clippy.toml index 4dc6505ee..85355417c 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,2 +1 @@ -msrv = "1.75.0" too-many-arguments-threshold = 13 diff --git a/node/Cargo.toml b/node/Cargo.toml index 7671ed326..7a89b7e46 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -73,3 +73,17 @@ latest = ["30_2"] [package.metadata.docs.rs] features = ["28_2"] rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.rbmt.lint] +# The node crate requires a version feature to compile; use `latest` for per-package lint. +features = ["latest"] +# Duplicates from build-dep/dep splits, --target=all, or upstream version conflicts. +allowed_duplicates = [ + "anyhow", # build-dep and regular dep, same version + "base64", # bitcoin uses v0.21, jsonrpc uses v0.22 + "bitcoin_hashes", # build-dep (download) and transitive dep via bitcoin, same version + "bitreq", # build-dep (download) and regular dep via jsonrpc, same version + "linux-raw-sys", # same version, appears twice under --target=all + "rustix", # same version, appears twice under --target=all + "windows-sys", # ring/rustls pin v0.52, tar/tempfile/rustix pin v0.59 +] diff --git a/rbmt-version b/rbmt-version new file mode 100644 index 000000000..de57ca2d2 --- /dev/null +++ b/rbmt-version @@ -0,0 +1 @@ +6560b728ae6a81af9d92713b630ba26772fbd970 From f3606c2505eb2fbb5d3cb89c5e717d4d03d46b9b Mon Sep 17 00:00:00 2001 From: Renato Britto Date: Mon, 6 Apr 2026 20:10:34 -0300 Subject: [PATCH 2/4] ci: switch GitHub Actions to cargo rbmt Migrate the GitHub Actions workflow from the maintainer-tools shell entrypoints to cargo rbmt. Read the pinned rbmt version from the repository, consolidate the Stable/Nightly/MSRV test jobs into a single toolchain/lockfile matrix, and scope test and lint runs to the packages that build without a bitcoind version feature. Fix the misspelled lint-integtation-tests.sh script name in the workflow and justfile. --- .github/workflows/rust.yaml | 166 ++++++++---------------------------- 1 file changed, 35 insertions(+), 131 deletions(-) diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 51da4c594..b26ef5451 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -9,93 +9,30 @@ on: # yamllint disable-line rule:truthy name: Continuous integration jobs: - Prepare: - runs-on: ubuntu-slim - outputs: - nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }} - steps: - - name: "Checkout repo" - uses: actions/checkout@v4 - - name: "Read nightly version" - id: read_toolchain - run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT - - Stable: # 2 jobs, one per lock file. - name: Test - stable toolchain + Test: # 6 jobs: 3 toolchains × 2 lock files. + name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: dep: [minimal, recent] + toolchain: [stable, nightly, msrv] steps: - name: "Checkout repo" uses: actions/checkout@v4 - - name: "Checkout maintainer tools" - uses: actions/checkout@v4 - with: - repository: rust-bitcoin/rust-bitcoin-maintainer-tools - ref: c3324024ced9bb1eb854397686919c3ff7d97e1e - path: maintainer-tools - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@stable - - name: "Set dependencies" - run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - - name: "Run test script" - run: ./maintainer-tools/ci/run_task.sh stable - - Nightly: # 2 jobs, one per lock file. - name: Test - nightly toolchain - needs: Prepare - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - dep: [minimal, recent] - steps: - - name: "Checkout repo" - uses: actions/checkout@v4 - - name: "Checkout maintainer tools" - uses: actions/checkout@v4 - with: - repository: rust-bitcoin/rust-bitcoin-maintainer-tools - ref: c3324024ced9bb1eb854397686919c3ff7d97e1e - path: maintainer-tools - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: ${{ needs.Prepare.outputs.nightly_version }} - - name: "Set dependencies" - run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - - name: "Run test script" - run: ./maintainer-tools/ci/run_task.sh nightly - - MSRV: # 2 jobs, one per lock file. - name: Test - 1.75.0 toolchain - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - dep: [minimal, recent] - steps: - - name: "Checkout repo" - uses: actions/checkout@v4 - - name: "Checkout maintainer tools" - uses: actions/checkout@v4 - with: - repository: rust-bitcoin/rust-bitcoin-maintainer-tools - path: maintainer-tools - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@stable - with: - toolchain: "1.75.0" - - name: "Set dependencies" - run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - - name: "Run test script" - run: ./maintainer-tools/ci/run_task.sh msrv + - uses: Swatinem/rust-cache@v2 + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 + - name: "Run ${{ matrix.toolchain }} tests" + run: | + cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }} \ + -p bitreq \ + -p corepc-client \ + -p jsonrpc-fuzz \ + -p jsonrpc \ + -p corepc-types Lint: name: Lint - nightly toolchain - needs: Prepare runs-on: ubuntu-latest env: BITCOIND_SKIP_DOWNLOAD: "1" @@ -106,24 +43,17 @@ jobs: steps: - name: "Checkout repo" uses: actions/checkout@v4 - - name: "Checkout maintainer tools" - uses: actions/checkout@v4 - with: - repository: rust-bitcoin/rust-bitcoin-maintainer-tools - ref: c3324024ced9bb1eb854397686919c3ff7d97e1e - path: maintainer-tools - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: ${{ needs.Prepare.outputs.nightly_version }} - - name: "Install clippy" - run: rustup component add clippy - - name: "Set dependencies" - run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - - name: "Run test script" + - uses: Swatinem/rust-cache@v2 + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 + - name: "Run lints" run: | - ./maintainer-tools/ci/run_task.sh lint - ./contrib/lint-integtation-tests.sh + cargo rbmt --lock-file ${{ matrix.dep }} lint \ + -p bitreq \ + -p corepc-client \ + -p jsonrpc-fuzz \ + -p jsonrpc \ + -p corepc-types + ./contrib/lint-integration-tests.sh ./contrib/lint-verify.sh Docs: @@ -138,22 +68,13 @@ jobs: steps: - name: "Checkout repo" uses: actions/checkout@v4 - - name: "Checkout maintainer tools" - uses: actions/checkout@v4 - with: - repository: rust-bitcoin/rust-bitcoin-maintainer-tools - ref: c3324024ced9bb1eb854397686919c3ff7d97e1e - path: maintainer-tools - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@stable - - name: "Set dependencies" - run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - - name: "Run test script" - run: ./maintainer-tools/ci/run_task.sh docs + - uses: Swatinem/rust-cache@v2 + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 + - name: "Run doc tests" + run: cargo rbmt --lock-file ${{ matrix.dep }} docs Docsrs: name: Docs - nightly toolchain - needs: Prepare runs-on: ubuntu-latest env: BITCOIND_SKIP_DOWNLOAD: "1" @@ -164,43 +85,26 @@ jobs: steps: - name: "Checkout repo" uses: actions/checkout@v4 - - name: "Checkout maintainer tools" - uses: actions/checkout@v4 - with: - repository: rust-bitcoin/rust-bitcoin-maintainer-tools - ref: c3324024ced9bb1eb854397686919c3ff7d97e1e - path: maintainer-tools - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: ${{ needs.Prepare.outputs.nightly_version }} - - name: "Set dependencies" - run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock - - name: "Run test script" - run: ./maintainer-tools/ci/run_task.sh docsrs + - uses: Swatinem/rust-cache@v2 + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 + - name: "Run docsrs tests" + run: cargo rbmt --lock-file ${{ matrix.dep }} docsrs Format: # 1 job, run cargo fmt directly. name: Format - nightly toolchain - needs: Prepare runs-on: ubuntu-latest strategy: fail-fast: false steps: - name: "Checkout repo" uses: actions/checkout@v4 - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: ${{ needs.Prepare.outputs.nightly_version }} - - name: "Install rustfmt" - run: rustup component add rustfmt + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 - name: "Check formatting" run: | - cargo fmt --all -- --check + cargo rbmt fmt --check ./contrib/fmt-integration-tests.sh ./contrib/fmt-verify.sh - Verify: # 1 job, run `verify` directly. name: Verify - stable toolchain runs-on: ubuntu-latest @@ -247,8 +151,8 @@ jobs: steps: - name: "Checkout repo" uses: actions/checkout@v4 - - name: "Select toolchain" - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@6560b728ae6a81af9d92713b630ba26772fbd970 # v0.1.0 - name: "Cache downloaded bitcoind" uses: actions/cache@v4 with: From 569b87e438df3c5ebc159a4397121fa95db296fd Mon Sep 17 00:00:00 2001 From: Renato Britto Date: Mon, 6 Apr 2026 20:07:44 -0300 Subject: [PATCH 3/4] bitreq: cfg-gate std-only URL helpers Add `#[cfg(feature = "std")]` to URL helper methods used only in std builds. --- bitreq/src/url.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitreq/src/url.rs b/bitreq/src/url.rs index 6ba589b57..9d9603136 100644 --- a/bitreq/src/url.rs +++ b/bitreq/src/url.rs @@ -383,6 +383,7 @@ impl Url { pub fn as_str(&self) -> &str { &self.serialization } /// Returns `true` if the URL scheme is "https" or "wss". + #[cfg(feature = "std")] pub(crate) fn is_https(&self) -> bool { matches!(self.scheme(), "https" | "wss") } /// Returns `true` if a non-default port was explicitly specified in the URL. @@ -401,6 +402,7 @@ impl Url { /// /// The returned string includes the leading `/` (if present) and the `?` /// separator (if there's a query string). Returns "/" if the path is empty. + #[cfg(feature = "std")] pub(crate) fn path_and_query(&self) -> String { let path = self.path(); let path = if path.is_empty() { "/" } else { path }; From 0e2d33611c6fc223f617751e4a77423451e55850 Mon Sep 17 00:00:00 2001 From: Renato Britto Date: Mon, 6 Apr 2026 22:06:16 -0300 Subject: [PATCH 4/4] ci: rename misspelled lint script Rename contrib/lint-integtation-tests.sh to lint-integration-tests.sh and update the justfile reference to match. --- .../{lint-integtation-tests.sh => lint-integration-tests.sh} | 0 justfile | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename contrib/{lint-integtation-tests.sh => lint-integration-tests.sh} (100%) diff --git a/contrib/lint-integtation-tests.sh b/contrib/lint-integration-tests.sh similarity index 100% rename from contrib/lint-integtation-tests.sh rename to contrib/lint-integration-tests.sh diff --git a/justfile b/justfile index 30db50f8b..72c048680 100644 --- a/justfile +++ b/justfile @@ -39,7 +39,7 @@ lint-verify: $REPO_DIR/contrib/lint-verify.sh lint-integration-tests: - $REPO_DIR/contrib/lint-integtation-tests.sh + $REPO_DIR/contrib/lint-integration-tests.sh # Run cargo fmt fmt: