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
50 changes: 49 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
DO_NO_STD: true
run: ./contrib/test.sh

MSRV:
MSRV-1.41:
name: Test - 1.41.1 toolchain
runs-on: ubuntu-latest
strategy:
Expand All @@ -66,6 +66,54 @@ jobs:
DO_FEATURE_MATRIX: true
run: ./contrib/test.sh

MSRV-1.48:
name: Test - 1.48.1 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/[email protected]
- name: Running test script
env:
DO_NO_STD: true
DO_FEATURE_MATRIX: true
run: ./contrib/test.sh

MSRV-1.51:
name: Test - 1.51.1 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/[email protected]
- name: Running test script
env:
DO_NO_STD: true
DO_FEATURE_MATRIX: true
run: ./contrib/test.sh

MSRV-1.56:
name: Test - 1.56.0 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/[email protected]
- name: Running test script
env:
DO_NO_STD: true
DO_FEATURE_MATRIX: true
run: ./contrib/test.sh

Arch32bit:
name: Test 32-bit version
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ serde = { version = "1.0", default-features = false, features = [ "alloc" ], opt
zeroize = { version = "1.5", features = ["zeroize_derive"], optional = true }

# Unexported dependnecies
bitcoin_hashes = { version = ">=0.12, <=0.13", default-features = false }
bitcoin_hashes = { version = ">=0.12,<0.15", default-features = false }
unicode-normalization = { version = "0.1.22", default-features = false, optional = true }

[dev-dependencies]
# Enabling the "rand" feature by default to run the benches
bip39 = { path = ".", features = ["rand"] }
bitcoin_hashes = ">=0.12,<0.14" # enable default features for test
bitcoin_hashes = ">=0.12,<0.15" # enable default features for test


[package.metadata.docs.rs]
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ This crate supports Rust v1.41.1 and up and works with `no_std`.

The `bitcoin_hashes` range dependency effects the MSRV as follows

- `bitcoin_hashes v0.12`: MSRV v1.41.1
- `bitcoin_hashes v0.13`: MSRV v1.48.0
- `bitcoin_hashes v0.12`: MSRV `v1.41.1`
- `bitcoin_hashes v0.13`: MSRV `v1.48.0`
- `bitcoin_hashes v0.14`: MSRV `v1.56.1`

When using older version of Rust, you might have to pin the versions of several crates, for an up-to-date list refer to [`contrib/test.sh`](contrib/test.sh):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this no longer true, i.e., why don't we have to pin back the other dependencies below?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly a faulty rebase conflict resolution? I made changes to these lines in #86 and this PR was open forever. @tcharding

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I just clobbered them because over the last year (since edition 2018 came into rust-bitcoin) I've barely ever had to pin anymore. Admittedly not the best reason for the change, I've put it back how it was.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it depends which MSRV you are targeting, a lot of the bip39 deps seem to have bumped their MSRV in minor version releases. I only had to pin for the old rust version tests back then.

Copy link
Member

Choose a reason for hiding this comment

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

In rust-bitcoin and related crates we've avoided pinning by using fixed lockfiles, which we basically never update even though we should. That's why you haven't had to deal with this crap @tcharding.

Copy link
Collaborator

@tnull tnull Oct 28, 2025

Choose a reason for hiding this comment

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

Yeah, eventually we might want to discuss doing a conservative MSRV bump here (1.41 seems very old by now, for every standard), potentially just aligning it with the rust-bitcoin policy.

But, for now, that's out-of-scope of this PR. And if we already have the checks in place, there probably is no rush to do so.


Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Spurious whitespace here.

```bash
cargo update --package "bitcoin_hashes" --precise "0.12.0"
cargo update --package "rand" --precise "0.6.0"
Expand All @@ -46,4 +47,4 @@ cargo update --package "tinyvec" --precise "1.6.0"
cargo update --package "unicode-normalization" --precise "0.1.22"
```

If you enable the `zeroize` feature the MSRV becomes 1.51.
If you enable the `zeroize` feature the MSRV becomes `v1.51.0`.
20 changes: 19 additions & 1 deletion contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ if cargo --version | grep "1\.41"; then
cargo update --package "unicode-normalization" --precise "0.1.22"
fi

# Pin dependencies as required if we are using MSRV toolchain.
if cargo --version | grep "1\.48"; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

No super strong opinion, but in LDK we use such a pattern (just an example, see https://github.com/lightningdevkit/rust-lightning/blob/0.2/ci/ci-tests.sh):

RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')

# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

Seems this could be a bit cleaner/less error prone if we start handling even more different rust versions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just hope that once we hit rust version 1.480 in 45 years we won't be testing 1.48 anymore 😆

cp Cargo-minimal.lock Cargo.lock
cargo check --locked
rm Cargo.lock

cargo update --package "bitcoin_hashes" --precise "0.13.0"
fi

# Pin dependencies as required if we are using MSRV toolchain.
if cargo --version | grep "1\.56"; then
cp Cargo-minimal.lock Cargo.lock
cargo check --locked
rm Cargo.lock

cargo update --package "bitcoin_hashes" --precise "0.14.0"
fi

echo "********* Testing std *************"
# Test without any features other than std first
cargo test --verbose --no-default-features --features="std"
Expand All @@ -34,7 +52,7 @@ do
cargo build --verbose --features="$feature" --no-default-features
done

if cargo --version | grep -v "1\.41"; then
if cargo --version | grep "1\.51"; then
cargo build --verbose --features="zeroize" --no-default-features
fi

Expand Down