Skip to content
Merged
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
166 changes: 35 additions & 131 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the msrv toolchain defined? While a global MSRV might work out right now, I'm not sure this will always be the case as bitreq's TLS dependencies might for example bump MSRV at some point. Would the entire ecosystem / all crates then fine with bumping MSRV, even if they don't share the same dependencies?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nyonson, do you remember if [workspace.metadata.rbmt.toolchains] can be overridden with crate-specific config?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The msrv is implicitly picked up from the rust-version keys in the package manifests. As of today, cargo-rbmt has a limitation where it only works in workspaces with 1 msrv. This can be fixed if needed, just a bit of complexity which hasn't been necessary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nyonson, do you remember if [workspace.metadata.rbmt.toolchains] can be overridden with crate-specific config?

I was planning to migrate Floresta to cargo-rbmt soon. This would be handy, since the lib crates probably have lower MSRV than the binary itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the discussion. For this PR, this is effectively a no-op. I’m happy to follow up with per-crate msrv support once we need it, or once cargo-rbmt supports it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I am not sure how valuable testing on the nighlty toolchain is, but doesn't hurt either. Some recent discussion over here: rust-bitcoin/rust-psbt#87 (comment)

Copy link
Copy Markdown
Contributor Author

@satsfy satsfy Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR aims to not modify the previous CI job list, which included nightly. I suppose nightly is here as early warning for upcoming compiler or toolchain changes.

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"
Expand All @@ -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 \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious for feedback on rbmt, does the fuzz package not play nice here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package jsonrpc-fuzz is included and works with rbmt ok from what I've seen.

-p bitreq \
-p corepc-client \
-p jsonrpc-fuzz \
-p jsonrpc \
-p corepc-types
./contrib/lint-integration-tests.sh
./contrib/lint-verify.sh

Docs:
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
29 changes: 29 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
]
4 changes: 4 additions & 0 deletions bitreq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 2 additions & 0 deletions bitreq/src/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 };
Expand Down
4 changes: 4 additions & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
msrv = "1.75.0"
too-many-arguments-threshold = 13
File renamed without changes.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
1 change: 1 addition & 0 deletions rbmt-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6560b728ae6a81af9d92713b630ba26772fbd970
Loading