From e3faeb63a07e4b8174de7cb521b54fae6f52779f Mon Sep 17 00:00:00 2001 From: Leonardo Lima Date: Thu, 16 Jan 2025 20:08:04 -0300 Subject: [PATCH 1/5] ci: add secondary MSRV job of 1.75.0 --- .github/workflows/cont_integration.yml | 50 ++++++++++++++++---------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index e0fedc97c..29a74b8be 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -14,7 +14,7 @@ jobs: - name: "Read rust version" id: read_toolchain run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT - + build-test: needs: prepare name: Build and test @@ -24,7 +24,8 @@ jobs: rust: - version: ${{ needs.prepare.outputs.rust_version }} clippy: true - - version: 1.63.0 # MSRV + - version: 1.63.0 # Overall MSRV + - version: 1.75.0 # Specific MSRV for `bdk_electrum` features: - --no-default-features --features miniscript/no-std - --all-features @@ -40,25 +41,38 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2.7.5 - name: Pin dependencies for MSRV - if: matrix.rust.version == '1.63.0' run: | - cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" - cargo update -p time --precise "0.3.20" - cargo update -p home --precise "0.5.5" - cargo update -p proptest --precise "1.2.0" - cargo update -p url --precise "2.5.0" - cargo update -p cc --precise "1.0.105" - cargo update -p tokio --precise "1.38.1" - cargo update -p tokio-util --precise "0.7.11" - cargo update -p indexmap --precise "2.5.0" - cargo update -p security-framework-sys --precise "2.11.1" - cargo update -p csv --precise "1.3.0" - cargo update -p unicode-width --precise "0.1.13" - cargo update -p rustls@0.23.21 --precise "0.23.19" + if [ "${{matrix.rust.version}}" = '1.63.0' ]; then + cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" + cargo update -p time --precise "0.3.20" + cargo update -p home --precise "0.5.5" + cargo update -p proptest --precise "1.2.0" + cargo update -p url --precise "2.5.0" + cargo update -p cc --precise "1.0.105" + cargo update -p tokio --precise "1.38.1" + cargo update -p tokio-util --precise "0.7.11" + cargo update -p indexmap --precise "2.5.0" + cargo update -p security-framework-sys --precise "2.11.1" + cargo update -p csv --precise "1.3.0" + cargo update -p unicode-width --precise "0.1.13" + cargo update -p rustls@0.23.21 --precise "0.23.19" + elif [ "${{matrix.rust.version}}" = '1.75.0' ]; then + cargo update -p home --precise "0.5.9" + fi - name: Build - run: cargo build --workspace --exclude 'example_*' ${{ matrix.features }} + run: | + if [ "${{matrix.rust.version}}" = '1.63.0' ]; then + cargo build --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} + else + cargo build --workspace --exclude 'example_*' ${{ matrix.features }} + fi - name: Test - run: cargo test --workspace --exclude 'example_*' ${{ matrix.features }} + run: | + if [ "${{matrix.rust.version}}" = '1.63.0' ]; then + cargo test --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} + else + cargo test --workspace --exclude 'example_*' ${{ matrix.features }} + fi check-no-std: needs: prepare From 12eabd1ecd30bfed1d1329966029ea8c4cc34ac1 Mon Sep 17 00:00:00 2001 From: Leonardo Lima Date: Thu, 16 Jan 2025 21:05:13 -0300 Subject: [PATCH 2/5] chore(cleanup): remove rustls from pinned deps --- .github/workflows/cont_integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 29a74b8be..6a57c9c5b 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -55,7 +55,6 @@ jobs: cargo update -p security-framework-sys --precise "2.11.1" cargo update -p csv --precise "1.3.0" cargo update -p unicode-width --precise "0.1.13" - cargo update -p rustls@0.23.21 --precise "0.23.19" elif [ "${{matrix.rust.version}}" = '1.75.0' ]; then cargo update -p home --precise "0.5.9" fi From f7c9bc5166a508743ad11f116131a6f94d3e8e9e Mon Sep 17 00:00:00 2001 From: valued mammal Date: Fri, 17 Jan 2025 13:12:36 -0500 Subject: [PATCH 3/5] docs: update `README.md` with MSRV policy - bdk_electrum: add MSRV section to README.md --- README.md | 11 +++++++++-- crates/electrum/README.md | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdc3df726..67a65d40c 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,15 @@ Fully working examples of how to use these components are in `/example-crates`: [`bdk_chain`]: https://docs.rs/bdk-chain/ ## Minimum Supported Rust Version (MSRV) -This library should compile with any combination of features with Rust 1.63.0. +The BDK library maintains a MSRV of 1.63.0. This includes the following crates + +- `bdk_core` +- `bdk_chain` +- `bdk_bitcoind_rpc`. +- `bdk_esplora`. +- `bdk_wallet`. + +The MSRV of `bdk_electrum` is 1.75.0. To build with the MSRV you will need to pin dependencies as follows: @@ -80,7 +88,6 @@ cargo update -p indexmap --precise "2.5.0" cargo update -p security-framework-sys --precise "2.11.1" cargo update -p csv --precise "1.3.0" cargo update -p unicode-width --precise "0.1.13" -cargo update -p rustls@0.23.21 --precise "0.23.19" ``` ## License diff --git a/crates/electrum/README.md b/crates/electrum/README.md index 1bafe04eb..efe7109cb 100644 --- a/crates/electrum/README.md +++ b/crates/electrum/README.md @@ -3,5 +3,13 @@ BDK Electrum extends [`electrum-client`] to update [`bdk_chain`] structures from an Electrum server. +## Minimum Supported Rust Version (MSRV) +This crate has a MSRV of 1.75.0. + +To build with MSRV you will need to pin dependencies as follows: +```shell +cargo update -p home --precise "0.5.9" +``` + [`electrum-client`]: https://docs.rs/electrum-client/ [`bdk_chain`]: https://docs.rs/bdk-chain/ From 78bbfbe7210959b2c174c6c7e418bc975055a6ca Mon Sep 17 00:00:00 2001 From: valued mammal Date: Mon, 20 Jan 2025 11:37:40 -0500 Subject: [PATCH 4/5] ci: add `pin-msrv.sh` - add ci/pin-msrv.sh, which pins the dependencies for 1.63.0 MSRV --- .github/workflows/cont_integration.yml | 35 ++++++++------------------ README.md | 17 +------------ ci/pin-msrv.sh | 24 ++++++++++++++++++ 3 files changed, 35 insertions(+), 41 deletions(-) create mode 100755 ci/pin-msrv.sh diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 6a57c9c5b..b9c1664b2 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -17,7 +17,7 @@ jobs: build-test: needs: prepare - name: Build and test + name: Build & Test runs-on: ubuntu-latest strategy: matrix: @@ -40,36 +40,20 @@ jobs: profile: minimal - name: Rust Cache uses: Swatinem/rust-cache@v2.7.5 - - name: Pin dependencies for MSRV + - name: Pin dependencies for 1.75 + if: matrix.rust.version == '1.75.0' run: | - if [ "${{matrix.rust.version}}" = '1.63.0' ]; then - cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" - cargo update -p time --precise "0.3.20" - cargo update -p home --precise "0.5.5" - cargo update -p proptest --precise "1.2.0" - cargo update -p url --precise "2.5.0" - cargo update -p cc --precise "1.0.105" - cargo update -p tokio --precise "1.38.1" - cargo update -p tokio-util --precise "0.7.11" - cargo update -p indexmap --precise "2.5.0" - cargo update -p security-framework-sys --precise "2.11.1" - cargo update -p csv --precise "1.3.0" - cargo update -p unicode-width --precise "0.1.13" - elif [ "${{matrix.rust.version}}" = '1.75.0' ]; then - cargo update -p home --precise "0.5.9" - fi - - name: Build + cargo update -p home --precise "0.5.9" + - name: Pin dependencies for MSRV + if: matrix.rust.version == '1.63.0' + run: ./ci/pin-msrv.sh + - name: Build + Test run: | if [ "${{matrix.rust.version}}" = '1.63.0' ]; then cargo build --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} - else - cargo build --workspace --exclude 'example_*' ${{ matrix.features }} - fi - - name: Test - run: | - if [ "${{matrix.rust.version}}" = '1.63.0' ]; then cargo test --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }} else + cargo build --workspace --exclude 'example_*' ${{ matrix.features }} cargo test --workspace --exclude 'example_*' ${{ matrix.features }} fi @@ -151,6 +135,7 @@ jobs: clippy_check: needs: prepare + name: Rust clippy runs-on: ubuntu-latest permissions: checks: write diff --git a/README.md b/README.md index 67a65d40c..5ed54e97b 100644 --- a/README.md +++ b/README.md @@ -73,22 +73,7 @@ The BDK library maintains a MSRV of 1.63.0. This includes the following crates The MSRV of `bdk_electrum` is 1.75.0. -To build with the MSRV you will need to pin dependencies as follows: - -```shell -cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" -cargo update -p time --precise "0.3.20" -cargo update -p home --precise "0.5.5" -cargo update -p proptest --precise "1.2.0" -cargo update -p url --precise "2.5.0" -cargo update -p cc --precise "1.0.105" -cargo update -p tokio --precise "1.38.1" -cargo update -p tokio-util --precise "0.7.11" -cargo update -p indexmap --precise "2.5.0" -cargo update -p security-framework-sys --precise "2.11.1" -cargo update -p csv --precise "1.3.0" -cargo update -p unicode-width --precise "0.1.13" -``` +To build with the MSRV of 1.63.0 you will need to pin dependencies by running the [`pin-msrv.sh`](./ci/pin-msrv.sh) script ## License diff --git a/ci/pin-msrv.sh b/ci/pin-msrv.sh new file mode 100755 index 000000000..07454d589 --- /dev/null +++ b/ci/pin-msrv.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -x +set -euo pipefail + +# Pin dependencies for MSRV + +# To pin deps, switch toolchain to MSRV and execute the below updates + +# cargo clean +# rustup default 1.63.0 + +cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" +cargo update -p time --precise "0.3.20" +cargo update -p home --precise "0.5.5" +cargo update -p proptest --precise "1.2.0" +cargo update -p url --precise "2.5.0" +cargo update -p cc --precise "1.0.105" +cargo update -p tokio --precise "1.38.1" +cargo update -p tokio-util --precise "0.7.11" +cargo update -p indexmap --precise "2.5.0" +cargo update -p security-framework-sys --precise "2.11.1" +cargo update -p csv --precise "1.3.0" +cargo update -p unicode-width --precise "0.1.13" From c8b55da39913ddaf11d26f09d92034aef4f550e0 Mon Sep 17 00:00:00 2001 From: "Leonardo L." Date: Tue, 21 Jan 2025 16:50:30 -0300 Subject: [PATCH 5/5] chore: fix punctuation and use `rustup override set` instead - fix some nits and punctuation typos. - recommend usage of `rustup override set` instead of `rustup default` command. Co-authored-by: Steve Myers --- README.md | 4 ++-- ci/pin-msrv.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5ed54e97b..c6c212f1f 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Fully working examples of how to use these components are in `/example-crates`: [`bdk_chain`]: https://docs.rs/bdk-chain/ ## Minimum Supported Rust Version (MSRV) -The BDK library maintains a MSRV of 1.63.0. This includes the following crates +The BDK library maintains a MSRV of 1.63.0. This includes the following crates: - `bdk_core` - `bdk_chain` @@ -73,7 +73,7 @@ The BDK library maintains a MSRV of 1.63.0. This includes the following crates The MSRV of `bdk_electrum` is 1.75.0. -To build with the MSRV of 1.63.0 you will need to pin dependencies by running the [`pin-msrv.sh`](./ci/pin-msrv.sh) script +To build with the MSRV of 1.63.0 you will need to pin dependencies by running the [`pin-msrv.sh`](./ci/pin-msrv.sh) script. ## License diff --git a/ci/pin-msrv.sh b/ci/pin-msrv.sh index 07454d589..214ab649d 100755 --- a/ci/pin-msrv.sh +++ b/ci/pin-msrv.sh @@ -8,7 +8,7 @@ set -euo pipefail # To pin deps, switch toolchain to MSRV and execute the below updates # cargo clean -# rustup default 1.63.0 +# rustup override set 1.63.0 cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" cargo update -p time --precise "0.3.20"