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

run cargo autoinherit #9030

Closed
wants to merge 1 commit into from

Conversation

zancas
Copy link
Contributor

@zancas zancas commented Nov 16, 2024

Motivation

The purpose of this change is to unify redundant dependency information into a Single Source of Truth in the workspace Cargo.toml.

Here's result of a search for a dependency before running the tool:

grep -r -e"color-eyre = \"0.6.3\"" */Cargo.toml
tower-batch-control/Cargo.toml:color-eyre = "0.6.3"
zebra-chain/Cargo.toml:color-eyre = "0.6.3"
zebra-consensus/Cargo.toml:color-eyre = "0.6.3"
zebra-grpc/Cargo.toml:color-eyre = "0.6.3"
zebra-node-services/Cargo.toml:color-eyre = "0.6.3"
zebra-rpc/Cargo.toml:color-eyre = "0.6.3"
zebra-scan/Cargo.toml:color-eyre = "0.6.3"
zebra-state/Cargo.toml:color-eyre = "0.6.3"
zebra-test/Cargo.toml:color-eyre = "0.6.3"
zebra-utils/Cargo.toml:color-eyre = "0.6.3"

The same version information is set in 10 different sources of truth.

After the tool runs the version is specified (uniquely) in the workspace Cargo.toml:

grep -e"color-eyre = " Cargo.toml
color-eyre = { version = "0.6.3", default-features = false }

Specifications & References

https://crates.io/crates/cargo-autoinherit

Solution

cargo autoinherit

Tests

I manually tested by running:

cargo nextest run

PR Author's Checklist

  • The PR name will make sense to users.
  • The PR provides a CHANGELOG summary.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.

PR Reviewer's Checklist

  • The PR Author's checklist is complete.
  • The PR resolves the issue.

@zancas zancas requested review from a team as code owners November 16, 2024 22:22
@zancas zancas requested review from arya2 and upbqdn and removed request for a team November 16, 2024 22:22
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Nov 16, 2024
@zancas zancas mentioned this pull request Nov 16, 2024
@oxarbitrage oxarbitrage added the A-dependencies Area: Dependency file updates label Nov 18, 2024
@oxarbitrage oxarbitrage mentioned this pull request Nov 18, 2024
7 tasks
@oxarbitrage
Copy link
Contributor

I think this is a good idea but i want to test it against the Zebra CI so i opened a PR that does the same so we can test that out:

#9041

Also there are a few messages when running cargo autoinherit, they seems fine to ignore as the Cargo.toml of those is actually changed:

`tower-batch-control` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`tower-fallback` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-chain` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-consensus` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-grpc` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-network` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-node-services` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-rpc` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-script` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-state` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-test` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebra-utils` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).
`zebrad` won't be auto-inherited because it appears at least once from a source type that we currently don't support (e.g. private registry, path dependency).

@oxarbitrage
Copy link
Contributor

I replaced this PR with this one #9041 as it can run the CI and we can make updates if needed.

@mpguerra mpguerra reopened this Dec 16, 2024
@mpguerra mpguerra closed this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependencies Area: Dependency file updates C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants