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

chore: leverage cargo's workspace inheritance #3715

Merged
merged 36 commits into from
May 2, 2023

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Mar 30, 2023

Description

Previously, we would specify the version and path of our workspace dependencies in each of our crates. This is error prone as #3658 (comment) for example shows. Problems like these happened in the past too.

There is no need for us to ever depend on a earlier version than the most current one in our crates. It thus makes sense that we manage this version in a single place.

Cargo supports a feature called "workspace inheritance" which allows us to share a dependency declaration across a workspace and inherit it with { workspace = true }.

We do this for all our workspace dependencies and for the MSRV.

Resolves #3787.

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@mergify

This comment was marked as resolved.

@thomaseizinger thomaseizinger added this to the v0.52.0 milestone Apr 3, 2023
@thomaseizinger
Copy link
Contributor Author

This is a breaking change now because it bumps MSRV.

@thomaseizinger thomaseizinger marked this pull request as draft April 3, 2023 14:23
@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@thomaseizinger

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@thomaseizinger thomaseizinger marked this pull request as ready for review May 1, 2023 13:07
@thomaseizinger
Copy link
Contributor Author

For the record, cargo release version minor --execute was a massive help in doing these version bumps. It even correctly bumped the version in the root manifest!

@thomaseizinger
Copy link
Contributor Author

@mxinden I believe this is ready for merge now. Send it if you agree! We can then kick off merging the milestone!

@thomaseizinger thomaseizinger changed the title chore: use workspace dependencies for workspace dependencies chore: leverage cargo's workspace inheritance May 1, 2023
@thomaseizinger
Copy link
Contributor Author

Let's go!

@mergify mergify bot merged commit 996b5c8 into master May 2, 2023
@mergify mergify bot deleted the chore/workspace-dependencies branch May 2, 2023 09:14
umgefahren pushed a commit to umgefahren/rust-libp2p that referenced this pull request Mar 8, 2024
Previously, we would specify the version and path of our workspace dependencies in each of our crates. This is error prone as libp2p#3658 (comment) for example shows. Problems like these happened in the past too.

There is no need for us to ever depend on a earlier version than the most current one in our crates. It thus makes sense that we manage this version in a single place.

Cargo supports a feature called "workspace inheritance" which allows us to share a dependency declaration across a workspace and inherit it with `{ workspace = true }`.

We do this for all our workspace dependencies and for the MSRV.

Resolves libp2p#3787.

Pull-Request: libp2p#3715.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify and enforce same MSRV across workspace
2 participants