Skip to content

chore: leverage cargo's workspace inheritance#3715

Merged
mergify[bot] merged 36 commits intomasterfrom
chore/workspace-dependencies
May 2, 2023
Merged

chore: leverage cargo's workspace inheritance#3715
mergify[bot] merged 36 commits intomasterfrom
chore/workspace-dependencies

Conversation

@thomaseizinger
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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