Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new v3 resolver for msrv compliant dependency versions #99

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

nyonson
Copy link
Collaborator

@nyonson nyonson commented Nov 25, 2024

A few characteristics of how Rust resolves dependencies were at odds in the workspace:

  1. Transitive dependency versions are shared across all projects in a workspace. These are set in the workspace's Cargo.lock file.
  2. The Rust resolver generally uses the highest version of a transitive dependency possible.
  3. The protocol library project has a more conservative MSRV policy requirement than the proxy application.

When introducing the regtest library, I ran into an issue where a new transitive dependency of the protocol project was having its version bumped due to it also being in the proxy project's dependency tree. This caused the protocol project to fail its MSRV policy.

Using resolver = 3 on rust nightly to set transitive dependency versions in lock file. While setting the workspace's resolver setting to 3, hoping over to the nightly toolchaing, and running cargo update is not very maintainable, I am hoping we are not adding too many dependencies to this workspace. Another option is to just run the project on the MSRV toolchain and fix each transitive version by hand and set its version with cargo update .... That sounds worse to me.

$ cargo update
    Updating crates.io index
     Locking 17 packages to latest Rust 1.63.0 compatible versions
 Downgrading addr2line v0.24.2 -> v0.21.0 (requires Rust 1.65)
      Adding adler v1.0.2
    Removing adler2 v2.0.0
 Downgrading backtrace v0.3.74 -> v0.3.69 (available: v0.3.74, requires Rust 1.65.0)
 Downgrading cargo_toml v0.20.5 -> v0.15.2 (available: v0.15.3, requires Rust 1.64)
    Removing equivalent v1.0.1
 Downgrading gimli v0.31.1 -> v0.28.1
 Downgrading hashbrown v0.15.1 -> v0.12.3
 Downgrading indexmap v2.6.0 -> v1.9.3
 Downgrading miniz_oxide v0.8.0 -> v0.7.4
 Downgrading object v0.36.5 -> v0.32.2
 Downgrading regex v1.11.1 -> v1.9.6 (available: v1.11.1, requires Rust 1.65)
 Downgrading regex-automata v0.4.9 -> v0.3.9
 Downgrading regex-syntax v0.8.5 -> v0.7.5
 Downgrading serde_spanned v0.6.8 -> v0.6.1 (available: v0.6.8, requires Rust 1.65)
 Downgrading toml v0.8.19 -> v0.7.3 (available: v0.7.8, requires Rust 1.66.0)
 Downgrading toml_datetime v0.6.8 -> v0.6.1 (available: v0.6.8, requires Rust 1.65)
 Downgrading toml_edit v0.22.22 -> v0.19.8 (available: v0.19.15, requires Rust 1.66.0)
 Downgrading winnow v0.6.20 -> v0.4.1 (available: v0.4.11, requires Rust 1.64.0)
```

@nyonson nyonson changed the title Try out v3 resolver for msrv Use the new v3 resolver for msrv compliant dependency versions Nov 25, 2024
@nyonson nyonson marked this pull request as ready for review November 25, 2024 19:48
@nyonson
Copy link
Collaborator Author

nyonson commented Nov 26, 2024

Change only effects the proxy, tested locally and looks good.

ACK 30de612

@nyonson nyonson merged commit 53b65a9 into rust-bitcoin:main Nov 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant